jlopes151 Posted August 1, 2011 Share Posted August 1, 2011 I'm getting the following error "No serializer found for class". I'm trying to gen a report using a List object. Also is there a way to create a .jrxml for such a rreport?James Link to comment Share on other sites More sharing options...
rajendratambat Posted August 4, 2011 Share Posted August 4, 2011 I have tried using ArrayList object.you need to put this list object in JRBeanCollectionDataSource here is code sample how i didMyBean is my pojo class with getters and setters Rajendra Tambathttp://rajendratambat.blogspot.com/ Code:ArrayList beans = new ArrayList();MyBean row211 =new MyBean("Header3452345","subheader1","row21","VALU23 ");MyBean row212 = new MyBean("header1234","subheader1","row21","VAL2");beans.add(row211);beans.add(row212);Map parameters = new HashMap();// prepare report and dataFileInputStream is = new FileInputStream(new File("C:\\data\\mytest\\test.jrxml"));JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(beans);// generate pdf fileJasperDesign jasperDesign = JRXmlLoader.load(is);JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,ds);JasperExportManager.exportReportToPdfFile(jasperPrint, "C:\\data\\mytest\\mytest.pdf"); Link to comment Share on other sites More sharing options...
jlopes151 Posted August 4, 2011 Author Share Posted August 4, 2011 Ya did that when I didn't find a solution and it did the trick.Thanks for the reply though Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now