Hi I am trying to generate report programmatically from EA using C#.
Project.RunReport
By referring this.
But the problem is RunReport allows to choose only main template by passing the parameters
PackageGUID: String - the GUID of the Package
or master document to run the report on
TemplateName: String - the
document report template to use; if the PackageGUID has a stereotype
of MasterDocument, the template is not required
FileName: String - the
file name and path to store the generated report; the file extension
specified will determine the format of the generated document - for
example, RTF, PDF
How to set coverPage and TOC using this RunReport API call..?
Your report should already have a Cover page and TOC defined with it Seems like you will need to use DocumentGenerator or add the TOC Manually after the document is generated as you cannot insert a TOC in a Report Template.
If you want to define those separately, use the DocumentGenerator facility
Document Generator Reference
Related
I want to generate a file in ASP.Net Core using a pre-defined template. The template has several variables which has to be replaced by the values in the generated file. Template has "%" wildcard to identify the variable. For example, In the attached image, %SITECODE% should be replaced by the actual value.
I have a Schematic template that refers to the DrawnBy parameter and others to fill in the title block. This works fine if I edit each sheet's document parameters to display the correct information. However, I want to use the project parameters to fill in the relevant information.
The schematic documents have default parameters such as, DrawnBy, Revision, etc, that override the project parameters so each sheet needs to be manually edited for author, dates, and revisions.
How do you override the default document parameters with project parameters?
This would be a better fit for the electronics.stackexchange.com site.
On the schematic document or template (sheet), each field is represented by using the custom text =ParameterName. Once you have the document open in the context of a project, you can add project-level parameters via the menu Project > Project Options, Parameters tab. Add the parameter using the same name that was used on the document. All documents sharing the parameter name will inherit the value entered here.
Don't add any parameter to this list that should be unique to each sheet.
For more information:
Altium Designer: Project Options - Parameters
Electronics StackExchange: Project parameters as variable in Altium
I am using JETT to generate xls from xls template. My input data will be given in pages is there way to append data to sheet as well applying template from input xls to output workbook using Jett api's
It is definitely possible.
You can write some script code at the beginning of your sheet (with ${{ /*your code here;*/ return '';}} . This code will get the data from the sheets using POI API and will store it in some variables. See how to access POI API from JETT Script here: http://jett.sourceforge.net/expressions/poi_objects.html ).
Once the data is stored into variables, you can insert them in sheets with standard JETT templating capabilities, by referring to the variables that you created in your script block.
Just make sure that the code block creating the variables with data lies before the place where the variables are used in your template.
How can i include a profiled Relationship matrix in html reports in Enterprise Architect.
I have a link on each diagram which points to a profiled relationship matrix.
I tried to generate a html report for my project. But all these relation matrix links are disabled.
A relationship matrix can't be directly included in an HTML generation and there's no way to script running it or exporting it to an image file. But you can include it in an RTF document, so here's a sort of workaround based on RTF templates and virtual documents.
Create an RTF template which outputs the relationship matrix image. You might want to include the package name and the current date and time as well.
For each package you want a matrix report for, create a «model document» and add the package to it. Please note that if you've defined multiple relationship matrices for a package, you can't choose which one to report - EA will just pick one.
For each «model document», create an Artifact and draw a «trace» from the «model document» to the Artifact.
Move the Artifacts to a package which is included in the HTML generation. You don't have to place them in any diagrams if you don't want to, but they must reside inside the hierarchy for which HTML is generated.
The «model document»:s should be in a separate package which is not included in the HTML generation. Name them according to the scheme "pkgname - matrixname" or similar.
The Artifacts should be given names which make sense within the generated HTML - call them "Requirement Matrix: pkgname" or similar.
Now, before you run your HTML generation, you must run the matrix reports individually and manually by right-clicking the Artifact in the same diagram as the «model document» and selecting "Create Document to Artifact" (so it's a good idea to include the date and time in the template). Then generate your HTML as usual.
This will output the matrix images into the HTML. You'll have to click the document to see the image and as noted you'll have to run the matrix reports manually, but the result will be there.
You could do something similar by placing hyperlinks to image files in your diagrams and then output the different matrices to these image files. I prefer the Artifact method, because it keeps everything inside EA (no broken links) and it gives you the option of including the report date and time and more stuff if you want it.
For word report generation, I am looking at binding XML to content controls to see if it is any easier than to use Word Interop and hardcode index reference to content controls to assign values to them.
However, I don't really understand how to do it.
My work flow is entering information in Excel and then generate an XML file to have content controls populated by XML, however, what I read is the other way round: Word Control Control Toolkit and descriptions where the XML is populated by user entering information in Word, and then programmer to unzip docx file to retrieve the XML file.
How can I populate content controls with XML?
There are samples on generating Word documents from Word templates, XML and data bound content controls # http://worddocgenerator.codeplex.com/
Set up the mapped content controls in the 'template' docx using the content control toolkit or similar. Do this using a sample XML file containing your Excel data.
Now you have that template document, at run time you can inject your XML file into it (ie replace the custom xml part it contains, with your instance data), in C# or Java or whatever.
When the user opens the document in Word 2007/2010, the information in the custom XML part will automatically be copied into the bound controls, and visible to the user.
Note that content control data binding doesn't easily support repeating data (eg populating table rows) in Word 2007/2010, though there are ways to do it.