本文整理汇总了Java中net.sf.jasperreports.crosstabs.JRCrosstabCell.getContents方法的典型用法代码示例。如果您正苦于以下问题:Java JRCrosstabCell.getContents方法的具体用法?Java JRCrosstabCell.getContents怎么用?Java JRCrosstabCell.getContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.crosstabs.JRCrosstabCell
的用法示例。
在下文中一共展示了JRCrosstabCell.getContents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyCrosstabCells
import net.sf.jasperreports.crosstabs.JRCrosstabCell; //导入方法依赖的package包/类
private void verifyCrosstabCells(JRDesignCrosstab crosstab)
{
JRCrosstabCell[][] cells = crosstab.getCells();
JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
JRCrosstabColumnGroup[] columnGroups = crosstab.getColumnGroups();
JRCrosstabCell baseCell = cells[rowGroups.length][columnGroups.length];
if(baseCell == null || baseCell.getWidth() == null)
{
addBrokenRule("Crosstab base cell width not specified.", crosstab);
}
if(baseCell == null || baseCell.getHeight() == null)
{
addBrokenRule("Crosstab base cell height not specified.", crosstab);
}
for (int i = rowGroups.length; i >= 0 ; --i)
{
for (int j = columnGroups.length; j >= 0 ; --j)
{
JRCrosstabCell cell = cells[i][j];
String cellText = getCrosstabCellText(rowGroups, columnGroups, i, j);
if (cell != null)
{
JRCellContents contents = cell.getContents();
if (i < rowGroups.length)
{
JRCrosstabCell colCell = cells[rowGroups.length][j];
if (colCell != null && colCell.getContents().getWidth() != contents.getWidth())
{
addBrokenRule("Crosstab " + cellText + " width should be " + colCell.getContents().getWidth() + ".", cell);
}
}
if (j < columnGroups.length)
{
JRCrosstabCell rowCell = cells[i][columnGroups.length];
if (rowCell != null && rowCell.getContents().getHeight() != contents.getHeight())
{
addBrokenRule("Crosstab " + cellText + " height should be " + rowCell.getContents().getHeight() + ".", cell);
}
}
verifyCellContents(contents, cellText);
}
}
}
}
示例2: MGroupCell
import net.sf.jasperreports.crosstabs.JRCrosstabCell; //导入方法依赖的package包/类
public MGroupCell(ANode parent, JRCrosstabCell cell) {
super(parent, cell.getContents(), "");
this.cell = (JRDesignCrosstabCell)cell;
}
示例3: getAllCells
import net.sf.jasperreports.crosstabs.JRCrosstabCell; //导入方法依赖的package包/类
public static List<JRDesignCellContents> getAllCells(JRDesignCrosstab designCrosstab) {
List<JRDesignCellContents> list = new ArrayList<JRDesignCellContents>();
list.add((JRDesignCellContents) designCrosstab.getHeaderCell());
// Row cells
List<JRCrosstabCell> cells = designCrosstab.getCellsList();
for (JRCrosstabCell cell : cells) {
if (cell != null && (JRDesignCellContents) cell.getContents() != null) {
list.add((JRDesignCellContents) cell.getContents());
}
}
JRCrosstabRowGroup[] row_groups = designCrosstab.getRowGroups();
for (int i = 0; i < row_groups.length; ++i) {
switch (row_groups[i].getTotalPositionValue()) {
case START:
case END:
list.add((JRDesignCellContents) row_groups[i].getTotalHeader());
break;
default:
break;
}
list.add((JRDesignCellContents) row_groups[i].getHeader());
}
JRCrosstabColumnGroup[] col_groups = designCrosstab.getColumnGroups();
for (int i = 0; i < col_groups.length; ++i) {
switch (col_groups[i].getTotalPositionValue()) {
case START:
case END:
list.add((JRDesignCellContents) col_groups[i].getTotalHeader());
break;
default:
break;
}
list.add((JRDesignCellContents) col_groups[i].getHeader());
}
return list;
}
示例4: getAllCells
import net.sf.jasperreports.crosstabs.JRCrosstabCell; //导入方法依赖的package包/类
public static List<JRDesignCellContents> getAllCells(JRDesignCrosstab designCrosstab) {
List<JRDesignCellContents> list = new ArrayList<JRDesignCellContents>();
list.add( (JRDesignCellContents)designCrosstab.getHeaderCell() );
// Row cells
List cells = designCrosstab.getCellsList();
for (int i=0; i<cells.size(); ++i)
{
JRCrosstabCell cell = (JRCrosstabCell)cells.get(i);
if (cell != null && (JRDesignCellContents)cell.getContents() != null)
{
list.add( (JRDesignCellContents)cell.getContents() );
}
}
JRCrosstabRowGroup[] row_groups = designCrosstab.getRowGroups();
for (int i=0; i<row_groups.length; ++i)
{
switch (row_groups[i].getTotalPositionValue())
{
case START:
case END:
list.add( (JRDesignCellContents)row_groups[i].getTotalHeader());
break;
default: break;
}
list.add( (JRDesignCellContents)row_groups[i].getHeader());
}
JRCrosstabColumnGroup[] col_groups = designCrosstab.getColumnGroups();
for (int i=0; i<col_groups.length; ++i)
{
switch (col_groups[i].getTotalPositionValue())
{
case START:
case END:
list.add( (JRDesignCellContents)col_groups[i].getTotalHeader());
break;
default: break;
}
list.add( (JRDesignCellContents)col_groups[i].getHeader());
}
return list;
}