Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jasper reports

 
sajeevi bangamuwage
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir/madam,


I have get my first jasper report with the help of youall. Thank you for that.
Tha report was coming as jViewer and it saves HTML file format. But i want to get it to PDF file format.also i want to get it in Acrobar reader.Can you please tell me how can i do the change to my following coding to get from acrobat reader and export to PDF file format.
I have write it as follows.but it gives me errors.

Thank you very much.


String reportSource = "./report/templates/HelloReportWorld.jrxml";
String reportDest = "./report/results/HelloReportWorld.pdf";

Map<String, Object> params = new HashMap<String, Object>();

try
{
JasperReport jasperReport =
JasperCompileManager.compileReport(reportSource);

JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport, params, new JREmptyDataSource());

JasperExportManager.exportReportToPdfFile(
jasperPrint, reportDest);

JasperViewer.viewReport(jasperPrint);
}

catch (JRException ex)
{
ex.printStackTrace();
}
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll move this to our "Other Open Source Project" forum where you might get an answer.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of errors? In which line of code?
 
sajeevi bangamuwage
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for replying me. It gives run time error saying some problem in main
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TellTheDetails
 
sajeevi bangamuwage
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im sorry to say just now i cant tell the details because im in the lab and i dont have any details with me.i'll try to post you tomorrow and expecting your greate help.
Thank you very much sir.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic