jasper reports in play

452 views
Skip to first unread message

mms mns

unread,
Jun 20, 2011, 3:23:38 AM6/20/11
to play-framework
hi again

thanks all for your continuous support ... i dont know what i would do
without you :)

today am trying to generate jasper reports

can anyone show me the way ...the steps or if there is any document
to do this...!!!

appreciate any help tip

all the best

mms mns

unread,
Jun 20, 2011, 5:15:32 AM6/20/11
to play-framework
i tried to copy what i used to do in JSF but i get errors on these

12:

import net.sf.jasperreports.engine.JasperFillManager;

13:

import net.sf.jasperreports.engine.JasperPrint;

14:

import net.sf.jasperreports.engine.JasperReport;

15:

import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;

16:

import net.sf.jasperreports.engine.util.JRLoader;

they are not recognized !!!! are there any missing jars !!!

i just couldnt figure this out :(

mms mns

unread,
Jun 22, 2011, 2:46:34 AM6/22/11
to play-framework
good morning,

for the previous problem i added the jars manualy in the lib folder...
(i already added them in the build path but i was supposed to add them
in the lib folder ...i dont know why!!!!)

this is my method now

private static void generateReport(Integer cprNumber) {
// JasperPrint jasperPrint=null;
Map reportParams = new HashMap();
// ArrayList reportFieldsList = new ArrayList();
try{
// reportParams.put("CPR_NUMBER", cprNumber);
System.out.println(new File("").getCanonicalPath());
JasperCompileManager.compileReportToFile("D:/src/play-
workspace/NDS/public/report/personInfo_1" + ".jrxml", "D:/src/play-
workspace/NDS/public/report/personInfo_1" + ".jasper");
JasperFillManager.fillReportToFile("./public/report/
personInfo_1" + ".jasper", reportParams);
}catch (Exception e) {
e.printStackTrace();
}

render();
}

i have no error but the report is not displayed !!! :)

please am new to this ...

mms mns

unread,
Jun 22, 2011, 3:34:36 AM6/22/11
to play-framework
solved :D

i altered this line
JasperPrint jrprint = JasperFillManager.fillReport("./public/report/
personInfo_1" + ".jasper", reportParams);

and added this
JasperViewer.viewReport(jrprint);

thank you myself ;)
> i have no error but thereportis not displayed !!! :)

piotrze

unread,
Aug 13, 2011, 8:57:38 AM8/13/11
to play-framework
I'm using jasper with play framework that way:
https://gist.github.com/1143821

ypee

unread,
Sep 30, 2012, 1:19:18 PM9/30/12
to play-fr...@googlegroups.com, om_faj...@hotmail.com, Adetunji ADEGBITE

Hi pls can you guide me on how you achieved this when you did, i have gone through the post but i dont know how to put things together in play. Kindly assist.
Reply all
Reply to author
Forward
0 new messages