当前位置: 首页>>代码示例>>Java>>正文


Java JRCrosstabCell.getContents方法代码示例

本文整理汇总了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);
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:53,代码来源:JRVerifier.java

示例2: MGroupCell

import net.sf.jasperreports.crosstabs.JRCrosstabCell; //导入方法依赖的package包/类
public MGroupCell(ANode parent, JRCrosstabCell cell) {
	super(parent, cell.getContents(), "");
	this.cell = (JRDesignCrosstabCell)cell;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:5,代码来源:MGroupCell.java

示例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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:42,代码来源:ModelUtils.java

示例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;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:48,代码来源:ModelUtils.java


注:本文中的net.sf.jasperreports.crosstabs.JRCrosstabCell.getContents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。