Groups | Blog | Home
all groups > sql server reporting services > august 2006 >

sql server reporting services : Changing DatasetName and Datasource programatically


kevin.haynie NO[at]SPAM gmail.com
8/16/2006 2:44:12 PM
Hello,

Does anyone know if it's possible to programatically change the
datasetName and/or dataSource via either the reportViewer.dll or
through report parameters?

My situation is that I need to be able to switch the database and query
statement from an active database to an archive database, based on a
user selection of whether or not they want to report off the
active/archived database. The report itself and the fields used in it
are identically named in both the archive and active database.

Thus, I'm trying to avoid having to create a duplicate report where the
only difference is the datasource/dataset. Is this possible?

Thank you for any help!
Shawn
8/17/2006 5:56:02 AM
You could write a custom data processing extension (DPE). There's probably
an easier way but that would definitely work... althought it isn't
straightfoward or simple.

[quoted text, click to view]
Lance M
8/17/2006 9:40:58 AM
Hi Kevin,

The easiest way is through report parameters, as you said. All you have
to do is build conditional code around the parameters, and make it
select which DB the user wants to see a report of.

Lance M.

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