Sunday, February 19, 2012

Dynamic Subreports

Has anyone been successful in being able to dynamically link subreports in
2005.
Background of what we are doing:
We have a main report that gets passed a set of ID's of a table, then from
there we want it to loop the subreport and based on the type of record, we
want it to bring in a specific subreport.
We have tried toggling the visibility of multiple subreports, except every
time it runs all the subreports for ever record ID even if the record ID
wouldn't return anything. With this approach we would have multiple
subreports over laid and it could be passed an infinite amount of record
ID's and with multiple users it would be an huge amount of hits to the SQL
server. For instance, 2 different users call the same report with 20 record
ID, our trace showed that it hit the SQL server 320 times even though it
only needed to be hit 40 times. We were able to dynamically set subreports
with Data Dynamics ActiveReports and we thought there should be something
comparable with SRS2005.
Has anyone either ran into this same situation or has found a workaround
(besides visibility)?Ok, I have found a way to do what i wanted with out having the all the
subreports run for each record.
First, I created a subreport and created a Parameter that only had one
available value, for instance, the parameter TypeID and the available is set
to one. Then in the main report, I set the subreport to pass the TypeID of
the recordset to the subreport. If it didn't match the TypeID in the
subreport it didn't run the report. Then I set the NoRow equal to a space
and it didn't show anything then. It works perfectly, now if the main
recordsets TypeID matches the available TypeID of the subreport it runs
against the sql server, otherwise it doesn't run the subreport. I then over
laided the 8 subreports and it is working perfectly.
Just thought I would pass this information along on how I was able to work
around the issue.
Thanks, Terry.
"Microsoft" <tnederveld@.ezlistmls.com> wrote in message
news:OmrnGPfHGHA.1180@.TK2MSFTNGP09.phx.gbl...
> Has anyone been successful in being able to dynamically link subreports in
> 2005.
> Background of what we are doing:
> We have a main report that gets passed a set of ID's of a table, then from
> there we want it to loop the subreport and based on the type of record, we
> want it to bring in a specific subreport.
> We have tried toggling the visibility of multiple subreports, except every
> time it runs all the subreports for ever record ID even if the record ID
> wouldn't return anything. With this approach we would have multiple
> subreports over laid and it could be passed an infinite amount of record
> ID's and with multiple users it would be an huge amount of hits to the SQL
> server. For instance, 2 different users call the same report with 20
> record ID, our trace showed that it hit the SQL server 320 times even
> though it only needed to be hit 40 times. We were able to dynamically set
> subreports with Data Dynamics ActiveReports and we thought there should be
> something comparable with SRS2005.
> Has anyone either ran into this same situation or has found a workaround
> (besides visibility)?
>

No comments:

Post a Comment