Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: illabefat on August 16, 2012, 04:39:16 pm

Title: RTF template edition
Post by: illabefat on August 16, 2012, 04:39:16 pm
I'm trying to write an add-in that generates one report from several others. Little reports have personal template.
So I just use Project.RunReport() method to generate them.
Now I need to add Phase filtering for elements.(and this phase should be set in run-time)
I didn't find any methods for changing templates. Is there any API for that?
And what will you advice to do?
Title: Re: RTF template edition
Post by: Stefan Bolleininger on August 16, 2012, 06:13:42 pm
Hi, you can select the template you want to use with

Project.RunReport(PackageGUID, TemplatenameasString, Output-filename);

A nice option for just a few elements or specific items is the usage of a sql-query and export it as XML. then reload the xml and put it into your template.

Alternative: Create individual templates and report them ( much easier)

Second alternative: Export your needed items from several search functions into a preprocessing and store them into the win temp folder als rtf-files. Than run the report you want to have with the EA-internal templates. Next Step: Combine all these files into one document with a postprocess (Word and external template).

With these possibilities you can achieve many reports for each single way and idea :-)

Greetings Stefan
Title: Re: RTF template edition
Post by: illabefat on August 17, 2012, 03:31:34 am
Thank you!

I need to add the same filter to several RTF templates. Is there any opportunity to automize it? (macro, script, anything)
Title: Re: RTF template edition
Post by: Stefan Bolleininger on August 17, 2012, 06:20:21 pm
Yes, this would be the mentioned option ONE or three.

You may create search functions which can be called directly from an add-in.

Create an add-in for your workflow. You can select a few choices for specific workflows and a template selection. With the workflow you are able to use specific searchfunctions and add them into your template.

The work is worth it :-)
Title: Re: RTF template edition
Post by: illabefat on August 17, 2012, 08:51:09 pm
But how?
Even if I create addin and search function, how to add it to template?