Package com.microstrategy.web.objects
Interface WebGridWidths
-
public interface WebGridWidths
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 (
WebReportManipulation.applyChanges()
), and get result of new report instance to see the effect.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_SET_CW_NAME
static java.lang.String
PROPERTY_SET_TEMPLATE_FORMATTING
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
clearAllWidths()
Resets all columns to use the default width.void
clearWidth(int type)
Clears the width for a specific column class, which can be the header, grid, extra.WebColumns
getColumns()
Returns the collection of resizable column widths.WebColumns
getColumns(boolean compact)
Returns the collection of WebColumn objects.WebColumns
getColumns(boolean compact, boolean suppressOutlineMode)
Deprecated.The function should not be used under normal circumstancesint
getColumnScenario()
Returns the column scenario.int
getDefaultGridWidth()
Returns default column grid width.int
getDefaultHeaderWidth()
Returns default column header width.int
getExtraWidth()
Returns the width of the extra column, which separates the row headers and grid values.int
getRowHeight()
Returns the row height.int
getRowScenario()
Returns the row scenario.int
getWidth(java.lang.String columnKey)
Returns the width of theWebColumn
matching the given column key.void
setColumnScenario(int scenario)
Sets the column scenario.void
setColumnScenario(int scenario, int defaultWidth)
Set Column Scenario.void
setColumnScenario(int scenario, int defaultHeaderWidth, int defaultGridWidth)
Sets the column scenario.void
setExtraWidth(int extraWidth)
Sets the width of the extra column, which separates the row headers and grid values.void
setMetricsHeaderWidth(int width)
Sets the width of the "metrics" header.void
setRowScenario(int scenario)
Sets the row scenario.void
setRowScenario(int scenario, int rowHeight)
Sets the row scenario.void
setWidth(int width, WebObjectInfo target)
Sets the width of a column on the template.void
setWidth(int width, WebObjectInfo target, int subtitleDepth)
Sets the width of a column on the template.void
setWidth(int width, java.lang.String columnKey)
Sets the width of a column on the template.
-
-
-
Field Detail
-
PROPERTY_SET_CW_NAME
static final java.lang.String PROPERTY_SET_CW_NAME
- See Also:
- Constant Field Values
-
PROPERTY_SET_TEMPLATE_FORMATTING
static final java.lang.String PROPERTY_SET_TEMPLATE_FORMATTING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getColumnScenario
int getColumnScenario() throws WebObjectsException
Returns the column scenario.- Returns:
- The scenario of column. A value in
EnumDSSXMLWidthScenario
. - Throws:
WebObjectsException
- thrown when error happens during retrieving the column width information.
-
getDefaultHeaderWidth
int getDefaultHeaderWidth() throws WebObjectsException
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.
-
getDefaultGridWidth
int getDefaultGridWidth() throws WebObjectsException
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.
-
setColumnScenario
void setColumnScenario(int scenario) throws java.lang.IllegalArgumentException
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 inEnumDSSXMLWidthScenario
.- Throws:
java.lang.IllegalArgumentException
- Thrown when the input scenario is not a valid value in the enumerationEnumDSSXMLWidthScenario
.
-
setColumnScenario
void setColumnScenario(int scenario, int defaultHeaderWidth, int defaultGridWidth) throws java.lang.IllegalArgumentException
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 inEnumDSSXMLWidthScenario
.defaultHeaderWidth
- The default header width to be setdefaultGridWidth
- The default grid width to be set- Throws:
java.lang.IllegalArgumentException
- Thrown when the input scenario is not a valid value in the enumerationEnumDSSXMLWidthScenario
, or the two width inputs are less than -1.
-
getExtraWidth
int getExtraWidth() throws WebObjectsException
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.
-
setExtraWidth
void setExtraWidth(int extraWidth) throws WebObjectsException
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.- Throws:
WebObjectsException
-
getRowScenario
int getRowScenario() throws WebObjectsException
Returns the row scenario.- Returns:
- The scenario of row. DssXmlWidthFitToContent or DssXmlWidthFixed
in
EnumDSSXMLWidthScenario
. - Throws:
WebObjectsException
- thrown when error happens during retrieving the column width information.
-
getRowHeight
int getRowHeight() throws WebObjectsException
Returns the row height.- Returns:
- The height in pixel of row height.
- Throws:
WebObjectsException
- thrown when error happens during retrieving the column width information.
-
setRowScenario
void setRowScenario(int scenario) throws java.lang.IllegalArgumentException
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 inEnumDSSXMLWidthScenario
.- Throws:
java.lang.IllegalArgumentException
- Thrown when the input scenario DssXmlWidthFitToContent or DssXmlWidthFixed in the enumerationEnumDSSXMLWidthScenario
.
-
setRowScenario
void setRowScenario(int scenario, int rowHeight) throws java.lang.IllegalArgumentException
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 inEnumDSSXMLWidthScenario
.rowHeight
- The value for row height- Throws:
java.lang.IllegalArgumentException
- Thrown when the input scenario is not a valid value in the enumerationEnumDSSXMLWidthScenario
, or row height is less than -1.
-
setWidth
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.
-
setWidth
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 columntarget
- 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.
-
setMetricsHeaderWidth
void setMetricsHeaderWidth(int width)
Sets the width of the "metrics" header.- Parameters:
width
- The width in pixel to set for the "metrics" header.
-
clearWidth
void clearWidth(int type) throws WebObjectsException
Clears the width for a specific column class, which can be the header, grid, extra.- Parameters:
type
- A value inEnumDSSXMLColumnClass
.- Throws:
WebObjectsException
-
clearAllWidths
void clearAllWidths() throws WebObjectsException
Resets all columns to use the default width.- Throws:
WebObjectsException
-
setColumnScenario
void setColumnScenario(int scenario, int defaultWidth) throws java.lang.IllegalArgumentException
Set Column Scenario. InvokessetColumnScenario(int, int, int)
with the same width for the header and grid defaults.- Parameters:
scenario
- A value inEnumDSSXMLWidthScenario
.defaultWidth
- The default value to set for both header width and grid width- Throws:
java.lang.IllegalArgumentException
- Thrown when the input scenario is not a valid value in the enumerationEnumDSSXMLWidthScenario
, or the width input is less than -1.
-
getColumns
WebColumns getColumns() throws WebObjectsException
Returns the collection of resizable column widths. InvokesgetColumns(boolean)
with compact set to false- Returns:
- WebColumns returns
getColumns(boolean compact)
with compact equals to false. - Throws:
WebObjectsException
-
getColumns
WebColumns getColumns(boolean compact) throws WebObjectsException
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 ofEnumDSSXMLWidthScenario.DssXmlWidthFixed
), and that the result flags includeEnumDSSXMLResultFlags.DssXmlResultGrid
.- Parameters:
compact
- if true, repeated data headers are suppressed- Returns:
- WebColumns a collection of
WebColumn
objects - Throws:
WebObjectsException
- if any error occurs while retrieving or constructing the columns.
-
getColumns
@Deprecated WebColumns getColumns(boolean compact, boolean suppressOutlineMode) throws WebObjectsException
Deprecated.The function should not be used under normal circumstancesReturns 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 ofEnumDSSXMLWidthScenario.DssXmlWidthFixed
), and that the result flags includeEnumDSSXMLResultFlags.DssXmlResultGrid
.- Parameters:
compact
- if true, repeated data headers are suppressedsuppressOutlineMode
- if true, suppress the columns to be merged for outline mode- Returns:
- WebColumns a collection of
WebColumn
objects - Throws:
WebObjectsException
- if any error occurs while retrieving or constructing the columns.
-
getWidth
int getWidth(java.lang.String columnKey) throws java.lang.IllegalArgumentException, WebObjectsException
Returns the width of theWebColumn
matching the given column key.- Parameters:
columnKey
- key of the WebColumn- Returns:
- int the width of the column in pixels.
- Throws:
java.lang.IllegalArgumentException
- if key is malformed or empty.WebObjectsException
-
setWidth
void setWidth(int width, java.lang.String columnKey) throws java.lang.IllegalArgumentException, WebObjectsException
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:
java.lang.IllegalArgumentException
- if key is invalid.WebObjectsException
- if column width could not be set.
-
-