Can anyone tell me, ho开发者_运维知识库w to pass parameters to crosstab?
I use Jaspersoft Studio (5.6.2) for designing the reports.
select the crosstab, in the report it is placed. Then goto properties. Then select the tab Advanced. Here you can find the property -Parameters Map Expression-, as value you put what Stoian writes above: $P{REPORT_PARAMETERS_MAP}
Make sure you have a parameter created with the same name you want to use in the crosstab, in the report the crosstab is placed. Put nothing in the -Default Value Expression- if the value is comming from a parent subreport.
in the crosstab (by double clicking on it) goto the Outline. Here you find Parameters, I also created a parameter here with the same name, setting the -Default Value Expression- to the $P{ here you put the name of the parameter you used in point 2 }
seems to work
If you are using iReport or any other report designer, just embed the crosstab into the main report. If you click on the crosstab element and expand it, you will get to see the 'parameters' section. Right-click on the 'parameters' section to add a new parameter and name it accordingly. In the 'Value Expression' for that crosstab parameter, select the parameter from the main report (The report holding the crosstab). Voila!
Do just like bchetty says, just do not forget to add the parameterMapExpression in the crosstab properties of the crosstab. For Report parameters it should be $P{REPORT_PARAMETERS_MAP}
First Make the cross tab in an another report && import it into your main report. Now right click on the subreport you will get an option of change subreport links Where you can put your parameter field to pass in cross tab report.
精彩评论