Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change DataSource at run time using .NET 2005

Status
Not open for further replies.

GJParker

Programmer
Jul 4, 2002
1,614
GB
Reports are created using CRXI
connecting to a SQL 2000 database

Can anyone tell me how I change the datasource type for a report at runtime.

If a report is saved using an ODBC datasource how do I change the report to connect to the db using an OLE DB connection at runtime.

TIA

Gary Parker
MIS Data Analyst
Manchester, England
 
Assuming you're programming in Visual Studio, you'll set the various properties of the ReportLogon as you normally do, making sure to set the UseOriginalDataSource property to false.

In addition, you need to set the following:

rpt.ReportLogons.CustomServerType = CeReportServerType.ceServerTypeUserSpecified;
rpt.ReportLogons.CustomDatabaseDLLName = "crdb_ado.dll";

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Is there any way to do this at runtime when NOT using VStudio?

We are web-based and run the .rpt file directly from a URL. We want to use the same rpt file, but point to different database at runtime. There seems to be no way to specify a DSN at run-time to change what's already embedded into the report.

The BI guys just shrug and say "You can always buy Enterprise..." but that's not really what we want.
 
AFAIK, there's no way to do this through the URL. You would have to use one of the SDK's - .NET, Java, COM+.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top