I'm trying to import several subreports into a main report. I woule like each subreport connects to a different database. Even though I set the logon info correctly the subreports all show data from the first subreport imported. For example:
session("oRpt"
.Sections.Item("RH"
.ImportSubreport "C:\Inetpub\ 0, 0
'Now open the subreport. "client" is the name of the subreport.
Set CRSubreport = session("oRpt"
.OpenSubreport("client1.rpt"
' Each table must use SetLogonInfo to logon.
' And logon to the datasource
set crtablesub = CRSubreport.Database.Tables.Item(1)
crtablesub.SetLogonInfo <servername1>, <databaseName1>, <username>, <password>
Session("oRpt"
.Sections.Item("PH"
.ImportSubreport "C:\Inetpub\ 0, 0
'Now open the subreport. "client" is the name of the subreport.
Set CRSubreport2 = session("oRpt"
.OpenSubreport("client2.rpt"
' Each table must use SetLogonInfo to logon.
' And logon to the datasource
set crtablesub2 = CRSubreport2.Database.Tables.Item(1)
crtablesub2.SetLogonInfo <serverName1>, <databaseName2>, <username>, <password>
When I view the report the second subreport has info from databaseName1 instead of databaseName2? How do I get it to display data from a different database?
NOTE: When I change the second subreport ServerName to a different Server the report works. Each subreport pulls data from the correct db. This only fails when trying to access several databases on the same server.
Any ideas?
session("oRpt"
'Now open the subreport. "client" is the name of the subreport.
Set CRSubreport = session("oRpt"
' Each table must use SetLogonInfo to logon.
' And logon to the datasource
set crtablesub = CRSubreport.Database.Tables.Item(1)
crtablesub.SetLogonInfo <servername1>, <databaseName1>, <username>, <password>
Session("oRpt"
'Now open the subreport. "client" is the name of the subreport.
Set CRSubreport2 = session("oRpt"
' Each table must use SetLogonInfo to logon.
' And logon to the datasource
set crtablesub2 = CRSubreport2.Database.Tables.Item(1)
crtablesub2.SetLogonInfo <serverName1>, <databaseName2>, <username>, <password>
When I view the report the second subreport has info from databaseName1 instead of databaseName2? How do I get it to display data from a different database?
NOTE: When I change the second subreport ServerName to a different Server the report works. Each subreport pulls data from the correct db. This only fails when trying to access several databases on the same server.
Any ideas?