Using SRS 2000.
I have a subreport on my report that is only shown under certain conditions.
I have handled this successfully with the Hidden property.
I read somewhere that the hidden subreport would not execute, but if I
profile SQL server when I run the report the SQL is being executed.
Is there a way to suppress the SQL execution and speed up the report?I was unable to find an answer to this (could not find the original article
that set me down this path either). I devised a workaround that I will
post here in case anyone else is running into this.
For all the queries in my subreports, I add a NoExecute bit parameter. The
first thing I do in the query is then check to see If @.NoExectue = 1 I
SELECT a column list that is the same as my normal output, but all the
values are NULL and then return. This makes the query execute really fast
and minimizes the performance issue.
So for an example... If my query normally returns Name, Address, & Phone the
start of my query now looks like:
If @.NoExectue = 1
Begin
Select
NULL as Name,
NULL as Address,
NULL as Phone
Return
End
--Start the regular query here to return 'real' values.
"Joe L" <jjj@.lll.com> wrote in message
news:OW9f9ugdGHA.3484@.TK2MSFTNGP04.phx.gbl...
> Using SRS 2000.
> I have a subreport on my report that is only shown under certain
> conditions. I have handled this successfully with the Hidden property.
> I read somewhere that the hidden subreport would not execute, but if I
> profile SQL server when I run the report the SQL is being executed.
> Is there a way to suppress the SQL execution and speed up the report?
>
No comments:
Post a Comment