com.crystaldecisions.report.web.viewer
Class GridViewer

java.lang.Object
  |
  +--com.crystaldecisions.report.web.ServerControl
        |
        +--com.crystaldecisions.report.web.viewer.ReportServerControl
              |
              +--com.crystaldecisions.report.web.viewer.GridViewer

public class GridViewer
extends ReportServerControl

This class enables you to create a grid viewer and manipulate how the viewer is displayed. The GridViewer class provides the functionality to view report data in a grid format that is independent of the original format of the source report. This class implements the Java grid viewer.

See the Getting Started > Tutorials section of the Viewer Java SDK Guide for an example of how to use the GridViewer class.


Constructor Summary
GridViewer()
           
 
Method Summary
 boolean displayGroupTree()
          Returns whether the group tree is visible.
 boolean displayNavigationBar()
          Returns whether the Navigation bar is visible.
 CrDisplayRowNumberColumnEnum displayRowNumberColumn()
          Returns the style class of the row number column.
 boolean displayToolbar()
          Returns whether the Toolbar is visible.
 boolean displayToolbarCrystalLogo()
          Returns whether the Business Objects Logo is displayed on the Toolbar.
 boolean displayToolbarExportList()
          Returns whether the export list is displayed on the Toolbar.
 boolean displayToolbarFindRowButton()
          Returns whether the find row button will be displayed on the Toolbar.
 boolean displayToolbarGroupViewList()
          Returns whether the view list will be displayed on the Toolbar.
 boolean displayToolbarNavigationButtons()
          Returns whether or not the navigation buttons will be displayed on the Toolbar.
 boolean displayToolbarSwitchViewButton()
          Returns whether the Switch View button is displayed on the Toolbar.
 boolean displayToolbarToggleTreeButton()
          Returns whether the toggle tree button is displayed on the Toolbar.
 boolean enableGridToGrow()
          Returns whether the grid is allowed to grow.
 java.lang.String getCellStyle()
          Returns the style class of the cells in the grid.
 GridColumnCollection getGridColumnCollection()
          Returns the GridColumnCollection associated with the GridViewer.
 CrGridViewModeEnum getGridViewMode()
          Returns the viewing mode of the Java grid viewer.
 int getGroupTreeWidth()
          Returns the width of the group tree.
 CrHtmlUnitEnum getGroupTreeWidthUnit()
          Returns the value of the GroupTreeWidthUnit property.
 java.lang.String getHeadingStyle()
          Gets the style class of the heading.
 java.lang.String getNavigationBarStyle()
          Returns the Navigation bar style class.
 int getPageSize()
          Returns the number of records displayed per page.
 java.lang.String getRowNumberColumnStyle()
          Returns the style class of the row number column.
 java.lang.String getTableStyle()
          Returns the style class of the table.
 java.lang.String getToolbarStyle()
          Returns the Toolbar style class.
 boolean matchGridAndToolbarWidths()
          Returns whether the grid and Toolbar widths will be matched.
 void setCellStyle(java.lang.String newCellStyle)
          Sets the style class to an existing class in a cascading style sheet (.css).
 void setDisplayGroupTree(boolean newDisplayGroupTree)
          Sets whether or not to display the Group Tree.
 void setDisplayNavigationBar(boolean displayNavigationBar)
          Sets whether or not to display the Navigation Bar.
 void setDisplayRowNumberColumn(CrDisplayRowNumberColumnEnum newEnumValue)
          Sets whether to display an initial column in the grid that displays the number assigned to each row.
 void setDisplayToolbar(boolean displayToolbar)
          Sets whether to display the Toolbar.
 void setDisplayToolbarCrystalLogo(boolean displayToolbarCrystalLogo)
          Sets whether to display the Business Objects Logo on the Toolbar.
 void setDisplayToolbarExportList(boolean displayToolbarExportList)
          Sets whether to display the export button when rendering the Toolbar.
 void setDisplayToolbarFindRowButton(boolean displayToolbarFindRowButton)
          Sets whether to include the find row text box when rendering the Toolbar.
 void setDisplayToolbarGroupViewList(boolean displayToolbarGroupViewList)
          Sets whether the viewer should display the current mode and group information.
 void setDisplayToolbarNavigationButtons(boolean displayToolbarNavigationButtons)
          Sets whether to display the navigation buttons on the Toolbar.
 void setDisplayToolbarSwitchViewButton(boolean displayToolbarSwitchButton)
          Sets whether to include or exclude the button to switch between flat and group view modes.
 void setDisplayToolbarToggleTreeButton(boolean newDisplayToolbarToggleTreeButton)
          Sets whether to display the toggle tree button on the Toolbar.
 void setEnableGridToGrow(boolean enableGridToGrow)
          Sets whether or not to enable the grid to grow.
 void setGridColumnCollection(GridColumnCollection newColumnCollection)
          Sets the GridColumnCollection associated with the Java grid viewer.
 void setGridViewMode(CrGridViewModeEnum newViewMode)
          Sets the viewing mode of the Java grid viewer.
 void setGroupTreeWidth(int newGroupTreeWidth)
          Sets the width of the Group Tree.
 void setGroupTreeWidthUnit(CrHtmlUnitEnum newGroupTreeWidthUnit)
          Sets the unit of measurement for the GroupTreeWidth.
 void setHeadingStyle(java.lang.String newHeadingStyle)
          Sets the style class of the heading row to an existing class in a cascading style sheet (.css).
 void setMatchGridAndToolbarWidths(boolean matchGridAndToolbarWidths)
          Sets whether or not the grid and Toolbar widths will be matched.
 void setNavigationBarStyle(java.lang.String newNavigationBarStyle)
          Set the style class of the bottom toolbar to an existing class in a cascading style sheet (.css).
 void setPageSize(int newPageSize)
          Sets the number of records to display per page.
 void setRowNumberColumnStyle(java.lang.String newRowNumberColumnStyle)
          Sets the style class of the row number column to an existing class in a cascading style sheet (.css).
 void setTableStyle(java.lang.String s)
          Sets the style class of the table.
 void setToolbarStyle(java.lang.String newToolbarStyle)
          Sets the style class of the Toolbar to an existing class in a cascading style sheet (.css).
 
