Examples of JRDesignBand


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

        applyStyleToElement(sr.getStyle(), subreport);

      //adding to the band
      if (sr.isStartInNewPage()) {
        JRDesignGroup jrgroup = getJRGroupFromDJGroup(columnsGroup);
        JRDesignBand targetBand = null;
        int idx = getDesign().getGroupsList().indexOf(jrgroup);
        if (DJConstants.HEADER.equals(position)) {
//          if (idx == 0){
//            if (getDesign().getColumnHeader() != null)
//              targetBand = (JRDesignBand) getDesign().getColumnHeader();
//            else if (getDesign().getPageHeader() != null)
//              targetBand = (JRDesignBand) getDesign().getPageHeader();
//            else
//              targetBand = band;
//          }
//          else
//            targetBand = (JRDesignBand) ((JRDesignGroup) getDesign().getGroupsList().get(idx-1)).getGroupHeader();
        }
        else { //footer subreport (and concatenated report)
          if (idx+1 <  getDesign().getGroupsList().size())
            idx++;
          targetBand = (JRDesignBand) ((JRDesignGroup) getDesign().getGroupsList().get(idx)).getGroupFooter();
        }

        /**
         * There is no meaning in adding a page-break in header sub reports since
         * they will be placed right after the group header
         */
        if (DJConstants.FOOTER.equals(position)){
          JRDesignBreak pageBreak = new JRDesignBreak(new JRDesignStyle().getDefaultStyleProvider());
          pageBreak.setKey(PAGE_BREAK_FOR_ + jrgroup.toString()); //set up a name to recognize the item later
          pageBreak.setY(0);
          targetBand.addElement(pageBreak);
        }

      }
      band.addElement(subreport);
     
View Full Code Here

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

   * @param JRDesignGroup jgroup
   * @throws LayoutException
   */
  protected void layoutGroupVariables(DJGroup group, JRDesignGroup jgroup) {
    log.debug("Starting groups variables layout...");
    JRDesignBand headerBand = (JRDesignBand) jgroup.getGroupHeader();
    JRDesignBand footerBand = (JRDesignBand) jgroup.getGroupFooter();

//    int headerOffset = changeHeaderBandHeightForVariables(headerBand, group);
    int headerOffset = 0;

    //Show the current value above the column name
View Full Code Here

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

    return result;
  }

  protected void generateHeaderBand() {
    log.debug("generating header band...");
    JRDesignBand header = (JRDesignBand) getDesign().getColumnHeader();
    if (header == null) {
      header = new JRDesignBand();
      getDesign().setColumnHeader(header);
    }


    /**
 
View Full Code Here

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

    }
  }

  protected void generateHeaderBand() {
    log.debug("generating header band...");
    JRDesignBand header = (JRDesignBand) getDesign().getColumnHeader();
    if (header == null) {
      header = new JRDesignBand();
      getDesign().setColumnHeader(header);
    }
//    if (!DynamicJasperHelper.existsGroupWithColumnNames(getReport().getColumnsGroups()))
      generateHeaderBand(header);
  }
View Full Code Here

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

    if (getReport().getAutoTexts() == null)
      return;
    /**
     * Apply the autotext in footer if any
     */
    JRDesignBand headerband = (JRDesignBand) getDesign().getPageHeader();
    if (headerband == null ) {
      headerband = new JRDesignBand();
      getDesign().setPageHeader(headerband);
    }

    ArrayList positions = new ArrayList();
    positions.add(HorizontalBandAlignment.LEFT);
View Full Code Here

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

  protected void applyFooterAutotexts() {
    if (getReport().getAutoTexts() == null)
      return;

    JRDesignBand footerband = (JRDesignBand) getDesign().getPageFooter();
    if (footerband == null ) {
      footerband = new JRDesignBand();
      getDesign().setPageFooter(footerband);
    }

    ArrayList positions = new ArrayList();
    positions.add(HorizontalBandAlignment.LEFT);
View Full Code Here

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

   */
  protected void applyBanners() {
    /**
     * First create image banners for the first page only
     */
    JRDesignBand title = (JRDesignBand) getDesign().getTitle();
    //if there is no title band, but there are banner images for the first page, we create a title band
    if (title == null && !getReport().getOptions().getFirstPageImageBanners().isEmpty()){
      title = new JRDesignBand();
      getDesign().setTitle(title);
    }
    applyImageBannersToBand(title,getReport().getOptions().getFirstPageImageBanners().values(),null);

    /**
     * Now create image banner for the rest of the pages
     */
    JRDesignBand pageHeader = (JRDesignBand) getDesign().getPageHeader();
    //if there is no title band, but there are banner images for the first page, we create a title band
    if (pageHeader == null && !getReport().getOptions().getImageBanners().isEmpty()){
      pageHeader = new JRDesignBand();
      getDesign().setPageHeader(pageHeader);
    }
    JRDesignExpression printWhenExpression = null;
    if (!getReport().getOptions().getFirstPageImageBanners().isEmpty()){
      printWhenExpression = new JRDesignExpression();
View Full Code Here

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

    } else {
      group.setName( "group["+groupIndex+"]_for_column_" + columnIndex + "-" +  column.getTitle());
    }

    group.setCountVariable(new JRDesignVariable());
    group.setGroupFooter(new JRDesignBand());
    group.setGroupHeader(new JRDesignBand());

    JRDesignExpression jrExpression = new JRDesignExpression();
    jrExpression.setText(column.getTextForExpression());
    jrExpression.setValueClassName(column.getValueClassNameForExpression());
View Full Code Here

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

    des.setWhenResourceMissingType(dr.getWhenResourceMissing());

    des.setTitleNewPage(false);
    des.setSummaryNewPage(false);

    des.setDetail(new JRDesignBand());

    des.getDetail().setSplitAllowed(dr.isAllowDetailSplit());

    des.setPageHeader(new JRDesignBand());
    des.setPageFooter(new JRDesignBand());
    des.setSummary(new JRDesignBand());

    des.setTitleNewPage(options.isTitleNewPage());

    des.setIgnorePagination(options.isIgnorePagination());
View Full Code Here

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

    log.debug("setting up WHEN NO DATA band");
    String whenNoDataText = getReport().getWhenNoDataText();
    Style style = getReport().getWhenNoDataStyle();
    if (whenNoDataText == null || "".equals(whenNoDataText))
      return;
    JRDesignBand band = new JRDesignBand();
    getDesign().setNoData(band);

    JRDesignTextField text = new JRDesignTextField();
    JRDesignExpression expression = ExpressionUtils.createStringExpression("\""+whenNoDataText+"\"");
    text.setExpression(expression);

    if (style == null){
      style = getReport().getOptions().getDefaultDetailStyle();
    }

    if (getReport().isWhenNoDataShowTitle())
      LayoutUtils.copyBandElements(band, getDesign().getPageHeader());
    if (getReport().isWhenNoDataShowColumnHeader())
      LayoutUtils.copyBandElements(band, getDesign().getColumnHeader());

    int offset = LayoutUtils.findVerticalOffset(band);
    text.setY(offset);
    applyStyleToElement(style, text);
    text.setWidth(getReport().getOptions().getPrintableWidth());
    text.setHeight(50);
    band.addElement(text);
    log.debug("OK setting up WHEN NO DATA band");

  }
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.