Exporting Data From DOORS 9.2

I have had no training to speak of in dxl and have only copied from others and modified things.  So, please forgive my potentially naive questions.

I am using DOORS 9.2.

I have the following very simple dxl script snippet.  It's purpose is to walk through the DOORS module I have open, typically filtered to just be a portion of the module, and output each object to its own text file.  The name of the file includes the absolute number to make it unique.

Module curmod = current
Object curobj
int absno
string objText


for curobj in curmod do 
{
   // Capture data from the object
   absno = curobj."Absolute Number"
   objText = curobj."Object Text"
   
   string sOutputName = "C:\\temp\\DOORS\\Export\\MyModule\\" absno ".txt"
   
   // Only write out OIDs with text (Don't need headers which have no object text)
   if (length objText >0)
   {
      Stream out = write sOutputName
      out << objText
      close out
   }
      
}

This doesn't handle objects with rich text, well, at least the rich text formatting isn't preserved.  That's the first thing i need help with. (I recognize that it is sending it to a text file and that wouldn't be rich text.  I'm sure there is more to it.)  I'd like the rich text, if any present, to be preserved in the file output for each object.  

The next issue is with embedded OLEs (typically MS Excel) mixed in with rich text.  I'd like those OLE's to be exported out in a separate file from the rest of the content.  In other words, if the object has rich text and two OLEs, there would be 3 tiles produced.  If this is hard or not possible, one file with the rich text preserved and the OLE embedded would work.

This seems like a fairly straight-forward thing to do.  Browsing though the dxl reference, I see various functions like oleIsObject, oleCount, containsOle, oleCopy, olePaste, olePasteSpecial.  So, it seems like there's like some built-in functionality that can be leveraged.  I've been told that I need to make sure that memory is freed up automatically in the DXL to make sure I don't cause memory issues.  Not sure how this is done.

Thank you so much for the help in advance!

 

RC_GregLew

 


RC_GregLew - Fri May 25 16:53:51 EDT 2018

Re: Exporting Data From DOORS 9.2
RC_GregLew - Fri May 25 17:25:44 EDT 2018

I saw another forum post about rich text and may have solved one of my issues.

I made changes to two lines my simple dxl script snippet. It now uses richTextWithOle when capturing the text from the object (setting variable objText) and the output file name is changed to have rtf extension (setting sOutputName).  Changed code is in bold.

Module curmod = current
Object curobj
int absno
string objText


for curobj in curmod do 
{
   // Capture data from the object
   absno = curobj."Absolute Number"
   objText = richTextWithOle curobj."Object Text" // richTextWithOle enables the content to retain rich text formatting.
   
   string sOutputName = "C:\\temp\\DOORS\\Export\\MyModule\\" absno ".rtf"
   
   // Only write out OIDs with text (Don't need headers which have no object text)
   if (length objText >0)
   {
      Stream out = write sOutputName
      out << objText
      close out
   }
      
}