• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Implementing the Page Viewer

The first viewer component to be covered is the Page viewer, as illustrated in Listing 32.5. To use this viewer, you will create its CrystalReportViewer object. It, along with all the other viewers, exposes a method called setReportSource that accepts a valid report source object as obtained from the description in the previous section. Finally, again like the other viewers, it has a processHttpRequest method that accepts references to the current servlet context. This method does the actual rendering to HTML.

Listing 32.5. Viewing a Report over the Web

//To create a Java report viewer you need to instantiate a CrystalReportViewer
//object. To create a CrystalReportViewer object:
CrystalReportPartsViewer viewer = new CrystalReportViewer();

//Obtain a ReportSource object. Set the viewer's report source by calling its
//setReportSource method.
viewer.setReportSource(reportSource);

//When you have created and initialized a Java report page viewer, you call
//its processHttpRequest method to launch it in a Web //browser.
viewer.processHttpRequest(request, response, getServletContext(), null);


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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