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

How Fill a SubDataset with JRDataSource


NeO_GeO

Recommended Posts

Hi all,

Everyone knows the way to populate a report in java enviroment by implementing the class JRDataSource:
 
JasperFillManager.fillReport(JasperReport jReport,JRDataSource dataSource,HashMap lParameters)
 
but how to populate a SubDataset with a name inside the report  with an implementation of JRDataSource ?
 
I have not found a documention or an example about this.
 
Hoping for an example of java code 
in the meantime I thank you.
 

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

You can create a JRDataSource parameter in the master and use its value as subdataset data source:

<parameter name="SubDataSource" class="net.sf.jasperreports.engine.JRDataSource"/>...<datasetRun subDataset="..">  <dataSourceExpression>$P{SubDataSource}</dataSourceExpression></datasetRun>

//in your Java codelParameters.put("SubDataSource", mySubDataSource);

HTH,

Lucian

Link to comment
Share on other sites

  • 5 years later...
  • 1 year later...

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