Methods inherited from class com.crystaldecisions.report.web.viewer.ReportServerControl
addReportPartBookmarkNavigationEventListener, addReportSourceChangeEventListener, dispose, getDatabaseLogonInfos, getEnterpriseLogon, getParameterFields, getRenderingDPI, getReportSource, getReportSourceClassFactoryName, getSelectionFormula, getStyleSheetFileName, getViewTimeSelectionFormula, isEnableLogonPrompt, isEnableParameterPrompt, isReuseParameterValuesOnRefresh, navigateTo, refresh, removeReportPartBookmarkNavigationEventListener, removeReportPartBookmarkNavigationEventListenerr, removeReportSourceChangeEventListener, setDatabaseLogonInfos, setEnableLogonPrompt, setEnableParameterPrompt, setEnterpriseLogon, setParameterFields, setRenderingDPI, setReportSource, setReportSourceClassFactoryName, setReuseParameterValuesOnRefresh, setSelectionFormula, setStyleSheetFileName, setViewTimeSelectionFormula
 
Methods inherited from class com.crystaldecisions.report.web.ServerControl
getHeight, getHtmlContent, getLeft, getName, getProductLocale, getTop, getURI, getViewState, getWidth, isIgnoreViewStateOnLoad, isOwnForm, isOwnPage, processHttpRequest, setHeight, setIgnoreViewStateOnLoad, setLeft, setName, setOwnForm, setOwnPage, setProductLocale, setTop, setURI, setViewState, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridViewer

public GridViewer()
Method Detail

getGroupTreeWidth

public int getGroupTreeWidth()

Returns the width of the group tree.

Returns:
the width of the group tree as an integer

getGroupTreeWidthUnit

