all groups > sql server reporting services > november 2004 >
You're in the

sql server reporting services

group:

conditionally execute a subreport


conditionally execute a subreport beth
11/25/2004 7:43:03 AM
sql server reporting services:
I have a report that contains several subreports, one of which is meant to be
displayed only when the subject of the report has a particular job title. The
data source for this subreport is a stored procedure, and in that procedure I
examine the job title and execute the code only for the specified job title,
but SQL Server goes ahead and opens all of the tables anyway, increasing
overhead on a report that already takes several hours to run.

A better solution would be to conditionally execute the subreport. Is there
a way to do that?

RE: conditionally execute a subreport Charles Kangai
11/25/2004 9:19:03 AM
My understanding of Reporting Services is that it is not meant to work that
way. This is not a client program; it is a server platform. There is
therefore no event-driven programming paradigm like you get in Access. It is
by design.

If you want to do the kind of thing you are talking about, you will need to
change your design. You can design two separate reports, or you can write
your own client program to conditionally load reports.

There is a sample demo of how to integrate reports in your application on
http://www.microsoft.com/sql/reporting. It shows how to use a browser control
in a Windows application.

sorry if this is not the answer you wanted.

Charles Kangai, MCT, MCDBA

[quoted text, click to view]
RE: conditionally execute a subreport beth
11/25/2004 10:45:05 AM
Charles,

I will persue the alternatives you suggested - thank you.

I don't understand your point about client versus server platforms.
If I can conditionally toggle visibility of an object, why could I not toggle
say, an enable/disable property, of a subreport? If this is by design though,
I guess that's that.

I could try placing another stored procedure up front that examines the job
title, that will then conditionally execute the stored procedure that opens
all the
tables and collects the data; using this method, I could at least stop SQL
Server from opening tables it is not going to use. Not sure that will work
though.

thank you for your reply Charles...beth

[quoted text, click to view]
AddThis Social Bookmark Button