Reports engine in Archi

Started by Tutulala, July 16, 2015, 21:16:05 PM

Previous topic - Next topic

Tutulala

Hi everyone. I am using the latest release of Archi and I have some questions about the reporting engine used in Archie. Where can I see the implementation of reporting? I would like to create own template in Jasper Studio  (using SQL query) and import it into Archi and use this template as the major in Archi. Can I do it? How?

Thanks to all who answered. . .

Jean-Baptiste Sarrodie

Hi,

Default reports are inside "Archi/plugins/com.archimatetool.jasperreports_3.x/reports". I suggest you use "Customizable Report" as a basis because it already incude several enhancements.

Regards,

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Tutulala

#2
Hi, Jean-Baptiste Sarrodie. Thanks for the answer. I have a few more questions. I would like to import a standard report template (Customizable Report) in Jaspersoft Studio and edit it there. How can i do this? Besides it in folder Customizable Report there are several files:
diagram_object.jrxml
elements.jrxml
main.jrxml
properties.jrxml
view.jrxml
and style.jrtx
and the picture is the background by default.
Which file or files should I edit to make a few changes to the standard report template?

Thanks for the feedback



When I try to view the design of the standard template (main.jrxml) in JasperSoft Studio me an error. The screenshot link. I do not understand why. As I can then edit the template?

Tutulala

Up! Can anyone help me please?

Tutulala

I managed to get rid of the difficulties associated with the export of standard report templates Jaspersoft studio. I understand the file extension jrtx responsible for the design of the report. Why need these files:
diagram_object.jrxml
elements.jrxml
main.jrxml
properties.jrxml
view.jrxml

Please answer as soon as possible. Thank you for your feedback.

Jean-Baptiste Sarrodie

Hi,

Sorry for late answer...

In fact in JasperReport, a report can include another one, this is a powerfull feature. In the Customizable Report, the main report is managed by main.jrxml, then each other subreports are used for (from memory so may be a little bit false, you've to check by yourself):

  • views.jrxml to print all information related to a view
  • diagram_object.jrxml for diagrams inside a view
  • elements.jrxml to list elements from a whole model and/or a view
  • properties.jrxml doesn't print anything but is used to extract specific informations stored through properties (all the Report:... propeties that you can use to customize the report

Regards

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Tutulala

#6
Jean-Baptiste Sarrodie,

Now I'm trying to edit Standard Report  for themselves. However, there are several difficulties:

  • I do not understand how data is received from the model to the report. I do not see any data source in the report structure. How is the filling of the report data?
    For example, if I want to get the name of the view, I declare a field in the structure of the report (in other files .jrxml,not in views.jrxml), as is done for the field name in the report structure view.jrxml. When generating a report, it does not operate. Why is that?
  • I would like to display information about specific views and objects on them, how do I implement it? By default, the view and the objects in it are not related in the report (and I see information about all objects in all views - it does not suit me). How can I fix this?

  • Present such situation. In the Views folder of model in Archi I have subfolders. In these subfolders there are two or more ArchiMate View with identical names. But I want to reflect information only on one of them in the report and on any another, at which unique name. How to make it? For clarity of a situation I attach a screenshot.


Please answer as soon as possible. Thank you for your feedback.

Jean-Baptiste Sarrodie

Hi,

I'm sorry, but it seems like it will take you a lot of time....

Jasper is a kinda generic report engine. This means that there are several ways to feed report with data. Using a (SQL) query is a typical (and easy to understand) one, but in Archi we use a JAVA class data source (in jasperreport language, a JRDataSource). You can see the JAVA source code for those datasource on the Archi GitHub  repository, the main datasource is ArchimateModelDatasource: this is the class (in fact object from that class) that is passed to the report engine when you request report creation from menu.

This means, that you first have to find suitable documentation on internet to understand how it works and then look at those classes to see how you can use them. You also have to note that there's no simple way to run a report from iReport or JasperReport Studio in this context, so you have to update your report design in iReport or Studio and try to run this report from Archi itself. That's how I did when I created my reports. A lot of work when you do it for the very first time.

In your context, you have to know that using the customizable report you can put "tags" on views and then create a report containing only views matching a specific tag. I usually tag each views on my "big" model with tags telling me which application and project is concerned (that's 2 separate tags). Then If I have to create a PDF document about a project (e.g. for solution architecture) I just run the report with the tag associated with the project, if I want to provide usefull documentation about one specific application, I just run the report with the tag associated with the application.

Regarding element filtering, there's currently nothing like that implemented in the customizable report, but it should be "easy" to customize elements.jrxml to look for element properties and then hide this element if needed, but properties being global on an element (whatever the view) you would not be able to hide one element in a view and show it elsewhere.

Regards

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Tutulala

#8
Quote from: Jean-Baptiste Sarrodie on August 01, 2015, 21:58:42 PM
I'm sorry, but it seems like it will take you a lot of time....
Perhaps you have an idea as it is easier to implement?


Quote from: Jean-Baptiste Sarrodie on August 01, 2015, 21:58:42 PM
Jasper is a kinda generic report engine. This means that there are several ways to feed report with data. Using a (SQL) query is a typical (and easy to understand) one, but in Archi we use a JAVA class data source (in jasperreport language, a JRDataSource). You can see the JAVA source code for those datasource on the Archi GitHub  repository, the main datasource is ArchimateModelDatasource: this is the class (in fact object from that class) that is passed to the report engine when you request report creation from menu.
I use Eclipse to view the source code Archi by this instruction


Quote from: Jean-Baptiste Sarrodie on August 01, 2015, 21:58:42 PM
This means, that you first have to find suitable documentation on internet to understand how it works and then look at those classes to see how you can use them.
Maybe you can give links to specific resources?


Quote from: Jean-Baptiste Sarrodie on August 01, 2015, 21:58:42 PM
You also have to note that there's no simple way to run a report from iReport or JasperReport Studio in this context, so you have to update your report design in iReport or Studio and try to run this report from Archi itself. That's how I did when I created my reports. A lot of work when you do it for the very first time.
I have encountered this. It is not very convenient at each change report in JasperSoft Studio then run it in Archi.


Quote from: Jean-Baptiste Sarrodie on August 01, 2015, 21:58:42 PM
In your context, you have to know that using the customizable report you can put "tags" on views and then create a report containing only views matching a specific tag. I usually tag each views on my "big" model with tags telling me which application and project is concerned (that's 2 separate tags). Then If I have to create a PDF document about a project (e.g. for solution architecture) I just run the report with the tag associated with the project, if I want to provide usefull documentation about one specific application, I just run the report with the tag associated with the application.
What does the "tag" mean? Can you give an example?


Quote from: Jean-Baptiste Sarrodie on August 01, 2015, 21:58:42 PMRegarding element filtering, there's currently nothing like that implemented in the customizable report, but it should be "easy" to customize elements.jrxml to look for element properties and then hide this element if needed, but properties being global on an element (whatever the view) you would not be able to hide one element in a view and show it elsewhere.
In a case when I want to receive the report on some views from all Archi model: prompt please how to transfer the names of the views to the properties.jrxml file. or in the elements.jrxml file to show only those elements and properties which are available in this view. Whether it is necessary to create separate field or parameter for this purpose? How to transfer a name of a certain view to this field or parameter?


d.saunders@ucas.ac.uk

Just a small point, but when creating html reports I've noticed that < and > come out at &lt; and &gt;

Any suggestions? Thanks