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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Database at Run Time of Sub-Report?

Status
Not open for further replies.

nomi2000

ISP
Feb 15, 2001
676
CA
Dear fellow Programmer
i have done to change the DB of Main Report by
'Database Setting For Main Report
For intTables = 1 To ReportObject.Database.Tables.Count
ReportObject.Database.Tables(intTables).Location = ReportDatabaseName & ".dbo.Proc(stp_ORD_GetOrderItemsByOrderID;1)"
ReportObject.Database.Tables(intTables).SetLogOnInfo ReportServerName, ReportDatabaseName, UserName, Password
Next intTables

But not being able to change the DB of sub-reports how it will be done please help
Regards
Nouman
 
Do it the same way you did with the main report except put .OpenSubreport("SubRptName") between the ReportObject.Database

For example

ReportObject.OpenSubreport ("SubRptName").Database


Hope this helps
Lori

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top