Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Contents |
Prev | Next |
Custom Query Fragments
You can create Template Fragments to return data from SQL Queries, or from Model Scripts. The first step in defining such Fragments is to use the Custom Query settings to enter your SQL Search, a starting point for your Model Script, or the existing template fragments that correspond to the specific types of element being reported.
Access
Ribbon |
Publish > Documentation > Document Templates : <select a fragment template> : |
Custom Query Options
Option |
Action |
See also |
---|---|---|
Custom SQL |
Click on this radio button to enter an SQL Query. You can then add fields within the 'Custom' section of your Template Fragment, to refer to the data returned by the SQL Query. |
Custom SQL Fragments |
Custom Script |
Click on this radio button to display a field in which you specify a Model Script; click on the drop-down arrow and select the name of the Script that will be used by your Template Fragment. You can then add fields within the 'Custom' section of your Template Fragment that refer to the data returned by the Script. |
Custom Script Fragments |
Template Selector |
Click on this radio button to define a template that calls in other Template Fragments depending on the element type being reported on. |
Define a Template Selector |
Document Script |
Click on this radio button to display a field in which you specify the Model Script to be used by your Template Fragment. Click on the drop-down arrow and select the script from the list. The script must return either an empty string or a string that contains raw RTF. See the example script. |
Example Document Script
!INC Local Scripts.EAConstants-JScript
function main()
{
var reporting as EA.DocumentGenerator;
reporting = CreateDocumentGenerator();
if(reporting != null)
{
if(reporting.NewDocument(""))
{
if(!reporting.LoadDocument("<filename>"))
{
Session.Output( "Error: " + reporting.GetLastError() );
}
return reporting.GetDocumentAsRTF();
}
}
}
Learn more
Notes