Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 change datasource from asp.net

Author  Topic 

roy mm
Yak Posting Veteran

62 Posts

Posted - 2009-11-30 : 08:20:58
change datasource from asp.net -

I have a report on my server whice i load into a reportViewer control in asp.net.
I'm also sending him parameters with "setParameters" function.

Is there a way to change the datasource of the report with parameter or other way?

The reason is that we want to move part of the data to history so I want one system that run the regualr reports and another system that run the some reports buy with datasiurce to another table.

Thanks.

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-11-30 : 14:31:35
A data source specifies the location of the tables. Are you really referring to a Data Set?

John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page

roy mm
Yak Posting Veteran

62 Posts

Posted - 2009-12-02 : 02:34:45
Hi John,
I do speak about DataSource.

Since we will have two diffrent databases (one for production and one for history) I want to have a parameter that will control to which DB the report will connect.

Thanks.
Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-12-02 : 08:19:30
What I should have asked was if the history was just in another table in the same database. Sorry.

John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-12-03 : 16:41:10
Just thought of something. Are the column names the same on both tables? There is a way to access a "remote" table, ie a table from a different database. I have seen reference on the T-SQL forumn. Anyway, do that with a UNION in your base SQL? Possibly???

John
It's a small world (but I wouldn't want to paint it)
Go to Top of Page

cvraghu
Posting Yak Master

187 Posts

Posted - 2009-12-04 : 00:29:43
Try something like below. Since i don't have SSRS installed on my box, i'm not sure of exact instructions on how to connect the parameters. But i'm sure you can fin them online.

SELECT * FROM
CurrentDB.dbo.CurrentTable
WHERE @ReportOrQueryParameter = 'Current'
Union
SELECT * FROM
HistoryDB.dbo.historyTable
WHERE @ReportOrQueryParameter = 'History'

Edit: Forgot to mention that its a single datasource. But we are connecting to the 2 dbs in query.
Go to Top of Page

behrman
Yak Posting Veteran

76 Posts

Posted - 2009-12-07 : 00:05:35
Hi.
Could you try to create dynamic datasouce? You can refer to the below link:
http://social.technet.microsoft.com/Forums/en-US/sqlreportingservices/thread/64e911f9-3ca0-47c3-8423-6c6c2cb8cef9
Hope this helps.

RAQ Report: Web-based Excel-like Java reporting tool
Go to Top of Page
   

- Advertisement -