Java 类net.sf.jasperreports.engine.JRSection 实例源码

项目:jasperreports    文件:JRBaseObjectFactory.java   
/**
 *
 */
protected JRBaseSection getSection(JRSection section)
{
    JRBaseSection baseSection = null;

    if (section != null)
    {
        baseSection = (JRBaseSection)get(section);
        if (baseSection == null)
        {
            baseSection = new JRBaseSection(section, this);
        }
    }

    return baseSection;
}
项目:jasperreports    文件:FillParts.java   
public FillParts(JRSection section, JRFillObjectFactory fillFactory)
{
    JRPart[] sectionParts = section == null ? null : section.getParts();
    if (sectionParts == null || sectionParts.length == 0)
    {
        parts = Collections.emptyList();
    }
    else
    {
        parts = new ArrayList<FillPart>(sectionParts.length);
        for (JRPart part : sectionParts)
        {
            FillPart fillPart = new FillPart(part, fillFactory);
            parts.add(fillPart);
        }
    }
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
protected void writeSection( JRSection section, String sectionName, String sectionBandListGetterName)
{
    if (section != null)
    {
        JRBand[] bands = section.getBands();
        if (bands != null && bands.length > 0)
        {
            write( "//" + sectionName + "\n\n");
            for(int i = 0; i < bands.length; i++)
            {
                writeBand( bands[i], sectionName + i);
                write( sectionBandListGetterName + ".add(" + i + ", " + sectionName + i + ");\n\n");
            }
        }
        flush();
    }
}
项目:jasperreports    文件:JRFillObjectFactory.java   
/**
 *
 */
protected JRFillSection getSection(JRSection section)
{
    JRFillSection fillSection = null;

    if (section == null)
    {
        fillSection = filler.missingFillSection;
    }
    else
    {
        fillSection = (JRFillSection)get(section);
        if (fillSection == null)
        {
            fillSection = new JRFillSection(filler, section, this);
        }
    }

    return fillSection;
}
项目:jasperreports    文件:JRBaseReport.java   
/**
 *
 */
private void addBands(JRSection section, List<JRBand> bands)
{
    if (section != null)
    {
        JRBand[] sectionBands = section.getBands();
        if (sectionBands != null)
        {
            for (JRBand band : sectionBands)
            {
                addBand(band, bands);
            }
        }
    }
}
项目:jasperreports    文件:JRBaseSection.java   
/**
 *
 */
protected JRBaseSection(JRSection section, JRBaseObjectFactory factory)
{
    factory.put(section, this);

    /*   */
    JRBand[] jrBands = section.getBands();
    if (jrBands != null && jrBands.length > 0)
    {
        bands = new JRBand[jrBands.length];
        for(int i = 0; i < jrBands.length; i++)
        {
            bands[i] = factory.getBand(jrBands[i]);
        }
    }

    /*   */
    JRPart[] jrParts = section.getParts();
    if (jrParts != null && jrParts.length > 0)
    {
        parts = new JRPart[jrParts.length];
        for(int i = 0; i < jrParts.length; i++)
        {
            parts[i] = factory.getPart(jrParts[i]);
        }
    }
}
项目:jasperreports    文件:ReportConverter.java   
/**
 *
 */
private void addSection(JRSection section, boolean isColumnSection)
{
    if (section != null)
    {
        JRBand[] bands = section.getBands();
        if (bands != null && bands.length > 0)
        {
            for(int i = 0; i< bands.length; i++)
            {
                addBand(bands[i], isColumnSection);
            }
        }
    }
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
protected void writeSection(JRSection section) throws IOException
{
    if (section != null)
    {
        JRBand[] bands = section.getBands();
        if (bands != null && bands.length > 0)
        {
            if(isNewerVersionOrEqual(JRConstants.VERSION_3_5_2))
            {
                for(int i = 0; i < bands.length; i++)
                {
                    writeBand(bands[i]);
                }
            }
            else
            {
                writeBand(bands[0]);
            }
        }

        if (isNewerVersionOrEqual(JRConstants.VERSION_6_0_0))
        {
            JRPart[] parts = section.getParts();
            if (parts != null && parts.length > 0)
            {
                for(int i = 0; i < parts.length; i++)
                {
                    writePart(parts[i]);
                }
            }
        }
    }
}
项目:jasperreports    文件:JRElementsVisitor.java   
protected void visitSection(JRSection section)
{
    if (section != null)
    {
        JRBand[] bands = section.getBands();
        if (bands != null)
        {
            for(int i = 0; i < bands.length; i++)
            {
                visitBand(bands[i]);
            }
        }
    }
}
项目:jasperreports    文件:JRVerifier.java   
/**
 *
 */
private void verifySection(JRSection section)
{
    if (section != null)
    {
        JRBand[] bands = section.getBands();
        if (bands != null && bands.length > 0)
        {
            if (sectionType == SectionTypeEnum.PART)
            {
                addBrokenRule("Part reports cannot contain bands", section);
            }
            else
            {
                for(int i = 0; i< bands.length; i++)
                {
                    verifyBand(bands[i]);
                }
            }
        }

        JRPart[] parts = section.getParts();
        if (parts != null && parts.length > 0)
        {
            if (sectionType == SectionTypeEnum.BAND)
            {
                addBrokenRule("Band reports cannot contain parts", section);
            }
            else
            {
                for (int i = 0; i < parts.length; i++)
                {
                    verifyPart(parts[i]);
                }
            }
        }
    }
}
项目:jasperreports    文件:JRDesignGroup.java   
protected void setSectionOrigin(JRSection section, BandTypeEnum type)
{
    if (section instanceof JRDesignSection)
    {
        JROrigin origin = new JROrigin(null, getName(), type);
        ((JRDesignSection) section).setOrigin(origin);
    }
}
项目:jasperreports    文件:JasperDesign.java   
protected void setSectionOrigin(JRSection section, BandTypeEnum type)
{
    if (section instanceof JRDesignSection)
    {
        JROrigin origin = new JROrigin(type);
        ((JRDesignSection) section).setOrigin(origin);
    }
}
项目:jasperreports    文件:JRFillSection.java   
/**
 *
 */
protected JRFillSection(
    JRBaseFiller filler,
    JRSection section,
    JRFillObjectFactory factory
    )
{
    if (section != null)
    {
        factory.put(section, this);

        isEmpty = true;
        areAllPrintWhenExprNull = true;

        JRBand[] jrBands = section.getBands();
        if (jrBands != null && jrBands.length > 0)
        {
            bands = new JRFillBand[jrBands.length];
            for (int i = 0; i < jrBands.length; i++)
            {
                bands[i] = factory.getBand(jrBands[i]);
                isEmpty = isEmpty && bands[i].isEmpty();
                areAllPrintWhenExprNull = areAllPrintWhenExprNull && bands[i].isPrintWhenExpressionNull();
            }
        }
        else
        {
            // use a single missing band for empty sections
            bands = new JRFillBand[]{filler.missingFillBand};
        }
    }
    else
    {
        // use a single missing band for null/missing sections
        bands = new JRFillBand[]{filler.missingFillBand};
    }

    this.filler = filler;
}
项目:jasperreports    文件:TableReportGroup.java   
protected JRSection wrapBand(JRBand band, BandTypeEnum bandType)
{
    if (band == null)
    {
        return null;
    }

    JROrigin origin = new JROrigin(null, getName(), bandType);
    JRDesignSection section = new JRDesignSection(origin);
    section.addBand(band);
    return section;
}
项目:PDFReporter-Studio    文件:ModelUtils.java   
/**
 * Return the index of band in the section. It return -1 if the band is not found in this section
 * 
 * @param section
 *          the section
 * @param band
 *          the band
 * @return the band index
 */
public static int getBandIndex(JRSection section, JRBand band) {
    JRBand[] bands = section.getBands();
    for (int i = 0; bands != null && i < bands.length; ++i) {
        if (bands[i] == band)
            return i;
    }
    return -1;

}
项目:ireport-fork    文件:ModelUtils.java   
/**
 * Return the index of band in the section.
 * It return -1 if the band is not found in this section
 *
 * @param section
 * @param band
 * @return
 */
public static int getBandIndex(JRSection section, JRBand band)
{
    JRBand[] bands = section.getBands();
    for (int i=0;bands != null && i<bands.length; ++i)
    {
        if (bands[i] == band) return i;
    }
    return -1;

}
项目:TechnologyReadinessTool    文件:ReportExportPdf.java   
public void adjustTextMarkup(JasperReport jr) {
    JRSection detailSection = jr.getDetailSection();
    for (JRBand band : detailSection.getBands()) {
        if (band.getElements().length > 0) {
            JRBaseTextField text = (JRBaseTextField) band.getElements()[0];
            text.setBold(true);
            for (JRElement element : band.getElements()) {
                JRBaseTextField column = (JRBaseTextField) element;
                column.setMarkup(JRCommonText.MARKUP_HTML);
            }
        }
    }
}
项目:jasperreports    文件:JRBaseReport.java   
@Override
public JRSection getDetailSection()
{
    return detailSection;
}
项目:jasperreports    文件:JRBaseGroup.java   
@Override
public JRSection getGroupHeaderSection()
{
    return this.groupHeaderSection;
}
项目:jasperreports    文件:JRBaseGroup.java   
@Override
public JRSection getGroupFooterSection()
{
    return this.groupFooterSection;
}
项目:jasperreports    文件:JRSectionFactory.java   
@Override
public JRSection getSection()
{
    return ((JasperDesign)digester.peek(digester.getCount() - 2)).getDetailSection();
}
项目:jasperreports    文件:JRSectionFactory.java   
@Override
public JRSection getSection()
{
    return ((JRDesignGroup)digester.peek()).getGroupHeaderSection();
}
项目:jasperreports    文件:JRSectionFactory.java   
@Override
public JRSection getSection()
{
    return ((JRDesignGroup)digester.peek()).getGroupFooterSection();
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
private void writeGroup(JRGroup group) throws IOException
{
    writer.startElement(JRXmlConstants.ELEMENT_group);
    writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, group.getName());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isStartNewColumn, group.isStartNewColumn(), false);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isStartNewPage, group.isStartNewPage(), false);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isResetPageNumber, group.isResetPageNumber(), false);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isReprintHeaderOnEachPage, group.isReprintHeaderOnEachPage(), false);
    if (isNewerVersionOrEqual(JRConstants.VERSION_6_5_1))
    {
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_isReprintHeaderOnEachColumn, group.isReprintHeaderOnEachColumn(), false);
    }
    writer.addAttributePositive(JRXmlConstants.ATTRIBUTE_minHeightToStartNewPage, group.getMinHeightToStartNewPage());
    if (isNewerVersionOrEqual(JRConstants.VERSION_6_4_3))
    {
        writer.addAttributePositive(JRXmlConstants.ATTRIBUTE_minDetailsToStartFromTop, group.getMinDetailsToStartFromTop());
    }
    if (isNewerVersionOrEqual(JRConstants.VERSION_3_6_2))
    {
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_footerPosition, group.getFooterPositionValue(), FooterPositionEnum.NORMAL);
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_keepTogether, group.isKeepTogether(), false);
    }
    if (isNewerVersionOrEqual(JRConstants.VERSION_6_4_3))
    {
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_preventOrphanFooter, group.isPreventOrphanFooter(), false);
    }

    writeExpression(JRXmlConstants.ELEMENT_groupExpression, group.getExpression(), false);

    JRSection groupHeader = group.getGroupHeaderSection();
    if (groupHeader != null)
    {
        writer.startElement(JRXmlConstants.ELEMENT_groupHeader);
        writeSection(groupHeader);
        writer.closeElement(true);
    }

    JRSection groupFooter = group.getGroupFooterSection();
    if (groupFooter != null)
    {
        writer.startElement(JRXmlConstants.ELEMENT_groupFooter);
        writeSection(groupFooter);
        writer.closeElement(true);
    }

    writer.closeElement();
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
private void writeGroup( JRGroup group)
{
    String groupName = group.getName();

    groupsMap.put(groupName, groupName);

    write( "JRDesignGroup " + groupName + " = new JRDesignGroup();\n");
    write( groupName + ".setName(\"" + JRStringUtil.escapeJavaStringLiteral(groupName) + "\");\n");
    write( groupName + ".setStartNewColumn({0});\n", group.isStartNewColumn(), false);
    write( groupName + ".setStartNewPage({0});\n", group.isStartNewPage(), false);
    write( groupName + ".setReprintHeaderOnEachPage({0});\n", group.isReprintHeaderOnEachPage(), false);
    write( groupName + ".setReprintHeaderOnEachColumn({0});\n", group.isReprintHeaderOnEachColumn(), false);
    write( groupName + ".setMinHeightToStartNewPage({0});\n", group.getMinHeightToStartNewPage());
    write( groupName + ".setMinDetailsToStartFromTop({0});\n", group.getMinDetailsToStartFromTop());
    write( groupName + ".setFooterPosition({0});\n", group.getFooterPositionValue(), FooterPositionEnum.NORMAL);

    write( groupName + ".setKeepTogether({0});\n", group.isKeepTogether(), false);
    write( groupName + ".setPreventOrphanFooter({0});\n", group.isPreventOrphanFooter(), false);

    writeExpression( group.getExpression(), groupName, "Expression");

    JRSection groupHeader = group.getGroupHeaderSection();
    if (groupHeader != null)
    {
        writeSection(
                groupHeader, 
                groupName+"Header", 
                "((JRDesignSection)" + groupName + ".getGroupHeaderSection()).getBandsList()"
                );
    }

    JRSection groupFooter = group.getGroupFooterSection();
    if (groupFooter != null)
    {
        writeSection(
                groupFooter, 
                groupName+"Footer", 
                "((JRDesignSection)" + groupName + ".getGroupFooterSection()).getBandsList()"
                );
    }

    flush();
}
项目:jasperreports    文件:JRFillGroup.java   
@Override
public JRSection getGroupHeaderSection()
{
    return groupHeaderSection;
}
项目:jasperreports    文件:JRFillGroup.java   
@Override
public JRSection getGroupFooterSection()
{
    return groupFooterSection;
}
项目:jasperreports    文件:FillListDatasetFactory.java   
@Override
protected JRFillSection getSection(JRSection section)
{
    //avoid creating subdataset group sections
    return super.getSection(null);
}
项目:jasperreports    文件:TableReportGroup.java   
@Override
public JRSection getGroupFooterSection()
{
    return footerSection;
}
项目:jasperreports    文件:TableReportGroup.java   
@Override
public JRSection getGroupHeaderSection()
{
    return headerSection;
}
项目:jasperreports    文件:TableReport.java   
protected JRSection wrapBand(JRBand band, JROrigin origin)
{
    JRDesignSection section = new JRDesignSection(origin);
    section.addBand(band);
    return section;
}
项目:jasperreports    文件:TableReport.java   
@Override
public JRSection getDetailSection()
{
    return detail;
}
项目:PDFReporter-Studio    文件:MBandGroupHeader.java   
@Override
public JRSection getSection(){
    return getJrGroup().getGroupHeaderSection();
}
项目:PDFReporter-Studio    文件:MBandGroupFooter.java   
@Override
public JRSection getSection(){
    return getJrGroup().getGroupFooterSection();
}
项目:jasperreports    文件:JRSectionFactory.java   
/**
 *
 */
public abstract JRSection getSection();
项目:PDFReporter-Studio    文件:MBandGroup.java   
/**
 * Return the JRSection of the actual band
 * 
 * @return a JRSection
 */
public abstract JRSection getSection();