New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Jasper Reports] Print relations for each view in model #510
Comments
Hi Nick, thanks for the submssion. This could be an optional feature of the Japer Reports. Some of the proposed changes to the code are a bit more problematic:
I'll look a bit deeper, but I'm sure this could be done in a simpler way. That's not to disparage your changes. :-) It's just I that I need to see if the DataSource API could be modified in a better way to return relationships. |
Hi Phillipus, Wanted to share with you guys to see if this could be done in a more clean and efficient way than I did. |
Hi Nick, yes I thought that. :-) My comments are not criticisms, just code comments. So thanks for sharing. :-) I'll take a look at it soon. |
We probably need a new class like |
IF we look at how the ArchiMate elements are returned for a View we see that these are in the So, I've created a new class The This is in the git branch "jasper-viewrelations". If you like, you could test this. Of course, it will mean re-doing your *.jrxml file. |
Once we've had more testing of the new method |
The changes to the @NickTononi If you want to use this API in your *.jrxml file feel free to try it. |
Works like a charm, thanks for merging into master branch. Does this mean that the next Archi release will support this feature? |
Yes. |
But the jrxml file is unchanged. That is a separate issue. |
getChildRelationsDataSource() follows exactly the same structure and pattern as getChildElementsDataSource() so I can't see how it would cause an error if used in the same way. Suggest setting a debug breakpoint and seeing what's wrong. |
The error in Eclipse is: Caused by: java.lang.ClassCastException: class com.archimatetool.jasperreports.data.ViewRelationsDataSource cannot be cast to class com.archimatetool.jasperreports.data.ElementsDataSource So looks like your jrxml file needs changing? |
Probably because it is using the elements.jrxml sub-report. You might need to modify that one to handle relations and a ViewRelationsDataSource? I suspect that a sub-report (elements.jrxml perhaps) is set up for ElementsDataSource but not for ViewRelationsDataSource At the data level we know that ViewRelationsDataSource is returning the right data set but the jrxml files need to be changed to handle it. Perhaps you might need a new sub-report type relations.jrxml? |
I now edited the jrxml file in order to use the feature. And here is the resulting report: Thanks for your hints and suggestions on this one. |
@NickTononi There may be a change to this. See #518 |
Hello,
I edited the archi code and model to add this feature.
This feature allows to see the relations associated with a view.
I'm attaching a generated report after the changes I made.
report-with-relations-per-view.pdf
Is this a feature that might come handy?
The text was updated successfully, but these errors were encountered: