Subdataset and Main Report Parameter

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
urwithsibs's picture
Joined: Jul 30 2007 - 12:07am
Last seen: 16 years 1 month ago

8 Answers:

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.
nittu02's picture
862
Joined: Feb 25 2007 - 5:45pm
Last seen: 16 years 7 months ago
Thanks so much. It worked. :laugh:
urwithsibs's picture
Joined: Jul 30 2007 - 12:07am
Last seen: 16 years 1 month ago
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/Sub...
kunkasurendra's picture
Joined: Jun 12 2007 - 3:43pm
Last seen: 5 years 3 weeks ago
kunkasurendra you can only use subdatasets in charts and crosstab elements. If you need to execute mutiple queries to populate your bands then you will have to use subreports.
svenn's picture
15112
Joined: Mar 19 2007 - 5:57am
Last seen: 16 years 6 months ago
don't forget to place those parameters in Parameters List in subdataset and in chart also.;)
Post edited by: matei, at: 2008/03/18 17:22
matei's picture
32
Joined: Mar 17 2008 - 1:14am
Last seen: 15 years 6 months ago
i'm not sure is working because i also tried but when is runging those parametres are nulls and is runing but not corect. :(
matei's picture
32
Joined: Mar 17 2008 - 1:14am
Last seen: 15 years 6 months ago
Thnaks for the help.

I had some doubt on that.now it's clarified.

Means : subdata sets is used for charts and crosstabs.

Is it right?
kunkasurendra's picture
Joined: Jun 12 2007 - 3:43pm
Last seen: 5 years 3 weeks ago
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
sumeet_singh's picture
Joined: Jul 25 2007 - 8:39pm
Last seen: 16 years 2 months ago
Feedback
randomness