當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。