Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting .jrxml file to .pdf file

I ran few load test on my web application. Problem is the results of the load test application is in .jrxml format. The result contains charts graphs and certain parameters. I know its a jasperreport format. So if I convert the .jrxml file to .pdf file will I be able to see all charts,graphs and values...

I am assuming irrespective of the .jrxml content about chart or graph the pdf generated will contain appropiate values as template is prepared according to the charting API.

Can I produce jasper report without specifying any datasource connection..I dont need a datasource connection since my .jrxml file does not contain a datasource attribute... If yes, how can I acheive it.. Kindly suggest

like image 557
AngelsandDemons Avatar asked Mar 09 '12 12:03

AngelsandDemons


People also ask

How do I convert a Jrxml file to PDF?

Re: How to convert .jrxml to pdf or exel This file can be uploaded, from iReport, to Unified Reporter or CABI. And from UR/CABI you can run/schedule this report and define/save your report in pdf format. and select "run", in the generated output you can select how to save the report.

What is Jasper PDF?

JasperReports is an open source Java reporting tool that can write to a variety of targets, such as: screen, a printer, into PDF, HTML, Microsoft Excel, RTF, ODT, comma-separated values (CSV) or XML files.


1 Answers

If you don't have any data source, you can try this

jasperReport = JasperCompileManager.compileReport(sourceFileName);
jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter,new  JREmptyDataSource()); 
JasperExportManager.exportReportToPdfFile(jasperPrint, "D://Test.pdf");

Even if you do not have any data source and its a static data report giving JREmptyDataSource is required.

Check the answer for more explanation

Blank PDF even with the simplest Jasperreport jrxml

like image 166
Hardik Mishra Avatar answered Sep 19 '22 13:09

Hardik Mishra