Friday, 01 March 2013 13:05

Script that creates an RTF document using the DocumentGenerator API

Written by
Rate this item
(6 votes)

Enterprise Architect offers extensive support for generating RTF documents that most of the time will meet your reporting needs.

For those who get stuck and are not afraid of some scripting, there is an alternative in the EA.DocumentGenerator API. The attached ZIP file contains the script and 2 RTF templates that show you how generate a document using this API and how to include variable content like the name of the user who created it.

To use this script


1) Download the attached file ACME.XML

2) Import this in EA


3)  Select the option from the element context menu in the project browser

 

NOTES

  • The script uses a function i published earlier to query the database (ExecuteSQL; script is included in ACME.XML). If you are using a DBMS instead of .EAP check if the two SQL statements at the beginning of the script 'ACME_ContextDocumentGenerator' are suitable for your DBMS
  • The script uses the RTF templates 'ContextMaster' (main body) and 'ContextDiagram' (for each separate included diagram). The templates have been stripped down to the eassentials, you can easily extend them using the EA template editor.
  • If the element has a linked document then this document is used as the main body
  • Be aware that generated RTF documents can become very large due to the included images. You can reduce the size dramatically by converting the RTF document to Word format (i'll add automatic conversion in a future version)
Read 8056 times Last modified on Thursday, 11 August 2016 02:23
Login to post comments