Package net.sf.jasperreports.engine.design

Examples of net.sf.jasperreports.engine.design.JRDesignSection


    element.setWidth(scaledWidth);
  }
 
  protected JRSection wrapBand(JRBand band, JROrigin origin)
  {
    JRDesignSection section = new JRDesignSection(origin);
    section.addBand(band);
    return section;
  }
View Full Code Here


    {
      return null;
    }
   
    JROrigin origin = new JROrigin(null, getName(), bandType);
    JRDesignSection section = new JRDesignSection(origin);
    section.addBand(band);
    return section;
  }
View Full Code Here

            final Input input,
            final Map<String, Class<?>> columns) throws JRException, ClassNotFoundException, IOException {
        byte[] bytes = input.template.getConfiguration().loadFile(this.jasperTemplate);
        final JasperDesign templateDesign = JRXmlLoader.load(new ByteArrayInputStream(bytes));
        int headerHeight = templateDesign.getColumnHeader().getHeight();
        final JRDesignSection detailSection = (JRDesignSection) templateDesign.getDetailSection();
        int detailHeight = detailSection.getBands()[0].getHeight();

        final JRElement sampleHeaderEl = templateDesign.getColumnHeader().getElements()[0];
        int headerPosX = sampleHeaderEl.getX();
        int headerPosY = sampleHeaderEl.getY();
        final JRElement sampleDetailEl = detailSection.getBands()[0].getElements()[0];
        int detailPosX = sampleDetailEl.getX();
        int detailPosY = sampleDetailEl.getY();
        clearFields(templateDesign);
        removeDetailBand(templateDesign);
        JRDesignBand headerBand = new JRDesignBand();
        headerBand.setHeight(headerHeight);
        templateDesign.setColumnHeader(headerBand);

        JRDesignBand detailBand = new JRDesignBand();
        detailBand.setHeight(detailHeight);
        detailSection.addBand(detailBand);

        final int columnWidth;
        final int numColumns = columns.size();
        if (columns.isEmpty()) {
            columnWidth = templateDesign.getPageWidth();
View Full Code Here

        designElement.setStyle(columnDetailStyle);
        detailBand.addElement(designElement);
    }

    private void removeDetailBand(final JasperDesign templateDesign) {
        final JRDesignSection detailSection = (JRDesignSection) templateDesign.getDetailSection();
        final List<JRBand> bandsList = Lists.newArrayList(detailSection.getBandsList());
        for (JRBand jrBand : bandsList) {
            detailSection.removeBand(jrBand);
        }
    }
View Full Code Here

                } else if (templateDesign.getColumnHeader().getElements().length == 0) {
                        validationErrors.add(new ConfigurationException(
                                "column header band must have at least one element defined for to height and positioning information"));
                }

                final JRDesignSection detailSection = (JRDesignSection) templateDesign.getDetailSection();
                if (detailSection.getBands().length == 0) {
                    validationErrors.add(new ConfigurationException(
                            "JasperTemplate must have a detail band defined for height and positioning information"));
                } else if (detailSection.getBands()[0].getElements().length == 0) {
                    validationErrors.add(new ConfigurationException(
                            "detail band must have at least one element defined for to height and positioning information"));
                }

                checkStyleExists(validationErrors, stylesMap, this.firstDetailStyle);
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.design.JRDesignSection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.