Hi there
i have a report wich has a subreport on it. The Main Report has one SQL-Datasource.
The Subreport has the same SQL-Datsource and a Domino-Datasource.
Now i need to set the Logon-Information (User/Password) through the RAS-SDK in an ASP-Script.
Crystal has a set of Sample-Reports with ASP's. In this samples are both cases: logon on mainreport and logon on subreport.
I made the logon to the Mainreport like the following:
indexTable = Session("oClientDoc"
.Database.Tables.FindByAlias("MR_SQLSource"
Set oConnInfo = Session("oClientDoc"
.Database.Tables.Item(indexTable).ConnectionInfo.Clone
oConnInfo.UserName = CStr(QS_User)
oConnInfo.Password = CStr(QS_Password)
Session("oClientDoc"
.DatabaseController.ModifyTableConnectionInfo "MR_SQLSource", oConnInfo
The Logon to the Subreport-Datasources i made like this:
set SubTables = Session("oClientDoc"
.SubreportController.getSubreportDatabase("Matter_Situation"
.Tables
for each SubTable in SubTables
if SubTable.alias = "SR_SQLSource" then
set newSubTable = SubTable.Clone
newSubTable.ConnectionInfo.UserName = CStr(QS_User)
newSubTable.ConnectionInfo.Password = CStr(QS_Password)
Session("oClientDoc"
.SubreportController.setTableLocation "Matter_Situation", SubTable, newSubTable
elseif SubTable.alias = "SR_DomSource" then
set newSubTable = SubTable.Clone
newSubTable.ConnectionInfo.UserName = CStr(QS_SEOUser)
newSubTable.ConnectionInfo.Password = CStr(QS_SEOPassword)
Session("oClientDoc"
.SubreportController.setTableLocation "Matter_Situation", SubTable, newSubTable
end if
next
But unfortunately the report is not being displayed. But when i delete the one different Domino-Datasource from the subreport, the report works without any problem.
When i try the report in the Crystal Designer the Report works properly with all Datasources on it.
Has someone a sample code how the logon to a report with a subreport with different datasources on it?
i have a report wich has a subreport on it. The Main Report has one SQL-Datasource.
The Subreport has the same SQL-Datsource and a Domino-Datasource.
Now i need to set the Logon-Information (User/Password) through the RAS-SDK in an ASP-Script.
Crystal has a set of Sample-Reports with ASP's. In this samples are both cases: logon on mainreport and logon on subreport.
I made the logon to the Mainreport like the following:
indexTable = Session("oClientDoc"
Set oConnInfo = Session("oClientDoc"
oConnInfo.UserName = CStr(QS_User)
oConnInfo.Password = CStr(QS_Password)
Session("oClientDoc"
The Logon to the Subreport-Datasources i made like this:
set SubTables = Session("oClientDoc"
for each SubTable in SubTables
if SubTable.alias = "SR_SQLSource" then
set newSubTable = SubTable.Clone
newSubTable.ConnectionInfo.UserName = CStr(QS_User)
newSubTable.ConnectionInfo.Password = CStr(QS_Password)
Session("oClientDoc"
elseif SubTable.alias = "SR_DomSource" then
set newSubTable = SubTable.Clone
newSubTable.ConnectionInfo.UserName = CStr(QS_SEOUser)
newSubTable.ConnectionInfo.Password = CStr(QS_SEOPassword)
Session("oClientDoc"
end if
next
But unfortunately the report is not being displayed. But when i delete the one different Domino-Datasource from the subreport, the report works without any problem.
When i try the report in the Crystal Designer the Report works properly with all Datasources on it.
Has someone a sample code how the logon to a report with a subreport with different datasources on it?