
Main Report and Subreport from different datasources in ASP
Is it possible to call through an ASP a report where main report uses
SQL server and subreport uses Oracle view.
I use the SetLogonInfo .
Below is a code that I use
Set CrystalApp=Server.CreateObject("CrystalRuntime.Application")
Set Report = CrystalApp.OpenReport(sFullPath, 1)
Report.DiscardSavedData
Report.MorePrintEngineErrorMessages = False
Report.EnableParameterPrompting = False
Set RptDatabase = Report.Database
SQLPasswordName="pwd"
For Each Table in RptDatabase.Tables
Table.SetLogonInfo Table.LogOnServerName, Table.LogOnDatabaseName,
Table.LogOnUserID,cstr(SQLPasswordName)
Next
For Each Section in Report.Sections
For Each Obj in Section.ReportObjects
IF Obj.Kind = 5 Then 'SubReport
set SubObj=Report.OpenSubReport(obj.SubreportName)
For Each Table in SubObj.Database.Tables
Table.SetLogonInfo Table.LogOnServerName, Table.LogOnDatabaseName,
Table.LogOnUserID, CStr(SQLPasswordName)
Next
End if
Next
Next
And I have an error msg:
Error Occurred Exporting Report: Server has not yet been opened.
Please help.
LM