Enhanced Document Generation in Enterprise Architect 11

Webinar November 2014
In this webinar you will learn how to:
  • Define your own stylesheet to create attractive reports
  • Create custom queries to extract model data
  • Combine Virtual Documents with custom templates for maximum flexibility

In this second of our two webinars on using Enterprise Architect's Document Generator, we analyze a real-world example to teach you enhanced techniques for generating document deliverables.

Ben Constable
Ben Constable

Explore the Example Data Model and Document Templates

We have provided the example Enterprise Architect model used in the webinar, along with the associated resources.
Example model: document-generation-enhanced-example-model.eap Download Enterprise Architect Example Model for ArcGIS Geodatabase Documentation
Document templates: arcgis-data-dictionary-document-templates.xml Download Enterprise Architect Example Report Templates for ArcGIS Geodatabase Documentation
Generated Document: smart-meter-data-dictionary-report.docx Download ArcGIS Geodatabase Data Dictionary Word Document Generated by Enterprise Architect

Questions from the Audience

Click on a question to see the answer.


 I was not able to attend the first webinar. Is it available as a video stream?

Yes. You can view the presentation video and read answers to questions from the audience on the webinar's landing page.

Editing Templates

 Is there a way to show on the report business rules linked to requirements?

Yes. Using the Element | Connectors | Source/Target sections:

Link Business Rules to Requirements in Enterprise Architect

 Is it possible to insert fragments of content in a document not directly associated with model elements?(For example some content at the start of the document with an overview about the project.)

Yes. You can type or copy and paste text and images that are not part of the model into report templates. This is useful when defining templates for sections such as the cover page or preamble.

 Is it possible to replace Exceptional scenario using the Word substitution feature? (Basic and Alternative scenarios can be replaced.)

Not yet. We have raised a feature request for this.

 Will you provide us support in creating standard templates for a project, if required?

Sparx Systems can provide technical support for any product issues encountered while developing templates. However we do not provide a service for actually developing report templates. You may be interested in engaging the services of one of our training or consulting partners.

 How do I report the team discussion created in the Specification Manager related to one specific element, e.g. a requirement?

Element Discussions will be available as a report template section in the next major release, Enterprise Architect 12, which is available now in beta to registered users. Reporting discussions created with the Team Review feature is not yet supported.

 How do you use Bookmarks?

You can use Bookmarks to refer to sections within your generated document and to customize how certain fields and sections are reported – for example, preventing labels being reported for empty fields. For details, see the Help topic Insert Reference Links.

 How do I "Conditionally write text around any field only if it is non-empty", as mentioned in Enteprise Architect's release notes?

As explained in the Help topic Insert Reference Links, you enclose a labeled field with .Begin and .End bookmarks.

 How can I include linked Notes from an Activity Diagram in a report?

  1. On the Diagram Properties dialog, enable the option "Document each contained element in Documentation".
  2. In your report template, enable the section Diagram > Element (even if blank).
  3. In your report template, click the Document Options toolbar icon. On the Document Options tab turn off the option "Hide <Anonymous> elements". (Notes are anonymous elements.)

Style Sheets

 Which version of Enterprise Architect supports style sheets?

Version 11.

 In the style editor, there appears to be no indicator to show when you are in edit mode and which style you are changing. How do I know that I'm in the special style editing mode?

After you click OK on the Edit Stylesheet dialog, the system immediately puts you into the style editing mode and returns you to the style sheet template. You remain in that mode until you left click the Document. You will then immediately see any changes applied to text that uses the style you modified.

 Regarding the system-provided style sheets, does medium in the name "Print Medium" mean medium resolution or medium size?

Medium refers to the font sizes used in that style sheet.

 How do you add header numbering to the style sheets?

The easiest way is to copy one of the system-provided style sheets when you create a style sheet. Otherwise, to add numbered headings to an existing or blank style sheet:

  1. Open the style sheet template
  2. Type some text
  3. Apply the style you want from the style drop-down list
  4. Right click and select Edit | Edit Style
  5. Click OK
  6. Right click and select Paragraph | Numbering
  7. Click OK
  8. Click on the Document to apply the style.
  9. Click Save

 Can you import a stylesheet from an existing Word document template?

No. See the previous webinar's Q&A for an explanation.

Custom Queries and Filters

 Would Ben be able to provide his custom templates with SQL queries?

