PDF Generation on ADF. (Java itext Libraries vs Jasper Report Integration).

68 views
Skip to first unread message

Daniel Diaz

unread,
Sep 22, 2018, 9:06:56 AM9/22/18
to ADF Enterprise Methodology Group
Beside the Jasper integration to generate PDF there is a more simple way to create the PDF with iText java libraries.

It is pretty maintainable and easy to use. Tables. reports and  picture can be creating and attach dynamically.

This is a simple example about how  to generate a simple Certification on PDF.


My point of view is that is easier and more maintainable  than Jasper Report Integration implementation because in case of any change you just have to change java code in your app and not any jasper report.
On top of that there no need to integrate to differents editor and to learn about other tool.  To some people is more comfortable to keep up the implementations with Java.

Leave your opinion.


Jang-Vijay Singh

unread,
Sep 22, 2018, 11:31:38 AM9/22/18
to adf-met...@googlegroups.com
Yes, I agree. 
JasperReports makes your solution more maintainable and declarative. 
Once (if) you’ve written your “plumbing code” well (this would include passing data parameters to your report, picking up the right jrxml/.jasper file name etc), the rest of your solution is elegantly declarative. 

You can design your “report” in a wsyiwyg editor (also provided by jaspersoft - has a community & commercially licensed version). This stays separate from your ADF/java code. 

In addition to pdf, you can also create spreadsheets or word documents. 

With JasperReports, its also easy to plug the same solution in to automated business processes (SOA/BPEL/BPM) to send documents (eg invoices attached to email or  in web service response). 

JV 

Sent from a mobile device
--
--
You received this message because you are subscribed to the ADF Enterprise Methodology Group (http://groups.google.com/group/adf-methodology). To unsubscribe send email to adf-methodolo...@googlegroups.com
 
All content to the ADF EMG lies under the Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/). Any content sourced must be attributed back to the ADF EMG with a link to the Google Group (http://groups.google.com/group/adf-methodology).

---
You received this message because you are subscribed to the Google Groups "ADF Enterprise Methodology Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adf-methodolo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Diaz

unread,
Sep 22, 2018, 7:21:53 PM9/22/18
to ADF Enterprise Methodology Group
Hi Jang is great to have your opinion even if I partially disagree with you in some points.

1. With PDF library is easier because you do not have to use any other code or tool outside your ADF and jdeveloper editor.

2. With changes of version of the editor the way to integrate both tools change in some details, with can lead sometimes to hair pulling (I can tell that by experience).

Referring to this 2 points that you mentioned you are right and that is a thumb up to Jasper Report Integration.

1. In addition to pdf, you can also create spreadsheets or word documents. 

2. With JasperReports, its also easy to plug the same solution in to automated business processes (SOA/BPEL/BPM) to send documents (eg invoices attached to email or  in web service response). 

I know there are a lot of experts who are going to be disagree with me, if you are.  Please leave your opinion, It is great to here differents points of view, in that way you can keep learning from other experts.

Best Regards.





Alexis Lopez

unread,
Sep 22, 2018, 10:47:57 PM9/22/18
to adf-met...@googlegroups.com
Hi,

I've been in projects that have many reports and I can tell my clients like the idea of having an external tool to design the reports of the application. That way, they can assign the report design to other resources rather than java developers. As Jang suggested, once the plumbing code is done, things go smoothly.

On the other hand, I have worked in projects with lots of reports that never got updated, they are using JasperReports 3.x... So yes, when using JasperReports or any other technology to generate reports and new versions arrive, you have to think about migration. Isn't the same thing with iText?

When reports are complex or depend on many conditions, I've suggested using DynamicReports, which in the end uses JasperReports. However, https://www.dynamicreports.org is no longer available. Source code has been moved to https://github.com/dynamicreports/dynamicreports by some people who want to continue supporting this tool. If you use DynamicReports, maybe you would like to contribute to the project.

Regards,

Jang-Vijay Singh

unread,
Sep 23, 2018, 1:18:32 AM9/23/18
to adf-met...@googlegroups.com
Hi, 

Daniel, I misunderstood you a bit originally. I now also read your blog post briefly. 
I still think that amount of code to generate a visual layout shown in your post might become hard to maintain very soon. 
Keeping your report design template separate from other code that serves data also fits better with MVC patterns (the jrxml/jasper report template = view). 
You'll be able to write more effective and meaningful test cases for your Java code e.g. to check that it passes the right data, picks the right report template etc.
All good for the long run if your code is creating important documents like invoices. 

Alexis, 
Thank you for sharing dynamicreports info - it looks promising and looks less commercialised than Jasper. 
But as such you can create fairly complex, dynamic, and conditional layouts in JasperReports - it has a powerful expression support - such as XPath, if your incoming data is XML/JSon. 
And I've been able to achieve all this with the community licence (but its worth checking if their commercial licence is at all required for your particular deployment). 

On versions and migration, I think it important to use a dependency management and build solution like maven (JDev/ADF and other FMW applications have adequate support for this) but this is true for any Java based framework so not specific to iText/Jasper. 
This is a general comment, Daniel, I know your blog post is only intended to show an example - but instead of putting third party libraries on a google drive, I would point your readers to the original download links for those libraries, or just tell them specific version/build numbers, or even better, just create a maven pom file for your project. 

 Best Regards, 
Jang-Vijay 

Jang-Vijay Singh

unread,
Sep 25, 2018, 1:45:08 AM9/25/18
to adf-met...@googlegroups.com
Hi Daniel, 
I found something else that is interesting:
This keeps your solution simple with only iText and Java. 
But instead of defining your layout in Java, you can define it in a more familiar wordprocessor (OpenOffice). 

I have not tried this approach myself but seems it would work easily. 

Hope this helps - as it seems your goal is to avoid the more heavy framework like JasperReports (can be overkill for simple printable reporting requirements) 

JV 

Daniel Diaz

unread,
Sep 25, 2018, 2:32:19 PM9/25/18
to ADF Enterprise Methodology Group
Hi alexis about the migration with Itext library, it does not apply, because the worst that can happen in the future is that the code will be depreciated but it will keep working the same while you have the libraries. Usually with java libraries everything that is depreciated keep working.  (Almost all the time).

Best Regards. 

Daniel Diaz

unread,
Sep 25, 2018, 2:32:19 PM9/25/18
to ADF Enterprise Methodology Group
Great share! I will take look at it!

I already did dynamic reports with several tables and at first was hard. but then was really easy I think.

I think to easy reports in PDF is suitable.

I will take all the advices given.

Best Regards.
Reply all
Reply to author
Forward
0 new messages