JasperReports: How to call the report in jsp page

前端 未结 6 620
迷失自我
迷失自我 2020-11-27 21:02

I made one jasper report using iReport 3.7.4 version, now i have to use that or call that report in my java application where i am using servlets, jsp and strut

6条回答
  •  天涯浪人
    2020-11-27 21:37

    This piece of code should give you some idea on how to do it

    JasperReport jr=JasperCompileManager.compileReport("yourJRXMLFilePath");
    JasperPrint jrPrint = JasperFillManager.fillReport(jr,mapWithParameters,aJRDataSource);
    JasperExportManager.chooseYourFavoriteMethod(jrPrint,"destinationFile");
    

    Otherwise, check the api The first line can be ommited if you had already compiled the file with iReport. Check the api for the correct method on JasperFillManager in this case.

提交回复
热议问题