Jump to content
Changes to the Jaspersoft community edition download ×

Passing a generated list as a datasource


Jackeline161

Recommended Posts

Hello everybody 

I have a problem with passing a list as a datasource for my report, the list has a type not primitif (g_listCla = new ArrayList<Cla>() )so I ask if it's possible to do it because it doesn't work for me :s

 

There is the method that i use :

 

public String ToPdfFormat() throws ColumnBuilderException, ClassNotFoundException {
 
try {
 
System.out.println("g_titre :"+titreEtat);
System.out.println("g_listCla:"+g_listCla.size());
FastReportBuilder drb = new FastReportBuilder();
DynamicReport dr = drb
.setTitle(titreEtat)
.setSubtitle("This report was generated at " + new Date())
.setPrintBackgroundOnOddRows(true)
.setUseFullPageWidth(true)
.build();
 
   // build JasperPrint instance, filling the report with data from datasource created above
   JasperPrint jasperPrint = DynamicJasperHelper.generateJasperPrint(
       dr,new ClassicLayoutManager(),g_listCla);
   
   // export to pdf
   JasperExportManager.exportReportToPdfFile(jasperPrint, "C:\MyReport1.pdf");

}

 

 

The list is already filled in the other method when my dynamic query is generated so i wish to pass the list directly to my report , please help me !!!!

 

 

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