Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Reporting Framework - Export to Excel, PDF and mail them [closed]

Tags:

java

reporting

Reporting Framework:

I have a datasource (JSON/XML API) which provides me all the necessary data. I just need to populate it in various tables and then export it to various formats like PDF, Excel etc in some template format and then mail users. This has to happen periodically in background (according to some cron job)

I have found Jasper and BIRT as good solutions. But just for exporting data to various formats with templating, are they good solutions ? Are there any other lighter solutions than them ? I tried Apache POI as well but given free availability of various exporting libraries, should I need to all manual work on my own ?

Templating feature is essential and other functionalities like mailing and all are optional provided the framework is light weight, flexible and easy to use.

Please advice.

Thanks

like image 584
mac Avatar asked Apr 17 '13 08:04

mac


4 Answers

If you are looking for alternatives here is one that is not mentioned above.

Docx4j (http://www.docx4java.org/trac/docx4j) is open source, available under the Apache License (v2). Docx4j relies heavily on JAXB, the JCP standard for Java - XML binding. You can think of docx4j as a JAXB implementation.

What sorts of things can you do with docx4j

  • Open existing docx (from filesystem, SMB/CIFS, WebDAV using VFS), pptx, xlsx
  • Create new docx, pptx, xlsx
  • Programmatically manipulate the above (of course)
  • Specific to docx4j (as opposed to pptx4j, xlsx4j):
  • Template substitution; CustomXML binding
  • Produce/consume Word 2007's xmlPackage (pkg) format
  • Save docx to filesystem as a docx (ie zipped), or to JCR (unzipped)
  • Apply transforms, including common filters
  • Export as HTML or PDF
  • Diff/compare documents, paragraphs or sdt (content controls)
  • Font support (font substitution, and use of any fonts embedded in the document)

For email Java Mail with Attachment. Here is and example http://www.javatpoint.com/example-of-sending-attachment-with-email-using-java-mail-api

like image 106
Gladwin Burboz Avatar answered Nov 14 '22 22:11

Gladwin Burboz


Jasper Reports is a good solution to create reports with templates from SQL databases and XML files (i haven't tested if it supports JSON), the advantage of it is that if you don't like how the default Jasper Server works, you can modify it or you can create a small service on your own, this last is easy to do as exporting to PDF (or any format) is done with a couple of lines of code.

like image 34
Miguel Garcia Avatar answered Nov 14 '22 23:11

Miguel Garcia


You could try Aspose libraries. Aspose.cells and Aspose.pdf would do much of the work for you but you would have to pay for it. The libraries are useful nevertheless.
http://www.aspose.com/

http://www.aspose.com/java/excel-component.aspx

http://www.aspose.com/java/pdf-component.aspx

like image 38
divyanshm Avatar answered Nov 14 '22 23:11

divyanshm


we are using art: http://art.sourceforge.net/ . I think it knows everything you want and it is still active project so if you add new feature you can add request for it.

like image 44
hudi Avatar answered Nov 14 '22 23:11

hudi