Examples of JRDesignSection


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

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

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

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

            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

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

        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

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

                } 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
Copyright © 2018 www.massapi.com. 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.