public class ColInfo extends java.lang.Object implements 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:
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:
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().
Modifier and Type | Field and Description |
---|---|
int |
ASC |
int |
DESC |
int |
NOT_SORTED |
static java.lang.String |
XMLTAG |
Constructor and Description |
---|
ColInfo(Formula formulaObj,
java.lang.String colName,
int sqlType)
Create a new report column using the specified formula, column name and SQL type.
|
ColInfo(int colMappedIndex)
Creates a new report column using the specified column from the data source
|
ColInfo(IObject object,
java.lang.String colName)
Creates a new report column using the specified formula and column name
|
ColInfo(IObject object,
java.lang.String colName,
int sqlType)
Create a new report column using the specified formula, column name and SQL type.
|
ColInfo(java.lang.String formula,
java.lang.String colName,
int sqlType)
Create a new report column using the specified formula, column name and SQL type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a clone of this object.
|
boolean |
equals(ColInfo cInfo)
Returns true if and only if this ColInfo is identical to cInfo.
|
boolean |
equals(ColInfo cInfo,
boolean checkRepeatField)
Internal Use only
|
short |
getAggregation()
Returns the aggregation on the column.
|
int |
getDataType()
Returns the SQL type of the column
|
java.lang.String |
getDBTableName()
Gets the name of the Database table.
|
java.lang.String |
getDrillDownName()
Gets the drill down report name from this column
|
java.lang.String |
getFormula()
Returns the formula of the column
|
java.lang.String |
getFormulaName()
Gets the Formula name.
|
Formula |
getFormulaObj()
Gets the Formula Object.
|
int |
getMapping()
Get the mapping for the report
|
java.lang.String |
getName()
Returns the name of the column
|
int |
getOrderInfo()
Gets what type of crosstab ordering is used: NOT_SORTED, ASC, DESC.
|
boolean |
isAggregatedColumn()
Returns whether this is an aggregated column.
|
boolean |
isAsc()
Returns whether the ColInfo is sorted in ascending order.
|
boolean |
isColumnBreak()
Returns whether column is used as column break
|
boolean |
isColumnBreakValue()
Returns whether column is used as column break value
|
boolean |
isDsc()
Returns whether the ColInfo is sorted in descending order.
|
boolean |
isFitGroupOnPage()
True iff groups are to be fitted on the same page.
|
boolean |
isMaster()
Returns whether column is used as master field
|
boolean |
isPrimaryKey()
Returns whether column is used as primary key
|
boolean |
isRepeatBreakField()
Returns whether this is a repeated break field.
|
boolean |
isRowBreak()
Returns whether column is used as row break
|
boolean |
isSorted()
Returns whether the ColInfo is sorted
|
boolean |
isTopN()
Returns whether this column is used to order rows in a topN Report.
|
boolean |
isVisible()
Returns whether column is visible
|
static ColInfo |
read(java.io.DataInput in,
int version)
Internal Use only
|
static ColInfo |
readXML(org.w3c.dom.Node dnode,
int version)
Reads in a XML node with corresponding version and return data as a ColInfo.
|
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.
|
void |
setAggregation(short agg)
Sets the aggregation method for the column.
|
void |
setColumnBreak(boolean breakOnThisColumn)
Sets the column as column break.
|
void |
setColumnBreakValue(boolean breakOnThisColumn)
Each distinct value in this specified column will be a report column in the table body.
|
void |
setDBTableName(java.lang.String tableName)
Sets the name of the Database table.
|
void |
setDrillDownName(java.lang.String name)
Sets the drill down report name (if applicable) to this column
|
void |
setFitGroupOnPage(boolean isFitGroupOnPage)
Set whether to fit groups on the same page.
|
void |
setFormula(java.lang.String txt,
int type)
Sets the formula of the column.
|
void |
setFormulaName(java.lang.String name)
Sets the Formula name.
|
void |
setFormulaObj(Formula formula)
Sets the Formula Object
|
void |
setMapping(int colMappedIndex)
Sets the mapping for the report
|
void |
setMaster(boolean isMasterField)
Sets the column as the master field for a Masters and Detail Type Report.
|
void |
setName(java.lang.String colName)
Sets the name of the column
|
void |
setOrderInfo(int i)
Sets crosstab ordering this allows user to sort the column break values in a crosstab report
|
void |
setPrimaryKey(boolean isPrimaryKey)
Sets the column as the primary key in a Master and Details Type Report.
|
void |
setRepeatBreakField(boolean isRepeatBreakField)
sets this column to be a repeated break field.
|
void |
setRowBreak(boolean breakOnThisColumn)
Sets the column as row break.
|
void |
setSkipFirstValueForFitGroup(boolean s)
Specify if the first group should be tested rather it can fit on the current page.
|
void |
setTopN(boolean isTopN)
Sets this column to be used to order rows in a topN Report.
|
void |
setVisible(boolean b)
Sets the column invisible
|
boolean |
skipFirstValueForFitGroup()
If this method returns true, then the first group is not tested if it will fit on the current
page.
|
void |
write(java.io.DataOutput out)
Internal Use only
|
void |
writeXML(java.io.Writer out)
Internal Use only
|
public static final java.lang.String XMLTAG
public final int NOT_SORTED
public final int ASC
public final int DESC
public ColInfo(int colMappedIndex)
public ColInfo(IObject object, java.lang.String colName)
public ColInfo(IObject object, java.lang.String colName, int sqlType)
public ColInfo(java.lang.String formula, java.lang.String colName, int sqlType)
public ColInfo(Formula formulaObj, java.lang.String colName, int sqlType)
public int getMapping()
public void setMapping(int colMappedIndex)
public boolean isPrimaryKey()
public void setPrimaryKey(boolean isPrimaryKey)
public boolean isRowBreak()
public void setRowBreak(boolean breakOnThisColumn)
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.
public boolean isColumnBreak()
public void setColumnBreak(boolean breakOnThisColumn)
public boolean isColumnBreakValue()
public void setColumnBreakValue(boolean breakOnThisColumn)
public void setMaster(boolean isMasterField)
public boolean isMaster()
public boolean isTopN()
public void setTopN(boolean isTopN)
public short getAggregation()
public void setAggregation(short agg)
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.
public void setAggregation(boolean aggregateColumn, short agg)
public boolean isAggregatedColumn()
public boolean isRepeatBreakField()
public void setRepeatBreakField(boolean isRepeatBreakField)
public boolean isFitGroupOnPage()
public void setFitGroupOnPage(boolean isFitGroupOnPage)
public java.lang.String getName()
public void setName(java.lang.String colName)
public java.lang.String getDBTableName()
public void setDBTableName(java.lang.String tableName)
public java.lang.String getFormula()
public void setFormula(java.lang.String txt, int type)
public Formula getFormulaObj()
public void setFormulaObj(Formula formula)
public java.lang.String getFormulaName()
public void setFormulaName(java.lang.String name)
public int getDataType()
public boolean isVisible()
public void setVisible(boolean b)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(ColInfo cInfo)
public boolean equals(ColInfo cInfo, boolean checkRepeatField)
public void write(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public static ColInfo read(java.io.DataInput in, int version) throws java.lang.Exception
java.lang.Exception
public void writeXML(java.io.Writer out) throws java.io.IOException
java.io.IOException
public static ColInfo readXML(org.w3c.dom.Node dnode, int version) throws java.lang.Exception
java.lang.Exception
public boolean skipFirstValueForFitGroup()
public void setSkipFirstValueForFitGroup(boolean s)
public void setOrderInfo(int i)
int
- i: NOT_SORTED, ASC, DESC.public int getOrderInfo()
public boolean isSorted()
public boolean isAsc()
public boolean isDsc()
public void setDrillDownName(java.lang.String name)
name
- public java.lang.String getDrillDownName()