![]() |
Telelogic DOORS (steve huntington) | ![]() |
Topic Title: RTF exports - Ability to modify existing script to accomodate a template Topic Summary: Created On: 29-Jan-2008 00:14 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi All,
This may be a rather dumb question but I figured I should ask anyway. For Microsoft Word exports, the export is based on a template file. RTF exports do not have such an option. Have any of you modified the existing RTF export script to accomodate a specifical template file? If so, I would appreciate it if you could let me know how you did this. Thank you. Regards, Pranav |
|
![]() |
|
![]() |
|
Hi Pranav,
I just created a custom RTF export script based on the original RTF export which also uses now an RTF file as a template. The template functionality is limited to providing a cover page, TOC, headers, footers etc. The bad message is that a major change to the standard RTF export is required, and that you have to cope with RTF tags. I created this script due to the fact that WEXP is no longer supported by Teleleogic, and - what is more problematic -, does no longer run under DOORS 8.2 or later. So I incorporated all features we were using in WEXP. The advantage is speed. Module that took more than one hour to export by WEXP now exports in less than a minute. I am willing to share this script, please send me a mail and I will send you the script. best regards, Michael Send me mail |
|
![]() |
|
![]() |
|
Pranav,
I started from scratch, with an exporter that uses RTF (for speed) and flexibility. It uses a two-pass process, although the first pass only has to be done once per 'template'. The template is a DOORS module, that contains all the fonts, styles, colours, attribute access scripts, header, footer and front-page information. A script parses this and creates a DXL include file. This is then included by the exporter, which spits out an RTF file for the current module, based on the template last parsed. It can also auto-number figures and tables, using an attribute for the caption text; export objects as text (just object text/heading), table (all visible attributes as a table) or 'requirement' (all visible attributes as paragraphs); include sub-modules, if they are linked through a specific link module (preserving numbering and hierarchy if required); and other stuff. I published a version here a couple of years ago, but it's been significantly improved since. The only problem I have is with the dialogue box on the front end, which ahs a habit of appearing to crash (throws up DOORS errors) then runs perfectly happily. If you want a copy, I may be able to publish the latest version... Paul. ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|
![]() |
|
![]() |
|
Hi,
Not only is 10x faster but it does not use the System Clipboard! I am working on a similar script, but I implemented the template feature using a regular Word template and a temporary RTF file. Not only you can have the template content formated easily in Word but you can insert your company picture, and define all kinds of fields TOC, Fields in Header/Footer, page numbers, bla, bla 1. The script opens a Word Template (OleAutoObj oActiveDoc) 2. Exports bookmarks, like WEXP (each bookmark text from the template is updated with the info) 3. Creates a simple RTF file cout << rtfHeader cout << styleSheet cout << fontTable bla bla 4. Dumps all the objects for o in document m do { cout << richTextFragment(richTextWithOle o."Object Text", fontTable) cout << rtfPara bla bla } 5. closes the rtf cout << rtfEnd 6. using the OleMethod "InsertFile" on the original Word template to include the rtf content put(oArgBlock, rtfFileName) oleMethod(oActiveDoc, cMethodInsertFile, oArgBlock) 7. Word will import the rtf content relatively fast. 9. finaly update all fields in the oActiveDoc (TOC, page numbers, etc I encountered a few problems though: a. Picture export - solved by the following when a picture object is found - close the temp rtf file and imported to the word document - export picture to file - import the picture file (using the InlineShapes ole object) - reopen the temp RTF file - continue with the rest of the objects b. Bullet list text within a table will crush the Word 2000 - the solution I found is to remove the bullet info by parsing the RichText rt within the Object Text Note: Word 2003 is working nicely without removing the bullets Octavian |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.