• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Viewing Reports

Naturally, simply printing out a list of reports isn't all that useful if they can't be viewed. This section focuses on viewing reports. Report viewing is also done via the Crystal Enterprise SDK, specifically, through an object called the CrystalReportViewer. This viewer object, like the other SDK objects, resides on the server. Its job is to render reports to a paginated HTML output. Generally, an ASP page is created and this page is passed in some kind of identifier to determine which report to display (see Listing 34.14).

Listing 34.14. Viewing a Report in HTML

<%
' Logon
Set sessMgr = Server.CreateObject("CrystalEnterprise.SessionMgr")
Set sess = sessMgr.Logon("Ryan", "123", "CMS1", "secEnterprise")

' Get the name of the report from the query string
reportID = Request.QueryString("reportID")

' Retrieve the report source object given the ID
Set reportSource = sess.Service("", "PSReportFactory").OpenReportSource(reportID)

' Create and set up the viewer object
Set viewer = CreateObject("CrystalReports.CrystalReportViewer")
viewer.EnterpriseLogon = sess
viewer.ReportSource = reportSource

' Instruct the viewer to render the HTML output into the response stream
viewer.ProcessHttpRequest Request, Response

%>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint