I have a table in my iReport which naturally has its dataset and I have a variable, that is defined and initialized in the table's dataset return a value (which definitely does within scope of table, not outside it) which I want to use in my main report which holds the table.
How can I do that or any alternatives?
Best Answer
The correct way (jasper report v.5/v.6) to return values from a component using
subDataset
is to use variables, define variables in both main report and insubDataset
.Example (return record count of table to main report)
In main report define a variable
In
subdataset
define a variable (in example a build in variable will be used$V{REPORT_COUNT}
).In
datasetRun
indicate whichsubDataset
variable (fromVariable
) should be return to which main report variable (toVariable
)The
TABLE_COUNT
variable can then be used in the main report, just remember to set correct evaluationTimeDisplay the value (in main report)