public interface

WebGridWidths

com.microstrategy.web.objects.WebGridWidths

Class Overview

This interface is for grid column width manipulations. User can choose different scenario for row and column axes. A scenario controls how the column width would be configured for the specific axis.

For column axis, the valid scenarios are in EnumDSSXMLWidthScenario.

  • For DssXmlWidthFitToDisplay and DssXmlWidthFitToContent, user will not be able to specify the width of any column.
  • Only for DssXmlWidthFixed scenario, user has the option to specify width for columns. User may specify a width for a particular column. If user does not specify a width for a particular column, a default width will be applied. To specify the column, user may indicate the template unit and the subtitleIndex(depth) of the column. For example, in the report, there is an attribute of "employee", and there are two columns corresponding to it: "Last Name" and "First Name". So for the column of "Last Name", the subtitleIndex is 1, for the column of "First Name", the subtitle index is 2. If user wants to set a specific width of the column of "First Name", user could specify this column by providing the "employee" and subtitleIndex of 1.

For row axis, the valid scenarios are DssXmlWidthFitToContent and DssXmlWidthFixed in EnumDSSXMLWidthScenario.

  • For DssXmlWidthFitToContent scenario, user will not be able to specify the row height
  • For DssXmlWidthFixed scenario, user will be able to specify the default row height for any row. Currently, we do not have a way to specify a height for a particular row.

After making neccessary manipulations about grid widths, user needs to apply these manipulations (applyChanges()), and get result of new report instance to see the effect.

Summary

Constants
String PROPERTY_SET_CW_NAME
String PROPERTY_SET_TEMPLATE_FORMATTING
Public Methods
abstract void clearAllWidths()
Resets all columns to use the default width.
abstract void clearWidth(int type)
Clears the width for a specific column class, which can be the header, grid, extra.
abstract int getColumnScenario()
Returns the column scenario.
abstract WebColumns getColumns()
Returns the collection of resizable column widths.
abstract WebColumns getColumns(boolean compact)
Returns the collection of WebColumn objects.
abstract WebColumns getColumns(boolean compact, boolean suppressOutlineMode)
This method is deprecated. The function should not be used under normal circumstances
abstract int getDefaultGridWidth()
Returns default column grid width.
abstract int getDefaultHeaderWidth()
Returns default column header width.
abstract int getExtraWidth()
Returns the width of the extra column, which separates the row headers and grid values.
abstract int getRowHeight()
Returns the row height.
abstract int getRowScenario()
Returns the row scenario.
abstract int getWidth(String columnKey)
Returns the width of the WebColumn matching the given column key.
abstract void setColumnScenario(int scenario, int defaultHeaderWidth, int defaultGridWidth)
Sets the column scenario.
abstract void setColumnScenario(int scenario)
Sets the column scenario.
abstract void setColumnScenario(int scenario, int defaultWidth)
Set Column Scenario.
abstract void setExtraWidth(int extraWidth)
Sets the width of the extra column, which separates the row headers and grid values.
abstract void setMetricsHeaderWidth(int width)
Sets the width of the "metrics" header.
abstract void setRowScenario(int scenario, int rowHeight)
Sets the row scenario.
abstract void setRowScenario(int scenario)
Sets the row scenario.
abstract void setWidth(int width, WebObjectInfo target, int subtitleDepth)
Sets the width of a column on the template.
abstract void setWidth(int width, WebObjectInfo target)
Sets the width of a column on the template.
abstract void setWidth(int width, String columnKey)
Sets the width of a column on the template.

Constants

public static final String PROPERTY_SET_CW_NAME

Constant Value: "ColumnWidthProperties"

public static final String PROPERTY_SET_TEMPLATE_FORMATTING

Constant Value: "Template Formatting"

Public Methods

public abstract void clearAllWidths ()

Resets all columns to use the default width.

public abstract void clearWidth (int type)

Clears the width for a specific column class, which can be the header, grid, extra.

Parameters
type A value in EnumDSSXMLColumnClass.

public abstract int getColumnScenario ()

Returns the column scenario.

Returns
Throws
WebObjectsException thrown when error happens during retrieving the column width information.

public abstract WebColumns getColumns ()

Returns the collection of resizable column widths. Invokes getColumns(boolean) with compact set to false

Returns

public abstract WebColumns getColumns (boolean compact)

Returns the collection of WebColumn objects. The "compact" option, if true it returns a unique set of data headers, otherwise the data headers are repeated according to the grid layout. Requires column scenario of DssXmlWidthFixed), and that the result flags include DssXmlResultGrid.

Parameters
compact if true, repeated data headers are suppressed
Returns
Throws
WebObjectsException if any error occurs while retrieving or constructing the columns.

public abstract WebColumns getColumns (boolean compact, boolean suppressOutlineMode)

This method is deprecated.
The function should not be used under normal circumstances

Returns the collection of WebColumn objects. The "compact" option, if true it returns a unique set of data headers, otherwise the data headers are repeated according to the grid layout. Requires column scenario of DssXmlWidthFixed), and that the result flags include DssXmlResultGrid.

Parameters
compact if true, repeated data headers are suppressed
suppressOutlineMode if true, suppress the columns to be merged for outline mode
Returns
Throws
WebObjectsException if any error occurs while retrieving or constructing the columns.

