jasper reports alternative to poi jar - java

I have a Java application that uses Jasper to create docx. Jasper uses poi to export to docx. There are a few issues with the documents generated with poi and I was wondering if there are any good alternatives to poi. Apart from modifying the source code of Jasper, is there a way to link the new jar to Jasper so that it uses it instead of poi? If i write my own docx exporter can it be easily linked so that Jasper will use it? Does anybody know an article that explains how to link a custom jar (or an alternative jar) to Jasper?

In this post, it appears the author is converting Jasper's XHTML output into docx format using docx4j. Perhaps that results in a 'better' docx, without the effort of -rewriting Jasper's docx exporter?

Related

How to print PDF files using Java

In my project I have JSP pages that should print PDF documents
You can use iText, fop or other.
Take a look at:
Compare these products for PDF generation with Java given requirements inside: iText, Apache PDFBox or FOP?
Are there any Java PDF creation alternatives to iText?
See the following which will convert HTML to PDF.
https://code.google.com/p/flying-saucer/
Easier than working with iText directly.

Converting .xls to .pdf using Java(or not)

Is there a way to convert a xls file into a pdf?
I want to make a dynamical report directly to pdf file, but didn't find a way to make dynamic columns on iReport, so I've made a method on Java that exports to xls dynamically.
So I was wondering if is there a way to convert this file to pdf, but it need to be on a method from my code. Or if you have a better idea, it can be used too.
Maybe there's a way to make this pdf file from my code as I did with xls. Please help me out.
Thanks.
Try using iText http://itextpdf.com/ - I've used it to create PDFs with columnar structure.
In addition to using iText directly, there are a couple report engines that sit on top of it:
Eclipse BIRT (using 2.1.7, the last MPL/LGPL version)
Jasper Reports (which uses a Very Old version, 1.3.1 IIRC)
This is a commercial solution:
http://www.dancrintea.ro/xls-to-pdf/
If you want open source try jakarta POI.
Try using the Muhimbi PDF Converter Services. It comes with a Java compatible Web Services based interface and sample code. It does other things as well.
I worked on this application, so the usual disclaimer applies.

How to convert .doc / .xls file into PDF using Java

I want to convert .doc/.xls file into PDF through my java application. Now, I know there have been some discussions on this topic. I also know that JODConverter is one option, but the problem with this is dependency on OpenOffice. Whoever wants to use my app will first need to install OpenOffice on his/her host. I want to avoid this. Do we have any new solution through which I can do this conversion in my app without having dependencies on any other applications.
You could use POI for reading XLS and DOC, and use iText for generating the PDF.
POI project:
http://jakarta.apache.org/poi/
iText project:
http://www.lowagie.com/iText

Creating PDF, HTML, and optionally RTF documents from the same source using Java?

I was looking at using iText to create both a pdf and html version of a document with RTF as a possible option. According to this question this is no longer possible with iText. Is there a library that will allow me to create a document in Java and output it as both PDF and HTML? The ability to output RTF would be nice but is not required.
As that answer to the other question states, you can just use the iText RTF Library.
I have used PD4ML to convert HTML to pdf. Even though it is a commercial app. It is very reliable and supports CSS well.
JasperReports. If you look at this package it supports export to:
pdf
html
rtf
xls
xml
You have two options to create the documents:
via iReport - a visual designer for reports
via an API, where you construct everything with Java code.
Note that even though JasperReports's main function is to create reports, it can very well create other documents, with no tabular data for example.
You could also try Docmosis since that supports the output formats provided by OpenOffice (including the ones you specified) and you can often do the job with a lot less code.

export a report in ms word(97-2003) without using RTFExporter in jasper reports

I have a report which needs to be exported in pure word format(97-2003) using jasper report. But Jasper uses RTFExporter for exporting report in doc format, wen i read the report using POI, it throws error saying its not pure word. Can anyone help how to generate a report in word using Jasper reports. Please help!
I'm pretty sure you can't do anything closer than RTF from Jasper. If you can't replace the Jasper report, then you need to find something that will read the RTF and render it as a DOC.
You could use Docmosis to read the RTF and spit out a DOC. Docmosis is based on OpenOffice and Java and OpenOffice has pretty impressive filters for saving in different formats. Also, most platforms are supported since you haven't mentioned any limitations on what type of system you are running on.
Aspose.Total will allow you to generate .doc files from Jasper.
Aspose.Words for JasperReports is the
only known solution on the market that
makes possible exporting reports from
JasperReports and JasperServer to
Microsoft Word document (DOC), Office
Open XML (OOXML, DOCX), Rich Text
Format (RTF), OpenDocument Text (ODT),
Web page (HTML) and plain text (TXT)
formats.
It looks quite expensive, though.

Categories

Resources