I am trying to access a report from a crystal enterprise 9 page server using vs.net. I had no problem doing this with vs 6 with the following code:
Set viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer"
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory"
Set rptSource = rptFactory.OpenReportSource(CInt(id))
With viewer1
.ReportSource = rptSource
.EnterpriseLogon = iStore.EnterpriseSession
.URI = CStr( Request.ServerVariables.Item("PATH_INFO" & "?" & Request.ServerVariables.Item("QUERY_STRING")
End With
viewer1.ProcessHttpRequest Request, Response, Session
With vs.net, I modified the code to use the .net framework objects as follows:
myEnterpriseSession = CType(Session("EnterpriseSession", EnterpriseSession)
myInfoStore = CType(Session("InfoStore", InfoStore)
reportID = "1310"
rptSrcFactory = myInfoStore.EnterpriseSession.GetService("", "PSReportFactory"
myCrystalReportViewer1.EnterpriseLogon = myEnterpriseSession
myCrystalReportViewer1.ReportSource = rptSrcFactory.openreportsource(reportID)
I can't figue out which type of object rptSrcFactory needs to be for this to work. The only report factory I can find is the RAS one, and I have been asked to use the page server. Any help will be greatly appreciated. Thanks.
Jason
Set viewer1 = Server.CreateObject( "CrystalReports.CrystalReportViewer"
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory"
Set rptSource = rptFactory.OpenReportSource(CInt(id))
With viewer1
.ReportSource = rptSource
.EnterpriseLogon = iStore.EnterpriseSession
.URI = CStr( Request.ServerVariables.Item("PATH_INFO" & "?" & Request.ServerVariables.Item("QUERY_STRING")
End With
viewer1.ProcessHttpRequest Request, Response, Session
With vs.net, I modified the code to use the .net framework objects as follows:
myEnterpriseSession = CType(Session("EnterpriseSession", EnterpriseSession)
myInfoStore = CType(Session("InfoStore", InfoStore)
reportID = "1310"
rptSrcFactory = myInfoStore.EnterpriseSession.GetService("", "PSReportFactory"
myCrystalReportViewer1.EnterpriseLogon = myEnterpriseSession
myCrystalReportViewer1.ReportSource = rptSrcFactory.openreportsource(reportID)
I can't figue out which type of object rptSrcFactory needs to be for this to work. The only report factory I can find is the RAS one, and I have been asked to use the page server. Any help will be greatly appreciated. Thanks.
Jason