public CrHtmlUnitEnum getGroupTreeWidthUnit()

Returns the value of the GroupTreeWidthUnit property. The GroupTreeWidthUnit property specifies the unit used to specify the width of the group tree.

Returns:
the GroupTreeWidthUnit as a CrHtmlUnitEnum

getPageSize

public int getPageSize()

Returns the number of records displayed per page.

Returns:
the number of records displayed per page as an integer.

displayToolbarFindRowButton

public boolean displayToolbarFindRowButton()

Returns whether the find row button will be displayed on the Toolbar.

Returns:
true if the find row button is displayed; false if the find row button is hidden.

displayToolbarCrystalLogo

public boolean displayToolbarCrystalLogo()

Returns whether the Business Objects Logo is displayed on the Toolbar.

Returns:
true if the Business Objects Logo is displayed; false if the Business Objects Logo is hidden.

displayToolbarSwitchViewButton

public boolean displayToolbarSwitchViewButton()

Returns whether the Switch View button is displayed on the Toolbar.

Returns:
true if the Switch View button is displayed; false if the Switch View button is hidden.

enableGridToGrow

public boolean enableGridToGrow()

Returns whether the grid is allowed to grow.

Note: If set to false, the grid is restricted to the size of the height and width properties. If the height and width properties are not set, then enableGridToGrow is essentially true. When enableGridToGrow is true, the height and width properties are ignored and the grid is allowed to grow as large as is necessary to show all of the content.

Returns:
true if the grid is allowed to grow; false if the grid is not allowed to grow

displayNavigationBar

public boolean displayNavigationBar()

Returns whether the Navigation bar is visible.

This property is equivalent to the setHasPageBottomToolbar method of the CrystalReportViewer and the CrystalReportInteractiveViewer objects.

Returns:
true if the Navigation bar is visible; false if the Navigation bar is hidden

displayGroupTree

public boolean displayGroupTree()

Returns whether the group tree is visible.

If the DisplayGroupTree property is false, and setDisplayToolbarToggleTreeButton is true, the user can view the group tree by using the toggle tree button. To remove the ability to view the group tree, set both the DisplayGroupTree and setDisplayToolbarToggleTreeButton methods to false.

If the DisplayGroupTree property is true and the report does not contain any groups, an empty group tree is displayed.

Returns:
true if the Group Tree is visible; false if the Group Tree is hidden

displayToolbar

public boolean displayToolbar()

Returns whether the Toolbar is visible.

Returns:
true if the Toolbar is visible; false if the Toolbar is hidden

getGridColumnCollection

public GridColumnCollection getGridColumnCollection()

Returns the GridColumnCollection associated with the GridViewer.

Returns:
the GridColumnCollection object as a GridColumnCollection object

getGridViewMode

public CrGridViewModeEnum getGridViewMode()

Returns the viewing mode of the Java grid viewer.

Returns:
the GridViewMode of the Java grid viewer as a CrGridViewModeEnum

setEnableGridToGrow

public void setEnableGridToGrow(boolean enableGridToGrow)

Sets whether or not to enable the grid to grow.

Parameters:
enableGridToGrow - true to enable the grid to grow

setDisplayNavigationBar

public void setDisplayNavigationBar(boolean displayNavigationBar)

Sets whether or not to display the Navigation Bar.

Parameters:
displayNavigationBar - true to display the Navigation Bar

setDisplayGroupTree

public void setDisplayGroupTree(boolean newDisplayGroupTree)

Sets whether or not to display the Group Tree.

Parameters:
newDisplayGroupTree - true to display the Group Tree

setDisplayToolbar

public void setDisplayToolbar(boolean displayToolbar)

Sets whether to display the Toolbar.

Parameters:
displayToolbar - true to display the Toolbar

setGridViewMode

public void setGridViewMode(CrGridViewModeEnum newViewMode)

Sets the viewing mode of the Java grid viewer.

Parameters:
newViewMode - a CrGridViewModeEnum that specifies the viewing mode of the Java grid viewer (0 = flat 1 = Group)