public abstract int getDefaultGridWidth ()

Returns default column grid width.

Returns
  • the default column grid width. This value only makes sense for column scenario of DssXmlWidthFixed.
Throws
WebObjectsException thrown when error happens during retrieving the column width information.

public abstract int getDefaultHeaderWidth ()

Returns default column header width.

Returns
  • the default column header width. This value only makes sense for column scenario of DssXmlWidthFixed.
Throws
WebObjectsException thrown when error happens during retrieving the column width information.

public abstract int getExtraWidth ()

Returns the width of the extra column, which separates the row headers and grid values.

Returns
  • the width of the extra column, which separates the row headers and grid values.
Throws
WebObjectsException thrown when error happens during retrieving the column width information.

public abstract int getRowHeight ()

Returns the row height.

Returns
  • The height in pixel of row height.
Throws
WebObjectsException thrown when error happens during retrieving the column width information.

public abstract int getRowScenario ()

Returns the row scenario.

Returns
Throws
WebObjectsException thrown when error happens during retrieving the column width information.

public abstract int getWidth (String columnKey)

Returns the width of the WebColumn matching the given column key.

Parameters
columnKey key of the WebColumn
Returns
  • int the width of the column in pixels.
Throws
IllegalArgumentException if key is malformed or empty.
WebObjectsException

public abstract void setColumnScenario (int scenario, int defaultHeaderWidth, int defaultGridWidth)

Sets the column scenario. When the input scenario is DssXmlWidthFixed, the default header width and grid width will be set. When the input scenario is any value other than DssWidthFixed, then all fixed width information set for column are cleared.

Parameters
scenario A value in EnumDSSXMLWidthScenario.
defaultHeaderWidth The default header width to be set
defaultGridWidth The default grid width to be set
Throws
IllegalArgumentException Thrown when the input scenario is not a valid value in the enumeration EnumDSSXMLWidthScenario, or the two width inputs are less than -1.

public abstract void setColumnScenario (int scenario)

Sets the column scenario. When the input scenario is DssXmlWidthFixed, the default header width and grid width will be set to 0. When the input scenario is any value other than DssWidthFixed, then all fixed width information set for column are cleared.

Parameters
scenario A value in EnumDSSXMLWidthScenario.
Throws
IllegalArgumentException Thrown when the input scenario is not a valid value in the enumeration EnumDSSXMLWidthScenario.

public abstract void setColumnScenario (int scenario, int defaultWidth)

Set Column Scenario. Invokes setColumnScenario(int, int, int) with the same width for the header and grid defaults.

Parameters
scenario A value in EnumDSSXMLWidthScenario.
defaultWidth The default value to set for both header width and grid width
Throws
IllegalArgumentException Thrown when the input scenario is not a valid value in the enumeration EnumDSSXMLWidthScenario, or the width input is less than -1.

public abstract void setExtraWidth (int extraWidth)

Sets the width of the extra column, which separates the row headers and grid values.

Parameters
extraWidth The width to set to the extra column.

public abstract void setMetricsHeaderWidth (int width)

Sets the width of the "metrics" header.

Parameters
width The width in pixel to set for the "metrics" header.

public abstract void setRowScenario (int scenario, int rowHeight)

Sets the row scenario. When the input scenario is DssXmlWidthFixed, the row height will be set. When the input scenario is any value other than DssWidthFixed, then height information set for row are cleared.

Parameters
scenario DssXmlWidthFitToContent or DssXmlWidthFixed in EnumDSSXMLWidthScenario.
rowHeight The value for row height
Throws
IllegalArgumentException Thrown when the input scenario is not a valid value in the enumeration EnumDSSXMLWidthScenario, or row height is less than -1.

public abstract void setRowScenario (int scenario)

Sets the row scenario. When the input scenario is DssXmlWidthFixed, the row height will be set to 0. When the input scenario is any value other than DssWidthFixed, then height information set for row are cleared.

Parameters
scenario DssXmlWidthFitToContent or DssXmlWidthFixed in EnumDSSXMLWidthScenario.
Throws
IllegalArgumentException Thrown when the input scenario DssXmlWidthFitToContent or DssXmlWidthFixed in the enumeration EnumDSSXMLWidthScenario.

public abstract void setWidth (int width, WebObjectInfo target, int subtitleDepth)

Sets the width of a column on the template. The column specified by the template unit object, and its subtitle depth.

Parameters
width the width to set for this column
target the object on this template unit.
subtitleDepth position on a 1-based index. For example, for attribute "employee", there are two forms, "first name" and "last name". So, there are two columns corresponding to "employee" unit. Then if you want to change the width of "first name", you should pass "1" as the subtitleDepth. When subtitleDepth gets set to 0, it means to apply this setting to all columns corresponding to this template unit.

public abstract void setWidth (int width, WebObjectInfo target)

Sets the width of a column on the template. The column specified by the template unit object. If this template unit corresponds to multiple columns, this setting will be applied to all columns.

Parameters
width The width to be set to the column.
target The target on the template unit, whose column(s) will be set.

public abstract void setWidth (int width, String columnKey)

Sets the width of a column on the template. The column specified by the column key.

Parameters
width width of the column in pixels.
columnKey column identifier.
Throws
IllegalArgumentException if key is invalid.
WebObjectsException if column width could not be set.