Jump to content
JasperReports Library 7.0 is now available ×

Error Retrieving field value from Bean


veera

Recommended Posts

Dear Everyone,

 

Greetings from Veera.

 

The problem of mine would make u to brush up ur mind.

 

The problem occurs when the Array List is passed to the jasper report from the Java Code.

 

The Error is :

 

net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : $F{count}

 

The real Code is :

 

try

{

DBConnection db = new DBConnection();

Connection conn=db.connect();

Map parameters = new HashMap();

parameters.put("title","It is for testing");

JasperDesign jasperDesign = JasperManager.loadXmlDesign("F:\reports\districteligiblestatistics.jrxml");

JasperReport jasperReport = JasperManager.compileReport(jasperDesign);

 

//String[] fields = new String[] { "districtname", "count"};

//HibernateQueryResultDataSource ds = new HibernateQueryResultDataSource(stat, fields);

//JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(stat,fields);

 

JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(stat);

JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, beanCollectionDataSource);

byte[] bytes = JasperManager.runReportToPdf(jasperReport,parameters,conn);

response.setContentType("application/pdf");

response.setContentLength(bytes.length);

ServletOutputStream ouputStream = response.getOutputStream();

ouputStream.write(bytes, 0, bytes.length);

ouputStream.flush();

}

catch(Exception e)

{

System.out.println(e);

}

 

It would be very helpful, if I receive some help or suggestion.

 

with regards,

 

Veera

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...