Jump to content
JasperReports Library 7.0 is now available ×

Q: Specifying sub report datasources?


Recommended Posts

By: Tom Tamulewicz - tomjt

Q: Specifying sub report datasources?

2002-10-14 05:58

Is there a way to specify the datasource that a sub report will use? I'm looking at building sub reports off of a custom data source that I write. Each sub report will have it's own datasource.

 

Somewhat of a followup/alternative question. Is there any iteration control exposed to the XML definition layer? Functionality similar to JSPs JSTL "forEach" tag is kind of what I'm looking for. A custom tag approach would be very powerful.

 

 

 

By: JC Tchitchiama - jeanch

RE: Q: Specifying sub report datasources?

2002-10-14 09:09

hi,

 

Q1: The answer is yes you can specify the data source for a subreport

try this

<subreport>

...

<dataSourceExpression>

new SubReportClass1()

</dataSourceExpression>

...

</subreport>

<subreport>

...

<dataSourceExpression>

new SubReportClass2()

</dataSourceExpression>

...

</subreport>

 

Q2: there is iteration for Jasper know parameters ie PAGE_NUMBER I dunno if one can define it's own one

 

Good luck

JC

 

 

By: Teodor Danciu - teodord

RE: Q: Specifying sub report datasources?

2002-10-14 12:26

 

Hi,

 

Q2: Have you checked the scriptlets functionality?

 

I hope this helps.

Teodor

 

 

 

By: JC Tchitchiama - jeanch

RE: Q: Specifying sub report datasources?

2002-10-15 03:58

Tom,

Unless I misunderstood you question my example show two subreports each of them use a different data source (DS). That's how you specify which DS one subreport ought to use.

Maybe what you mean is dynamically created DS for instance in a for loop you do

 

 

for each elem do

<subreport>

<dataSourceExpression>

$P{DynamicDataSource}

</dataSourceExpression>

</subreport>

end of for

Is that what you're trying to do ? If so I don't

think JR can do it just not. However take a look at Scriptlet just in case it gives you what you want

 

Pls let us know exactly what you're trying to do.

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