Implementing the Grid Viewer

The final viewer to be covered in this chapter is the Grid viewer. The Grid viewer (shown in Figure 32.4) differs more from the other viewers in that it does not render the reports presentation onscreen. Instead it looks at the dataset associated with the report (that is, the query result after the report engine has done its magic) and displays that data in a tabular fashion. This opens up some very interesting scenarios if you use your imagination.

Figure 32.4. The Grid viewer in action.

graphics/32fig04.gif


NOTE

You can override the style of the grid table by defining a stylesheet that maps to the styles used by the grid object. Consult the documentation for more information on this.


Listing 32.9 shows a report being displayed using the Grid viewer.

Listing 32.9. Displaying a Report in the Grid Viewer

//To create a Java grid viewer you need to instantiate a GridViewer object.

//To create a GridViewer object:

GridViewer viewer = new GridViewer();



//Set the viewers report source by calling its setReportSource method

viewer.setReportSource(reportSource);



//After you have created and initialized a Java grid viewer object, you call

//its processHttpRequest method to display the results in the Web page

viewer.processHttpRequest(request, response, getServletContext(), null);


All viewers including the Grid viewer share a number of toolbar elements. These properties can be programmatically toggled and are displayed in Table 32.3. All the viewer properties must be set before calling the ProcessHTTPRequest method that will display the selected report. For example, to ensure the Crystal logo is displayed when the involved report is viewed, the code line






Viewer.HasLogo(true);


Table 32.3. Toolbar Elements (Grid Viewer)

Property

Property Description

HasLogo

Includes or excludes the "Powered by Crystal" logo when rendering the report.

HasExportButton

Includes or excludes the Export button when rendering the report.

HasGotoPageButton

Includes or excludes the Go to Page button when rendering the report.

HasPageNavigationButtons

Includes or excludes the page navigation buttons when rendering the report.

HasPrintButton

Includes or excludes the Print button when rendering the report.

HasRefreshButton

Includes or excludes the Refresh button when rendering the report.

HasSearchButton

Includes or excludes the Search button when rendering the report.

HasToggleGroupTreeButton

Includes or excludes the Group Tree toggle button when rendering the report.

HasViewList

Specifies whether the viewer should display a list of previous views of the report.

SetPrintMode

Set printing to use PDF or Active X printing (0=pdf, 1=actx).

HasZoomFactorList

Specifies zoom factor for the displayed report.

DisplayNavigationBar

Specifies whether the viewer should display the navigation bar at the bottom of the grid.

Unique to Grid viewer.

DisplayRowNumberColumn

Specifies whether to display the row number column.

Unique to Grid viewer.

DisplayToolbarFindRowButton

Includes or excludes the Find Row button when rendering the toolbar.

Unique to Grid viewer.

DisplayToolbarGroupViewList

Specifies whether the viewer should display the view list.

Unique to Grid viewer.

DisplayToolarSwitchViewButton

Includes or excludes the Toggle Grid View button.

Unique to Grid viewer.

EnableGridToGrow

Specifies whether the viewer should enable the Grid to Grow.

Unique to Grid viewer.

GridViewMode

Specifies the viewer View mode.

Unique to Grid viewer.

MatchGridandToolbarWidth

Specifies whether the table should align with the toolbar.

Unique to Grid viewer.

TableStyle

Specifies the style class of the table. You can apply a css style class to the grid table that shows records. You do so by stating: Gridviewer.TableStyle="cssclass";

Unique to Grid viewer.

ToolbarStyle

Specifies the style class of the toolbar. You can apply a css style class to the grid toolbar. You do so by stating:


Gridviewer.ToolbarStyle="cssclass";


Unique to Grid viewer.


needs to be included in the code before the processHTTPRequest method is called.


Part I. Crystal Reports Design

Creating and Designing Basic Reports

Selecting and Grouping Data

Filtering, Sorting, and Summarizing Data

Understanding and Implementing Formulas

Implementing Parameters for Dynamic Reporting

Part II. Formatting Crystal Reports

Fundamentals of Report Formatting

Working with Report Sections

Visualizing Your Data with Charts and Maps

Custom Formatting Techniques

Part III. Advanced Crystal Reports Design

Using Cross-Tabs for Summarized Reporting

Using Record Selections and Alerts for Interactive Reporting

Using Subreports and Multi-Pass Reporting

Using Formulas and Custom Functions

Designing Effective Report Templates

Additional Data Sources for Crystal Reports

Multidimensional Reporting Against OLAP Data with Crystal Reports

Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design

Introduction to Crystal Repository

Crystal Reports Semantic Layer Business Views

Creating Crystal Analysis Reports

Advanced Crystal Analysis Report Design

Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting

Part V. Web Report Distribution Using Crystal Enterprise

Introduction to Crystal Enterprise

Using Crystal Enterprise with Web Desktop

Crystal Enterprise Architecture

Planning Considerations When Deploying Crystal Enterprise

Deploying Crystal Enterprise in a Complex Network Environment

Administering and Configuring Crystal Enterprise

Part VI. Customized Report Distribution Using Crystal Reports Components

Java Reporting Components

Crystal Reports .NET Components

COM Reporting Components

Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition

Introduction to Crystal Enterprise Embedded Edition

Crystal Enterprise Viewing Reports

Crystal Enterprise Embedded Report Modification and Creation

Part VIII. Customized Report Distribution Using Crystal Enterprise Professional

Introduction to the Crystal Enterprise Professional Object Model

Creating Enterprise Reports Applications with Crystal Enterprise Part I

Creating Enterprise Reporting Applications with Crystal Enterprise Part II

Appendix A. Using Sql Queries In Crystal Reports

Creating Enterprise Reporting Applications with Crystal Enterprise Part II



Special Edition Using Crystal Reports 10
Special Edition Using Crystal Reports 10
ISBN: 0789731134
EAN: 2147483647
Year: 2003
Pages: 341

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net