Class ColInfo
- All Implemented Interfaces:
IAggregateConstants
The most simple use of the ColInfo is to map the same columns from the data source to the report. This is done using the following short piece of code:
-
ColInfo[] colInfo = new ColInfo[3]; //3 columns
colInfo[0] = new ColInfo(0); //column 0 of the QbReport is mapped to column 0 of the data source.
colInfo[0].setName("Product Type"); //sets table header name of the column 0 of the QbReport.
colInfo[1] = new ColInfo(1); //column 1 of the QbReport is mapped to column 1 of the data source.
colInfo[1].setName("Product Name"); //sets table header name of the column 1 of the QbReport.
colInfo[2] = new ColInfo(2); //column 2 of the QbReport is mapped to column 2 of the data source.
colInfo[2].setName("Product Price"); //sets table header name of the column 2 of the QbReport.
However, sometimes you may want to map a column from the data source to a different column in the report layout table. To map column 0 from the data source to column 1 of a report layout table, simply do the following:
-
colInfo[1] = new ColInfo(0); //column 1 of the QbReport is mapped to column 0 of the data source.
Sometimes more formatting is desired in the report, the following is a summary of methods that must be set before generation of each corresponding report types using QbReport:
Summary Break Report: setRowBreak(), setAggregation().
Crosstab Report: setRowBreak(), setColumnBreak(), setColumnBreakValue(), setAggregation().
Master and Details Report: setPrimaryKey(), setMaster().
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionColInfo(int colMappedIndex) Creates a new report column using the specified column from the data sourceCreate a new report column using the specified formula, column name and SQL type.Creates a new report column using the specified formula and column nameCreate a new report column using the specified formula, column name and SQL type.Create a new report column using the specified formula, column name and SQL type. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of this object.booleanReturns true if and only if this ColInfo is identical to cInfo.booleanInternal Use onlyshortReturns the aggregation on the column.intReturns the SQL type of the columnGets the name of the Database table.Gets the drill down report name from this columnReturns the formula of the columnGets the Formula name.Gets the Formula Object.intGet the mapping for the reportgetName()Returns the name of the columnintGets what type of crosstab ordering is used: NOT_SORTED, ASC, DESC.booleanReturns whether this is an aggregated column.booleanisAsc()Returns whether the ColInfo is sorted in ascending order.booleanReturns whether column is used as column breakbooleanReturns whether column is used as column break valuebooleanisDsc()Returns whether the ColInfo is sorted in descending order.booleanTrue iff groups are to be fitted on the same page.booleanisMaster()Returns whether column is used as master fieldbooleanReturns whether column is used as primary keybooleanReturns whether this is a repeated break field.booleanReturns whether column is used as row breakbooleanisSorted()Returns whether the ColInfo is sortedbooleanisTopN()Returns whether this column is used to order rows in a topN Report.booleanReturns whether column is visiblestatic ColInfoInternal Use onlystatic ColInfoReads in a XML node with corresponding version and return data as a ColInfo.voidsetAggregation(boolean aggregateColumn, short agg) Similar to setAggregation(short agg), aggregateColumn sets whether to do column aggregation or not, if and only if agg != NONE.voidsetAggregation(short agg) Sets the aggregation method for the column.voidsetColumnBreak(boolean breakOnThisColumn) Sets the column as column break.voidsetColumnBreakValue(boolean breakOnThisColumn) Each distinct value in this specified column will be a report column in the table body.voidsetDBTableName(String tableName) Sets the name of the Database table.voidsetDrillDownName(String name) Sets the drill down report name (if applicable) to this columnvoidsetFitGroupOnPage(boolean isFitGroupOnPage) Set whether to fit groups on the same page.voidsetFormula(String txt, int type) Sets the formula of the column.voidsetFormulaName(String name) Sets the Formula name.voidsetFormulaObj(Formula formula) Sets the Formula ObjectvoidsetMapping(int colMappedIndex) Sets the mapping for the reportvoidsetMaster(boolean isMasterField) Sets the column as the master field for a Masters and Detail Type Report.voidSets the name of the columnvoidsetOrderInfo(int i) Sets crosstab ordering this allows user to sort the column break values in a crosstab reportvoidsetPrimaryKey(boolean isPrimaryKey) Sets the column as the primary key in a Master and Details Type Report.voidsetRepeatBreakField(boolean isRepeatBreakField) sets this column to be a repeated break field.voidsetRowBreak(boolean breakOnThisColumn) Sets the column as row break.voidsetSkipFirstValueForFitGroup(boolean s) Specify if the first group should be tested rather it can fit on the current page.voidsetTopN(boolean isTopN) Sets this column to be used to order rows in a topN Report.voidsetVisible(boolean b) Sets the column invisiblebooleanIf this method returns true, then the first group is not tested if it will fit on the current page.voidwrite(DataOutput out) Internal Use onlyvoidInternal Use only
-
Field Details
-
XMLTAG
- See Also:
-
NOT_SORTED
public final int NOT_SORTED- See Also:
-
ASC
public final int ASC- See Also:
-
DESC
public final int DESC- See Also:
-
-
Constructor Details
-
ColInfo
public ColInfo(int colMappedIndex) Creates a new report column using the specified column from the data source -
ColInfo
Creates a new report column using the specified formula and column name -
ColInfo
Create a new report column using the specified formula, column name and SQL type. The SQL type passed is from java.sql.Types -
ColInfo
Create a new report column using the specified formula, column name and SQL type. The SQL type passed is from java.sql.Types -
ColInfo
Create a new report column using the specified formula, column name and SQL type. The SQL type passed is from java.sql.Types
-
-
Method Details
-
getMapping
public int getMapping()Get the mapping for the report -
setMapping
public void setMapping(int colMappedIndex) Sets the mapping for the report -
isPrimaryKey
public boolean isPrimaryKey()Returns whether column is used as primary key -
setPrimaryKey
public void setPrimaryKey(boolean isPrimaryKey) Sets the column as the primary key in a Master and Details Type Report. To create a Master and Details Type Report, you must define a Primary Key column. The primary key column determines the grouping of the report. A new group will be created every time the value in the selected column changes(i.e. the Primary Key column). Only one column may serve as the Primary Key. -
isRowBreak
public boolean isRowBreak()Returns whether column is used as row break -
setRowBreak
public void setRowBreak(boolean breakOnThisColumn) Sets the column as row break. The number of new groups would be equal to the number of unique values in this column.This is especially useful when setting up a Summary Break Report or a Crosstab Report. If this column is setup to be a row break (by invoking setRowBreak(true);), then a grouping of other columns will be created for each unique value of this column. The report essentially gets "broken" every time the data in this "break" column changes. In addition, an aggregation must be specified (using the setAggregation() method, for the columns (even if columns are non-numeric. In such cases, Aggregation should be set to NONE) not specified as Row Breaks, so that column summaries can be generated based on aggregation.
-
isColumnBreak
public boolean isColumnBreak()Returns whether column is used as column break -
setColumnBreak
public void setColumnBreak(boolean breakOnThisColumn) Sets the column as column break. This is for CrossTab reports only -
isColumnBreakValue
public boolean isColumnBreakValue()Returns whether column is used as column break value -
setColumnBreakValue
public void setColumnBreakValue(boolean breakOnThisColumn) Each distinct value in this specified column will be a report column in the table body. This is for CrossTab reports only. -
setMaster
public void setMaster(boolean isMasterField) Sets the column as the master field for a Masters and Detail Type Report. In contrary to the Primary Key column, more than column can be set as master. If a column is set as a master, then the column value will appear in the group header instead of the data section of the report. In addition, the Primary Key value must be unique for each grouping of the Master field columns. -
isMaster
public boolean isMaster()Returns whether column is used as master field -
isTopN
public boolean isTopN()Returns whether this column is used to order rows in a topN Report. -
setTopN
public void setTopN(boolean isTopN) Sets this column to be used to order rows in a topN Report. -
getAggregation
public short getAggregation()Returns the aggregation on the column. The different values for aggregation are available under quadbase.reportdesigner.util.IAggregateConstants -
setAggregation
public void setAggregation(short agg) Sets the aggregation method for the column. The different values for aggregation are available under quadbase.reportdesigner.util.IAggregateConstants. In particular, an aggregation of this column is generated whenever a summary of the column values is needed (for Summary Break Report, Crosstab Report, etc.).For example, if a column with name "Order#" contains information about a customer's order and a column with name "Quantity" contains information about the customer order's quantity for each product (chair, table, etc.). Then setting the "Order#" column to be a row break and setting the "Quantity" column to be an aggregation by sum (ColInfo.SUM) would result in a table that groups the data by "Order#", and the TOTAL SUM quantity of products associated with that "Order#" will be shown at the row break.
-
setAggregation
public void setAggregation(boolean aggregateColumn, short agg) Similar to setAggregation(short agg), aggregateColumn sets whether to do column aggregation or not, if and only if agg != NONE. -
isAggregatedColumn
public boolean isAggregatedColumn()Returns whether this is an aggregated column. -
isRepeatBreakField
public boolean isRepeatBreakField()Returns whether this is a repeated break field. -
setRepeatBreakField
public void setRepeatBreakField(boolean isRepeatBreakField) sets this column to be a repeated break field. -
isFitGroupOnPage
public boolean isFitGroupOnPage()True iff groups are to be fitted on the same page. If the group splits a page, make the group appear on a new page. -
setFitGroupOnPage
public void setFitGroupOnPage(boolean isFitGroupOnPage) Set whether to fit groups on the same page. isFitGroupOnPage = true means if the group splits a page, make the group appear on a new page. False means never make a splitted group appear on a new page. -
getName
Returns the name of the column -
setName
Sets the name of the column -
getDBTableName
Gets the name of the Database table. -
setDBTableName
Sets the name of the Database table. -
getFormula
Returns the formula of the column -
setFormula
Sets the formula of the column. The text of the formula and its SQL type is passed. The SQL type passed is from java.sql.Types -
getFormulaObj
Gets the Formula Object. -
setFormulaObj
Sets the Formula Object -
getFormulaName
Gets the Formula name. -
setFormulaName
Sets the Formula name. -
getDataType
public int getDataType()Returns the SQL type of the column -
isVisible
public boolean isVisible()Returns whether column is visible -
setVisible
public void setVisible(boolean b) Sets the column invisible -
clone
Returns a clone of this object. -
equals
Returns true if and only if this ColInfo is identical to cInfo. -
equals
Internal Use only -
write
Internal Use only- Throws:
IOException
-
read
Internal Use only- Throws:
Exception
-
writeXML
Internal Use only- Throws:
IOException
-
readXML
Reads in a XML node with corresponding version and return data as a ColInfo.- Throws:
Exception
-
skipFirstValueForFitGroup
public boolean skipFirstValueForFitGroup()If this method returns true, then the first group is not tested if it will fit on the current page. If the first group is skipped, it will not trigger a page break even if it does not fit. The default value is true. -
setSkipFirstValueForFitGroup
public void setSkipFirstValueForFitGroup(boolean s) Specify if the first group should be tested rather it can fit on the current page. This value is only used for summary break and crosstab reports. The data is grouped on row breaks. -
setOrderInfo
public void setOrderInfo(int i) Sets crosstab ordering this allows user to sort the column break values in a crosstab report- Parameters:
int- i: NOT_SORTED, ASC, DESC.
-
getOrderInfo
public int getOrderInfo()Gets what type of crosstab ordering is used: NOT_SORTED, ASC, DESC. -
isSorted
public boolean isSorted()Returns whether the ColInfo is sorted -
isAsc
public boolean isAsc()Returns whether the ColInfo is sorted in ascending order. -
isDsc
public boolean isDsc()Returns whether the ColInfo is sorted in descending order. -
setDrillDownName
Sets the drill down report name (if applicable) to this column- Parameters:
name-
-
getDrillDownName
Gets the drill down report name from this column- Returns:
-