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

Subdataset and Main Report Parameter


urwithsibs

Recommended Posts

1) I am using a parameter called $P{Term} for the main report query.

My sql expression is:

SELECT

term,

gender_name

 

FROM

table

WHERE

term = $P{Term}

GROUP BY

term,

gender_name

2) I am using multiple cross tabs and would like to use subdatasets. I need to pass the same parameter($P{Term}) to the subdataset. I am not sure how do I do that ?.

My sql expression for the subdataset is:

SELECT

term,

class_level

FROM

table

WHERE

term = $P{Term} AND

class_level ='X'

GROUP BY

term,

class_level

 

Note: I tried to add the parameter)$P{Term}) to the cross tab by..a) right clicking on the crosstab

b) cross tab properties

c) under sub dataset properties > parameters tab

d) clicked on add

e) selected $P{Term} as default expression and name 'term'

 

But it does not recognize the parameter....says unknown parameter 'term'

Please help me on this. Thanks in advance

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

In the subdataset that you created, make sure that you have created a parameter with the same name as the one you intend to use in the main report. in your case it will be term. and then, with the procedures that u have already described, you should be able to do it.
Link to comment
Share on other sites

  • 7 months later...

Hi,

 

Here i am also facng the same problem.

 

I have created a report using subdatasets.

 

I am not able to display the subdataset fields in the main report.

 

If you have done,please give me the solution,or send me one simple and sample example which you have done.

 

 

I am attaching my JRXML file.

 

Please find the attachment.

 

 

 

Thanks in Advance,

Surendra. [file name=SubdatasetsExample.jrxml size=3044]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/SubdatasetsExample.jrxml[/file]

Link to comment
Share on other sites

  • 3 weeks later...

I have a question regarding sub-datasets. I am new to the Jasper reports and working on the integration with myu application. The Fill manager requires either a JRResultSetDataSource or a connection datasource to be passed to it. However this is only for the main report.

 

My question is how do I pass a JRResultSetDataSource to the subdataset for the chart. The chart that I want to display comes from a different query? Is it possible?

 

I do not want to put in the query in the jrxml file for it to get the data.

 

Please help.

 

Thanks,

Sumeet

Link to comment
Share on other sites

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