Crystal/ASP/XML Table Location change
Trying to change the location of the xml file used by a report at runtime. Does change the location successfully. Tested this by writing out the name of the .Location. However, no data is printed in the report except text fields that were hard coded. The data from the XML file is blank. Can open it in report designer and set to the same file name and it shows the data just fine. Any clues?
CODE:
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.9" )
End If
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Dim Report
Report = "C:\VCG\StaffSuite31_Server\Reports\Reports\Templa tes\SysAdmin\XMLReport.rpt"
On error resume next
Set session("oRpt") = session("oApp").OpenReport(Report, 1)
session("oRpt").DiscardSavedData
session("oRpt").Database.Tables.Item(1).SetLogOnIn fo "XML Data", "", "", ""
session("oRpt").Database.Tables.Item(1).Location = "93cc5"
On Error Resume Next
session("oRpt").ReadRecords
If Err.Number <> 0 Then
Response.Write "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
|