Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access crystal enterprise 9 report from vs.net

Status
Not open for further replies.

jay313

Programmer
Jan 12, 2004
2
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top