Topic
  • 7 replies
  • Latest Post - ‏2012-08-17T14:43:37Z by MikeS.
a.mansoor
a.mansoor
17 Posts

Pinned topic Preserving Formatting while using script expression to filer DOORS text

‏2012-08-09T17:15:56Z |
Hi All,

There are posts since 2009 asking about RPE removing formating when a script expression is used to export text. I am attempting to export text from doors which has Bold, bulleted, subscript, and indented text in it. All that is removed when using a script expression to filter some unwanted carriage returns and to enter a few Line breaks in other places ('\v' vertical tab in word). I am looking for a workaround for this problem. There must be a few FRE regarding the feature by now. I was thinking of exporting all the text using Data expressions which preserves all the formatting then writing a VB macro to do all the needed filtering. Is this the best solution? I am not familiar with DXL but should i pursue writing a DXL script or a batch file to alter the data before or after it leaves RPE?

I submmited a PMR for this issue if that helps. PMR 62672,999,649
Updated on 2012-08-17T14:43:37Z at 2012-08-17T14:43:37Z by MikeS.
  • Dragos.Cojocari
    Dragos.Cojocari
    1654 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-10T08:02:43Z  
    Hey Mansoor,

    as you know this is not possible with RPE but we are planning to add it in our next release.

    Regards,
    Dragos

    RPE Actual
  • a.mansoor
    a.mansoor
    17 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-10T13:31:52Z  
    Hey Mansoor,

    as you know this is not possible with RPE but we are planning to add it in our next release.

    Regards,
    Dragos

    RPE Actual
    That is very good to hear! will this be in the next major release? How often are new releases published?
    In the mean time, my question is can I do the text filtering in one of the following ways:
    • using the DXL to filter unwanted text and use data expressions in RPE to export the text.
    • I see that RPE takes doors and converts it to xml. is that file accesable so that some filtering can be done on it?
    • in some other way using a vb macro in word by exporting elements with some specific tag for each type of element and then using a macro to remove the tags and correct the formatting.

    I know the last one should be possible. Are the other two possible as well? Would they take less time
  • MikeS.
    MikeS.
    9 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-10T21:44:13Z  
    • a.mansoor
    • ‏2012-08-10T13:31:52Z
    That is very good to hear! will this be in the next major release? How often are new releases published?
    In the mean time, my question is can I do the text filtering in one of the following ways:
    • using the DXL to filter unwanted text and use data expressions in RPE to export the text.
    • I see that RPE takes doors and converts it to xml. is that file accesable so that some filtering can be done on it?
    • in some other way using a vb macro in word by exporting elements with some specific tag for each type of element and then using a macro to remove the tags and correct the formatting.

    I know the last one should be possible. Are the other two possible as well? Would they take less time
    I recommend adding tags to your RPE export to make it easy to find the pieces that need to be post processed. Then make a VBA script to find your tags and make the necessary changes. You can set RPE to automatically execute the macro when it's finished creating the word document so users won't even know it's running.

    I've used this approach for making references in DOORS work as cross references in documents as well as for adjusting figure and table sizes to the published document size instead of the DOORS view size. The macros tend to take only a few seconds to run on documents that are several hundred pages long.

    I would not recommend touching the text in DOORS. DOORS does NOT fully support RTF. It's possible for users to have cut and paste text into DOORS that will display fine, but will not work correctly once manipulated with DXL.

    Hope this helps.

    -Mike
  • Dragos.Cojocari
    Dragos.Cojocari
    1654 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-13T08:40:23Z  
    Hey,

    have you considered using Layout DXL in a column to get the desired formatting? If you can get the formatting that you need than this should be the least invasive solution and most likely the cheapest too.

    Regards,
    Dragos

    RPE Actual
  • a.mansoor
    a.mansoor
    17 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-13T16:34:52Z  
    • MikeS.
    • ‏2012-08-10T21:44:13Z
    I recommend adding tags to your RPE export to make it easy to find the pieces that need to be post processed. Then make a VBA script to find your tags and make the necessary changes. You can set RPE to automatically execute the macro when it's finished creating the word document so users won't even know it's running.

    I've used this approach for making references in DOORS work as cross references in documents as well as for adjusting figure and table sizes to the published document size instead of the DOORS view size. The macros tend to take only a few seconds to run on documents that are several hundred pages long.

    I would not recommend touching the text in DOORS. DOORS does NOT fully support RTF. It's possible for users to have cut and paste text into DOORS that will display fine, but will not work correctly once manipulated with DXL.

    Hope this helps.

    -Mike
    Thanks Mike

    This was the solution I thought of as well, add tags before and after each segment to identify it then use some macro to treat each segment correctly. Do yo mind sharing a bit of the macro you used for this purpose?

    Ahmed
  • a.mansoor
    a.mansoor
    17 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-13T16:42:51Z  
    Hey,

    have you considered using Layout DXL in a column to get the desired formatting? If you can get the formatting that you need than this should be the least invasive solution and most likely the cheapest too.

    Regards,
    Dragos

    RPE Actual
    I have no experience working with DXL so I have no idea what using "a Layout DXL in a column" means at the moment. but I have a programming background so it should not be too difficult. Please let me know if there is some socumenentation that you recommened regarding the use of DXL and integrating it with RPE. Thanks for the suggestion.

    Ahmed
  • MikeS.
    MikeS.
    9 Posts

    Re: Preserving Formatting while using script expression to filer DOORS text

    ‏2012-08-17T14:43:37Z  
    • a.mansoor
    • ‏2012-08-13T16:34:52Z
    Thanks Mike

    This was the solution I thought of as well, add tags before and after each segment to identify it then use some macro to treat each segment correctly. Do yo mind sharing a bit of the macro you used for this purpose?

    Ahmed
    This example formats table of figures entries. These were set up in DOORS before we had RPE (I would make it so we could just use the RPE objects now, but this is a generic example of what to do) so we marked each DOORS object that goes in the table of figures using an attribute. The RPE template is set up so "qqq" is inserted before text that is supposed to be a Table of Figures entry and "zzz" is inserted before text that is supposed to be a Table of Tables entry.

    The attached MS Word macro was run after the document is generated from RPE.

    The macro basically just goes to the beginning of the document and finds all of the "qqq" text. The macro inserts a field to mark it as a Table of Figures entry. When it's all done with those, it goes back to the beginning and finds all of the "zzz" text and makes Table of Tables entries for them.

    The part of the code that actually does the formatting you want to do (make a table of figures field in this case) can usually be recorded in MS Word by doing it once with the macro recorder on. To make it work on the whole document, you just add the loop to find your marker text with a while Selection.Find.Found loop around it.

    Hope this helps. This technique can save a LOT of time mucking with data in DOORS or RPE. Especially if there's something not quite right with the data (like a user pasted RTF into DOORS that contains formatting that DOORS displays but doesn't formally support).

    -Mike