Wednesday, March 21, 2012

Run Subreport according to condition.

Hi all,

in my report, I am using a subreport which takes two parameters and in my main report there is a filed named "ProcessCode".

My problem is that, this subreport should be only run if ProcessCode is 11 oder 29. Otherweise there is no need to run subreport. the column of subreport will be shown as emtpy.

I know, I can return empty string from my stored procedure if the processcode is not 11 or 29, but I would like to learm, is it possible to not render subreport according to condition?

Thanks in advance.

Try to use iif() function for your subreport.

Also, you can setup the condition in the 'visibility' property of the subreport.

Hope it helps,

Shin

|||I'd say that's the answer. Make subreport visible iff processcode = 11 or 29|||

that means the query or stored procedure in the subreport will be run in any condition but if processcode is 11 or 29, subreport will be visible, otherwise invisible. its clear...

But I would like to learn, if processcode is not 11, then the subreport should never be render. the stored proc in subreport should not be executed.

otherwise I have same performance problem. the subreport and its query will be run but not will be not visible.

I hope I can explain my point..

Thanks again...

No comments:

Post a Comment