Jump to content
Changes to the Jaspersoft community edition download ×

Report is not displaying List data


Recommended Posts

By: mpurswani - mpurswani

Report is not displaying List data

2006-04-09 22:47

in Java application i am writing

 

List myList = new ArrayList();

 

myList.add("1");

myList.add("2");

myList.add("3");

 

JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(myList);

 

jasperPrint = JasperFillManager.fillReport(jr, parameters, ds);

 

JasperExportManager.exportReportToPdfFile(jasperPrint,"c:\test.pdf");

 

 

My test.jrxml contains

 

<?xml version="1.0"?>

<!DOCTYPE jasperReport

PUBLIC "-//JasperReports//DTD Report Design//EN"

"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="Simple_Report">

<field name="myList" class="java.lang.Object"/>

</jasperReport>

 

 

When i run my application it gives

 

java.lang.NoSuchMethodException: Unknown property 'myList'

 

Could u pls tell me what is wrong my program or test.jrxml

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: Report is not displaying List data

2006-04-10 07:40

String objects are not beans. JRBeanCollectionDataSource works with bean collections. You could then wrap your strings into beans or write a custom data source.

 

HTH,

Lucian

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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