>I have one master jrxml file which contains one query and also Have four sub reports.
>Depending on the result of the master query my sub report will execute suppose master query give me "1" first sub report will execute , if "2" second will execute and so on.
>Each of my sub report contains one one query each.
I don't have access to a machine at the moment but something like the following should satisfy your requirement:
- Assign the value of your main query to a field which should be set to be generated at runtime.
- Apply a printExpression to the band containing each of your subreports, based upon the value of the field created.
E.g. mainQueryResult.equals("1") for subreport 1 and so on.
Did you see my last post? I still think printWhenExpression is what you need. If the condition is met, the subreport is generated; if the condition isn't met, no subreport is generated. Now, instead of simply repeating yourself, you could actually try this out and come back with the outcome.