setGroupTreeWidth

public void setGroupTreeWidth(int newGroupTreeWidth)

Sets the width of the Group Tree.

Parameters:
newGroupTreeWidth - an int that specifies the width of the Group Tree

setGroupTreeWidthUnit

public void setGroupTreeWidthUnit(CrHtmlUnitEnum newGroupTreeWidthUnit)

Sets the unit of measurement for the GroupTreeWidth.

Parameters:
newGroupTreeWidthUnit - a CrHtmlUnitEnum that specifies the unit of measurement for the GroupTreeWidth

setGridColumnCollection

public void setGridColumnCollection(GridColumnCollection newColumnCollection)

Sets the GridColumnCollection associated with the Java grid viewer.

If this property is not set, the DHTML grid viewer defaults to showing all of the fields in the report. Use this property if you do not want to display all of the fields, if you want to change the order of the fields, or if you want to specify the formatting ( style sheet, number or date formatting, and heading names) of the fields.

Parameters:
newColumnCollection - the GridColumnCollection to use with this grid viewer object

setDisplayToolbarFindRowButton

public void setDisplayToolbarFindRowButton(boolean displayToolbarFindRowButton)

Sets whether to include the find row text box when rendering the Toolbar.

Parameters:
displayToolbarFindRowButton - true to display the find row button

setDisplayToolbarCrystalLogo

public void setDisplayToolbarCrystalLogo(boolean displayToolbarCrystalLogo)

Sets whether to display the Business Objects Logo on the Toolbar.

Parameters:
displayToolbarCrystalLogo - true to display the Business Objects logo on the Toolbar

setDisplayToolbarSwitchViewButton

public void setDisplayToolbarSwitchViewButton(boolean displayToolbarSwitchButton)

Sets whether to include or exclude the button to switch between flat and group view modes.

Parameters:
displayToolbarSwitchButton - true to display the switch view button on the Toolbar

setPageSize

public void setPageSize(int newPageSize)

Sets the number of records to display per page.

Parameters:
newPageSize - the number of records to display per page as an int

matchGridAndToolbarWidths

public boolean matchGridAndToolbarWidths()

Returns whether the grid and Toolbar widths will be matched.

Returns:
true if the grid and Toolbar widths will be matched; false if the grid and Toolbar widths will not be matched

setMatchGridAndToolbarWidths

public void setMatchGridAndToolbarWidths(boolean matchGridAndToolbarWidths)

Sets whether or not the grid and Toolbar widths will be matched.

Parameters:
matchGridAndToolbarWidths - true to have the grid and Toolbar widths matched

displayRowNumberColumn

public CrDisplayRowNumberColumnEnum displayRowNumberColumn()

Returns the style class of the row number column.

Returns:
displayRowNumberColumn a CrDisplayRowNumberColumnEnum that specifies the style class of the row number column

setDisplayRowNumberColumn

public void setDisplayRowNumberColumn(CrDisplayRowNumberColumnEnum newEnumValue)

Sets whether to display an initial column in the grid that displays the number assigned to each row.

The valid values for this property are:

Parameters:
newEnumValue - a CrDisplayRowNumberColumnEnum that specifies the style class of the row number column

setToolbarStyle

public void setToolbarStyle(java.lang.String newToolbarStyle)

Sets the style class of the Toolbar to an existing class in a cascading style sheet (.css).

Parameters:
newToolbarStyle - a String that specifies the Toolbar style class
See Also:
getToolbarStyle

getToolbarStyle

public java.lang.String getToolbarStyle()

Returns the Toolbar style class.

Returns:
the style class of the Toolbar as a String
See Also:
setToolbarStyle

setNavigationBarStyle

public void setNavigationBarStyle(java.lang.String newNavigationBarStyle)

Set the style class of the bottom toolbar to an existing class in a cascading style sheet (.css).

Parameters:
newNavigationBarStyle - a String that specifies the Navigation bar style class
See Also:
getNavigationBarStyle

