• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sub report not displayed.

 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im trying to generate the report in pdf format. The report consist of 2 sub report ( 1 sub report required values to be passed in, the other one does not required any values to be passed in)

When i generate the file, the subreport is not included. Below is my code and jrxml

Servlet codes:



Jrxml:



Where have i gone wrong?
 
Martin Ronckevic
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

add datasource parameter like this:



I know I am replying more than a year later, but somebody may find it helpful, as I would couple of minutes ago. Worked on jasperreports 3.7.0.

Martin
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martin, welcome to Javaranch and thanks for your answer!
 
Alain Ramos
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , another solution would be passing the subreport datasource as java.util.List and then create de JRBeanCollectionDatasource like the example below

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{dsSub})]]></dataSourceExpression>


it works for me
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic