Jump to content
We've recently updated our Privacy Statement, available here ×

Generate a Report with a List, Error retrieving field value from bean


Recommended Posts

Hello, I'm a newbe

I tried to generate a Report with Eclipse / JasperSoft Studio
 here's my code:

public void reportGenerieren(List daten, String path) throws JRException{

  JasperReport jr = (JasperReport) JRLoader.loadObjectFromFile(path);
       JasperPrint jasperPrint = JasperFillManager.fillReport(jr, null, new JRBeanCollectionDataSource(daten));
       //JasperPrintManager.printReportToPdfFile(jasperPrint, "C:\meinePDF.pdf");
       JRPdfExporter pdf = new JRPdfExporter();
       pdf.setParameter(JRPdfExporterParameter.JASPER_PRINT, jasperPrint);
       pdf.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "C:\Temp\test.pdf");
       pdf.exportReport();
 }

But I allways get the error: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : gueltigbis

How can I solve this problem?

Thanks for your help

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

I am guess that daten is a list of geraet.

Two ways for solution:
1. Change getter for gueltigbis from "getGueltigBis()" (now) to "getGueltigbis()"  - it must match field name in jrxml (case-sensitive)
or

2 Change field "gueltigbis" to "gueltigBis" in jrxml

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...