Groups | Blog | Home
all groups > sql server reporting services > november 2007 >

sql server reporting services : how to create dynamic data sources in one report


darwin
11/2/2007 11:57:02 AM
Hi all
I would like to make one report that could connect to all servers on my
network (not all on the same domain, Mixed mode authintacation).

An example of use would be to click a link for each server to view the
result set for sp_who, sp_databases, version information or anything similar.

Does anyone know a source/article that would get me going in the right
direction? What I have found so far.... well I am still looking.

Bruce L-C [MVP]
11/2/2007 3:19:01 PM
From Books Online (RS 2005). This does not work in RS 2000

[quoted text, click to view]

Data source expressions are processed at run time or when a report is
previewed. The expression must be written in Visual Basic. Use the following
guidelines when defining a data source expression:

a.. Design the report using a static connection string. A static
connection string refers to a connection string that is not set through an
expression (for example, when you follow the steps for creating a
report-specific or shared data source, you are defining a static connection
string). Using a static connection string allows you to connect to the data
source in Report Designer so that you can get the query results you need to
create the report.


b.. When defining the data source connection, do not use a shared data
source. You cannot use a data source expression in a shared data source. You
must define a report-specific data source for the report.


c.. Specify credentials separately from the connection string. You can use
stored credentials, prompted credentials, or integrated security.


d.. Add a report parameter to specify a data source. For parameter values,
you can either provide a static list of available values (in this case, the
available values should be data sources you can use with the report) or
define a query that retrieves a list of data sources at run time.


e.. Be sure that the list of data sources shares the same database schema.
All report design begins with schema information. If there is a mismatch
between the schema used to define the report and the actual schema used by
the report at run time, the report might not run.


f.. Before publishing the report, replace the static connection string
with an expression. Wait until you are finished designing the report before
you replace the static connection string with an expression. Once you use an
expression, you cannot execute the query in Report Designer. Furthermore,
the field list in the Datasets window and the Parameters list will not
update automatically.
[quoted text, click to view]


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services


[quoted text, click to view]

AddThis Social Bookmark Button