本文整理汇总了Java中net.sf.jasperreports.crosstabs.JRCrosstabRowGroup类的典型用法代码示例。如果您正苦于以下问题:Java JRCrosstabRowGroup类的具体用法?Java JRCrosstabRowGroup怎么用?Java JRCrosstabRowGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JRCrosstabRowGroup类属于net.sf.jasperreports.crosstabs包,在下文中一共展示了JRCrosstabRowGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeCrosstabRowGroup
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
protected void writeCrosstabRowGroup(JRCrosstabRowGroup group) throws IOException
{
writer.startElement(JRCrosstabRowGroupFactory.ELEMENT_rowGroup);
writer.addEncodedAttribute(JRCrosstabGroupFactory.ATTRIBUTE_name, group.getName());
writer.addAttribute(JRCrosstabRowGroupFactory.ATTRIBUTE_width, group.getWidth());
writer.addAttribute(JRCrosstabGroupFactory.ATTRIBUTE_totalPosition, group.getTotalPositionValue(), CrosstabTotalPositionEnum.NONE);
writer.addAttribute(JRCrosstabRowGroupFactory.ATTRIBUTE_headerPosition, group.getPositionValue(), CrosstabRowPositionEnum.TOP);
if (isNewerVersionOrEqual(JRConstants.VERSION_6_2_0))
{
writer.addAttribute(JRCrosstabGroupFactory.ATTRIBUTE_mergeHeaderCells, group.getMergeHeaderCells());
}
writeBucket(group.getBucket());
JRCellContents header = group.getHeader();
writer.startElement(JRCrosstabRowGroupFactory.ELEMENT_crosstabRowHeader);
writeCellContents(header);
writer.closeElement();
JRCellContents totalHeader = group.getTotalHeader();
writer.startElement(JRCrosstabRowGroupFactory.ELEMENT_crosstabTotalRowHeader);
writeCellContents(totalHeader);
writer.closeElement();
writer.closeElement();
}
示例2: JRDesignCrosstab
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
/**
* Creates a new crosstab.
*
* @param defaultStyleProvider default style provider
*/
public JRDesignCrosstab(JRDefaultStyleProvider defaultStyleProvider)
{
super(defaultStyleProvider);
parametersList = new ArrayList<JRCrosstabParameter>();
parametersMap = new HashMap<String, JRCrosstabParameter>();
rowGroupsMap = new HashMap<String, Integer>();
rowGroups = new ArrayList<JRCrosstabRowGroup>();
columnGroupsMap = new HashMap<String, Integer>();
columnGroups = new ArrayList<JRCrosstabColumnGroup>();
measuresMap = new HashMap<String, Integer>();
measures = new ArrayList<JRCrosstabMeasure>();
cellsMap = new HashMap<Pair<String,String>,JRCrosstabCell>();
cellsList = new ArrayList<JRCrosstabCell>();
addBuiltinParameters();
variablesList = new LinkedMap();
addBuiltinVariables();
dataset = new JRDesignCrosstabDataset();
lineBox = new JRBaseLineBox(this);
}
示例3: addColGroupVars
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
protected void addColGroupVars(JRDesignCrosstabColumnGroup colGroup)
{
addVariable(colGroup.getVariable());
for (Iterator<JRCrosstabMeasure> measureIt = measures.iterator(); measureIt.hasNext();)
{
JRCrosstabMeasure measure = measureIt.next();
addTotalVar(measure, null, colGroup);
for (Iterator<JRCrosstabRowGroup> rowIt = rowGroups.iterator(); rowIt.hasNext();)
{
JRCrosstabRowGroup rowGroup = rowIt.next();
addTotalVar(measure, rowGroup, colGroup);
}
}
}
示例4: getTotalVariableName
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public static String getTotalVariableName(JRCrosstabMeasure measure, JRCrosstabRowGroup rowGroup, JRCrosstabColumnGroup colGroup)
{
StringBuilder name = new StringBuilder();
name.append(measure.getName());
if (rowGroup != null)
{
name.append('_');
name.append(rowGroup.getName());
}
if (colGroup != null)
{
name.append('_');
name.append(colGroup.getName());
}
name.append("_ALL");
return name.toString();
}
示例5: removeRowGroupVars
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
protected void removeRowGroupVars(JRCrosstabRowGroup rowGroup)
{
removeVariable(rowGroup.getVariable());
for (Iterator<JRCrosstabMeasure> measureIt = measures.iterator(); measureIt.hasNext();)
{
JRCrosstabMeasure measure = measureIt.next();
removeTotalVar(measure, rowGroup, null);
for (Iterator<JRCrosstabColumnGroup> colIt = columnGroups.iterator(); colIt.hasNext();)
{
JRCrosstabColumnGroup colGroup = colIt.next();
removeTotalVar(measure, rowGroup, colGroup);
}
}
}
示例6: removeColGroupVars
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
protected void removeColGroupVars(JRCrosstabColumnGroup colGroup)
{
removeVariable(colGroup.getVariable());
for (Iterator<JRCrosstabMeasure> measureIt = measures.iterator(); measureIt.hasNext();)
{
JRCrosstabMeasure measure = measureIt.next();
removeTotalVar(measure, null, colGroup);
for (Iterator<JRCrosstabRowGroup> rowIt = rowGroups.iterator(); rowIt.hasNext();)
{
JRCrosstabRowGroup rowGroup = rowIt.next();
removeTotalVar(measure, rowGroup, colGroup);
}
}
}
示例7: prepareSorting
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public void prepareSorting()
{
if (dataPreSorted)
{
if (log.isDebugEnabled())
{
log.debug("crosstab " + crosstab.getUUID() + " has the presorted flag set, converting to order NONE");
}
((JRDesignCrosstabDataset) crosstab.getDataset()).setDataPreSorted(false);
JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
for (int i = 0; i < rowGroups.length; i++)
{
((JRDesignCrosstabBucket) rowGroups[i].getBucket()).setOrder(BucketOrder.NONE);
}
JRCrosstabColumnGroup[] colGroups = crosstab.getColumnGroups();
for (int i = 0; i < colGroups.length; i++)
{
((JRDesignCrosstabBucket) colGroups[i].getBucket()).setOrder(BucketOrder.NONE);
}
}
}
示例8: restore
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public void restore()
{
if (log.isDebugEnabled())
{
log.debug("restoring crosstab " + crosstab.getUUID() + " order attributes");
}
((JRDesignCrosstabDataset) crosstab.getDataset()).setDataPreSorted(dataPreSorted);
JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
for (int i = 0; i < rowGroups.length; i++)
{
((JRDesignCrosstabBucket) rowGroups[i].getBucket()).setOrder(rowGroupOrders[i]);
}
JRCrosstabColumnGroup[] colGroups = crosstab.getColumnGroups();
for (int i = 0; i < colGroups.length; i++)
{
((JRDesignCrosstabBucket) colGroups[i].getBucket()).setOrder(colGroupOrders[i]);
}
crosstab.getPropertiesMap().setProperty(JRFillCrosstab.PROPERTY_ORDER_BY_COLUMN, orderByColumnProp);
}
示例9: removeElements
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
private void removeElements(JRDesignElement element) {
com.jaspersoft.studio.model.command.CreateElementCommand.removeElement(jDesign, jrElement);
for (JRCrosstabCell c : crosstab.getCellsList()) {
com.jaspersoft.studio.model.command.CreateElementCommand.removeElement(element, c.getContents().getElements());
}
for (JRCrosstabRowGroup rg : crosstab.getRowGroupsList()) {
com.jaspersoft.studio.model.command.CreateElementCommand.removeElement(element, rg.getHeader().getElements());
if (rg.getTotalHeader() != null)
com.jaspersoft.studio.model.command.CreateElementCommand.removeElement(element, rg.getTotalHeader().getElements());
}
for (JRCrosstabColumnGroup rc : crosstab.getColumnGroupsList()) {
com.jaspersoft.studio.model.command.CreateElementCommand.removeElement(element, rc.getHeader().getElements());
if (rc.getTotalHeader() != null)
com.jaspersoft.studio.model.command.CreateElementCommand.removeElement(element, rc.getTotalHeader().getElements());
}
}
示例10: fillRowGroupV
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public Guide fillRowGroupV(Guide west, Guide east, JRDesignCrosstab crosstab) {
JRCrosstabRowGroup[] rows = crosstab.getRowGroups();
for (int i = 0; i < rows.length; i++) {
JRCrosstabRowGroup cg = rows[i];
CrosstabCell cc = null;
if (cg.hasTotal())
cc = addCell4ColTotal(west, east, cg);
cc = createCell((JRDesignCellContents) cg.getHeader(), JRCrosstabOrigin.TYPE_ROW_GROUP_HEADER);
west.addEast(cc);
Guide teast = null;
if (i == rows.length - 1)
teast = east;
else
teast = addNext(west, vGuides);
teast.addWest(cc);
teast.setX(west, cc.cell);
west = teast;
}
return east;
}
示例11: fillDetailsH
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public void fillDetailsH(Guide gnorth, JRDesignCrosstab crosstab) {
JRCrosstabCell[][] cells = crosstab.getCells();
if (cells != null)
for (int i = cells[0].length - 1; i >= 0; i--) {
Guide north = gnorth;
Guide south = hGuides.get(hGuides.size() - 1);
List<JRCrosstabRowGroup> rows = crosstab.getRowGroupsList();
for (int k = 0; k < rows.size(); k++) {
JRCrosstabRowGroup cg = rows.get(k);
boolean last = k == rows.size() - 1;
if (cg.getTotalPositionValue() == CrosstabTotalPositionEnum.END) {
Guide tnorth = hGuides.get(hGuides.indexOf(south) - 1);
addDetailCellH(cells, i, tnorth, south, cg.getName());
south = tnorth;
} else if (cg.getTotalPositionValue() == CrosstabTotalPositionEnum.START) {
Guide tsouth = hGuides.get(hGuides.indexOf(north) + 1);
addDetailCellH(cells, i, north, tsouth, cg.getName());
north = tsouth;
} else if (!last)
continue;
if (last)
addDetailCellH(cells, i, north, south, null);
}
}
}
示例12: getCrosstabDesignWidth
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public int getCrosstabDesignWidth()
{
JRCrosstabCell[][] cells = getCrosstab().getCells();
// Calculate the crosstab width...
int width = 0;
// 1. Add all the rows groups widths...
JRCrosstabRowGroup[] row_groups = getCrosstab().getRowGroups();
for (int i=0; i<row_groups.length; ++i)
{
width += row_groups[i].getWidth();
}
// 2. Sum the width of all the not null data cells ...
for (int i=0; i<cells[0].length; ++i)
{
width += ModelUtils.findColumnWidth(cells, i);
}
return width;
}
示例13: getCrosstabRowGroup
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
public JRBaseCrosstabRowGroup getCrosstabRowGroup(JRCrosstabRowGroup group)
{
JRBaseCrosstabRowGroup baseCrosstabRowGroup = null;
if (group != null)
{
baseCrosstabRowGroup = (JRBaseCrosstabRowGroup) get(group);
if (baseCrosstabRowGroup == null)
{
baseCrosstabRowGroup = new JRBaseCrosstabRowGroup(group, this);
}
}
return baseCrosstabRowGroup;
}
示例14: writeCrosstabRowGroup
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
/**
*
*/
protected void writeCrosstabRowGroup( JRCrosstabRowGroup group, String groupName)
{
if(group != null)
{
write( "JRDesignCrosstabRowGroup " + groupName + " = new JRDesignCrosstabRowGroup();\n");
write( groupName + ".setName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(group.getName()));
write( groupName + ".setWidth({0, number, #});\n", group.getWidth());
write( groupName + ".setTotalPosition({0});\n", group.getTotalPositionValue(), CrosstabTotalPositionEnum.NONE);
write( groupName + ".setPosition({0});\n", group.getPositionValue(), CrosstabRowPositionEnum.TOP);
writeBucket( group.getBucket(), groupName);
JRCellContents header = group.getHeader();
if(header != null)
{
writeCellContents( header, groupName + "HeaderContents");
write( groupName + ".setHeader(" + groupName + "HeaderContents);\n");
}
JRCellContents totalHeader = group.getTotalHeader();
if(totalHeader != null)
{
writeCellContents( totalHeader, groupName + "TotalHeaderContents");
write( groupName + ".setTotalHeader(" + groupName + "TotalHeaderContents);\n");
}
flush();
}
}
示例15: getCrosstabCellText
import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup; //导入依赖的package包/类
private String getCrosstabCellText(JRCrosstabRowGroup[] rowGroups, JRCrosstabColumnGroup[] columnGroups,
int rowIndex, int columnIndex)
{
String text;
if (rowIndex == rowGroups.length)
{
if (columnIndex == columnGroups.length)
{
text = "cell";
}
else
{
text = columnGroups[columnIndex].getName() + " total cell";
}
}
else
{
if (columnIndex == columnGroups.length)
{
text = rowGroups[rowIndex].getName() + " total cell";
}
else
{
text = rowGroups[rowIndex].getName() + "," + columnGroups[columnIndex].getName() + " total cell";
}
}
return text;
}