getNavigationBarStyle

public java.lang.String getNavigationBarStyle()

Returns the Navigation bar style class.

Returns:
the style class of the Navigation bar as a String
See Also:
setNavigationBarStyle(String newNavigationBarStyle)

setHeadingStyle

public void setHeadingStyle(java.lang.String newHeadingStyle)

Sets the style class of the heading row to an existing class in a cascading style sheet (.css).

Parameters:
newHeadingStyle - a String that specifies the style class of the heading
See Also:
getHeadingStyle

getHeadingStyle

public java.lang.String getHeadingStyle()

Gets the style class of the heading.

Returns:
the style class of the heading as a String
See Also:
setHeadingStyle

setCellStyle

public void setCellStyle(java.lang.String newCellStyle)

Sets the style class to an existing class in a cascading style sheet (.css).

Parameters:
newCellStyle - a String that specifies the style class of the cells in the grid

getCellStyle

public java.lang.String getCellStyle()

Returns the style class of the cells in the grid.

Returns:
a String that specifies the style class of the cells in the grid
See Also:
setCellStyle

setTableStyle

public void setTableStyle(java.lang.String s)

Sets the style class of the table.

Parameters:
s - a String that specifies the style class of the table

getTableStyle

public java.lang.String getTableStyle()

Returns the style class of the table.

Returns:
a String that specifies the style class of the table

setRowNumberColumnStyle

public void setRowNumberColumnStyle(java.lang.String newRowNumberColumnStyle)

Sets the style class of the row number column to an existing class in a cascading style sheet (.css).

Parameters:
newRowNumberColumnStyle - a String that specifies the style class of the row number column
See Also:
getRowNumberColumnStyle

getRowNumberColumnStyle

public java.lang.String getRowNumberColumnStyle()

Returns the style class of the row number column.

Returns:
a String that specifies the style class of the row number column
See Also:
setRowNumberColumnStyle

setDisplayToolbarExportList

public void setDisplayToolbarExportList(boolean displayToolbarExportList)

Sets whether to display the export button when rendering the Toolbar.

Parameters:
displayToolbarExportList - true to display the export button on the Toolbar

displayToolbarExportList

public boolean displayToolbarExportList()

Returns whether the export list is displayed on the Toolbar.

Returns:
true if the export list is displayed; false if the export list is hidden

setDisplayToolbarGroupViewList

public void setDisplayToolbarGroupViewList(boolean displayToolbarGroupViewList)

Sets whether the viewer should display the current mode and group information. The default value is false.

Parameters:
displayToolbarGroupViewList - true to display the current mode and group information.

displayToolbarGroupViewList

public boolean displayToolbarGroupViewList()

Returns whether the view list will be displayed on the Toolbar.

Returns:
true if the view list will be displayed; false if the view list will be hidden

displayToolbarNavigationButtons

public boolean displayToolbarNavigationButtons()

Returns whether or not the navigation buttons will be displayed on the Toolbar.

Returns:
true if the navigation buttons will be displayed false if the navigation buttons will be hidden

displayToolbarToggleTreeButton

public boolean displayToolbarToggleTreeButton()

Returns whether the toggle tree button is displayed on the Toolbar.

Returns:
true if the toggle tree button is displayed in the Toolbar false if the toggle tree button is hidden

setDisplayToolbarNavigationButtons

public void setDisplayToolbarNavigationButtons(boolean displayToolbarNavigationButtons)

Sets whether to display the navigation buttons on the Toolbar.

The navigation buttons include the first page, previous page, next page, and last page buttons. They also include the find row text box and the row number label.

Parameters:
displayToolbarNavigationButtons - true to display the navigation buttons on the Toolbar

setDisplayToolbarToggleTreeButton

public void setDisplayToolbarToggleTreeButton(boolean newDisplayToolbarToggleTreeButton)

Sets whether to display the toggle tree button on the Toolbar.

Parameters:
newDisplayToolbarToggleTreeButton - true to display the toggle tree button on the Toolbar