Yes. The templates are available for download from this page as the resource arcgis-data-dictionary-document-templates.xml

Import the XML file as Enterprise Architect Reference Data. For instructions, see the Help topic Import Reference Data.

 With respect to custom queries, how can I learn more about the database schema to write SQL commands?

Enterprise Architect's Object Model is outlined in the Reference Help Topic, which applies to automation.

You might start with the Repository Package page.

Then refer to its Repository Class sub topic.

Although the Repository Class does not have a corresponding database table, its associated Classes generally have one. For example, the Element Class page lists the following:

Associated table in .EAP file: t_object

So an SQL query to retrieve element fields would use the t_object table as in:

SELECT Name AS ElementName FROM t_object

Also see the Help topic Create Search Definitions and the sample model on this page. The sample includes 5 templates that use custom queries. The names of those templates have the prefix "ArcGIS Data Dictionary Query".

 Is there a definitive guide for understanding the object model for generating SQL syntax in EA?

No, but the response to the previous question lists some useful resources.

 When generating diagram reports, is it possible to filter out Diagram Hyperlinks? (We have one at the top of every page to make our own breadcrumb trail.)

In your report template, click the Document Options toolbar icon. On the Document Options tab turn off the option "Hide <Anonymous> elements".

 Can custom queries be used somewhere else (not just for document generation)?

Depending on the nature of the queries, you might use them with Enterprise Architect's Model Search facility. The Model Search results can be reported using the Document Generator as well.

 What is the difference between a template with SQL inside and a Template Fragment?

Template Fragments can optionally use an SQL query to return data. Other kinds of report template cannot do this. If you want to use an SQL query in your Template Fragment, you need to enable the Custom section, as explained in the Help Topic Custom SQL Fragments.

Virtual Documents

 Which version of Enterprise Architect supports Virtual Documents in document generation?

Version 3.6, or later.

 Can you drag individual elements (rather than packages) onto a Model Document?

No. The document generator only supports packages or Model Searches on Model Documents.

 Could you show again how to set cover page and TOC template for a Master Document?

You set these templates when generating the Master Document. As of Enterprise Architect 11, the cover page and TOC templates can be separate to the Master Document's template. See the video presentation at 16:50 minutes.

 I would like more information about creating Virtual Documents and using SQL queries, do you have any resources available?

There is a short segment on creating Virtual Documents in our video on Requirements Reporting at 8:36 minutes.

For more information about using SQL queries, see some of the previous responses on this page.

 Do you have a book to explain reporting in detail?

We have not published a book, but there are several online resources published by Sparx Systems that may help. In addition to this webinar, the following presentations discuss Enterprise Architect's reporting capabilities:

For written documentation on report generation see the Online Help topic Reporting.

Alternative Reports Formats

 Could you use Enterprise Architect for generating business rules reference documents?

Yes. You could create a report template and enable the relevant sections of the model.

 Can I save my documents in HTML format?

Yes. Enterprise Architect has a built-in HTML report generator, though it has a limited set of customization options compared to the document generator and it is not template-driven. Alternatively, you might save your generated document as HTML using your document editor's capabilities.

 Is it possible to export part of the documentation to XSLX format?

No. Enterprise Architect's document generator does not support XSLX format.

 I use the report generator to produce XML documents. I sometimes need to replace special characters like ä, ö, umlauts, but also things like quotation marks ". How can I do this using a template?

Currently there is no facility to replace specific characters in model data returned by template fields.

 We use the Document Generator to create documents that incorporate Linked Documents as well as notes and properties from the model elements... How can we generate a list of all the model elements which have a linked document?

Use Enterprise Architect's Model Search feature to search for elements with Linked Documents. Access the Model Search feature via the main menu: Edit | Find in Project. Create a new search with the SQL Editor option. Copy this query into the editor:

Object, Object_Type AS [Type], Stereotype, Author, Scope,
Status, Phase, CreatedDate, ModifiedDate
FROM t_object
WHERE t_object.Style LIKE '#WC#MDoc=1#WC#'

Click the Save button in the toolbar, then run the search.

If you want to execute the query directly from Enterprise Architect's SQL scratch pad, replace #WC# with the actual wildcard for your DBMS (for example use * on an EAP file or % on a MySQL repository).

For more details on creating model searches, see the Help topic Create Search Definitions.