當前位置: 首頁>>代碼示例>>Java>>正文


Java JRCrosstabCell.getHeight方法代碼示例

本文整理匯總了Java中net.sf.jasperreports.crosstabs.JRCrosstabCell.getHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java JRCrosstabCell.getHeight方法的具體用法?Java JRCrosstabCell.getHeight怎麽用?Java JRCrosstabCell.getHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.sf.jasperreports.crosstabs.JRCrosstabCell的用法示例。


在下文中一共展示了JRCrosstabCell.getHeight方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDetailCells

import net.sf.jasperreports.crosstabs.JRCrosstabCell; //導入方法依賴的package包/類
private void createDetailCells(JRDesignCrosstab jdc) {
	List<JRCrosstabCell> cells = jdc.getCellsList();
	JRCrosstabMeasure[] measures = jdc.getMeasures();
	if (measures != null && cells != null)
		for (JRCrosstabCell c : cells) {
			int y = 0;
			if (c.getHeight() != null && measures.length > 0) {
				int h = c.getHeight() / measures.length;
				for (int i = 0; i < measures.length; i++) {
					JRDesignExpression exp = new JRDesignExpression();
					exp.setText("$V{" + measures[i].getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$

					JRDesignTextField tf = (JRDesignTextField) new MTextField()
							.createJRElement(getConfig().getJasperDesign());
					tf.setX(0);
					tf.setY(y);
					tf.setWidth(c.getWidth());
					tf.setHeight(h);
					tf.setExpression(exp);
					((JRDesignCellContents) c.getContents()).addElement(tf);
					y += h;
				}
			}
		}
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:26,代碼來源:CrosstabWizard.java

示例2: JRBaseCrosstabCell

import net.sf.jasperreports.crosstabs.JRCrosstabCell; //導入方法依賴的package包/類
public JRBaseCrosstabCell(JRCrosstabCell crosstabCell, JRBaseObjectFactory factory)
{
	factory.put(crosstabCell, this);
	
	width = crosstabCell.getWidth();
	height = crosstabCell.getHeight();
	
	rowTotalGroup = crosstabCell.getRowTotalGroup();
	columnTotalGroup = crosstabCell.getColumnTotalGroup();
	
	contents = factory.getCell(crosstabCell.getContents());
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:13,代碼來源:JRBaseCrosstabCell.java

示例3: 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


注:本文中的net.sf.jasperreports.crosstabs.JRCrosstabCell.getHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。