Package net.sf.jasperreports.engine.design

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


    des.setWhenResourceMissingType(dr.getWhenResourceMissing());
   
    des.setTitleNewPage(false);
    des.setSummaryNewPage(false);

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

    des.setTitleNewPage(options.isTitleNewPage());

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


    }
  }

  private 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

    addFieldValue(columnVO);
    px += columnVO.getWidth();
  }

  private void addFieldHeader(GridColumnVO columnVO) {
    JRDesignBand bHeader = (JRDesignBand) jasperDesign.getColumnHeader();
    JRDesignStaticText text = new JRDesignStaticText();
    text.setText(columnVO.getTitle());
    text.setWidth(columnVO.getWidth());
    text.setHeight(bHeader.getHeight());
    text.setX(px);
    // Set syle
    text.setFontName(gridReportVO.getHeaderBandStyle().getFontName());
    text.setFontSize(gridReportVO.getHeaderBandStyle().getFontSize());
    text.setForecolor(gridReportVO.getHeaderBandStyle().getForeColor());
    text.setBold(gridReportVO.getHeaderBandStyle().isBold());
    text.setItalic(gridReportVO.getHeaderBandStyle().isItalic());
    text.setUnderline(gridReportVO.getHeaderBandStyle().isUnderline());
    if (log4j.isDebugEnabled())
      log4j.debug("Field Header, field: " + columnVO.getTitle() + " Width: " + columnVO.getWidth()
          + " X: " + px);
    bHeader.addElement(text);
  }
View Full Code Here

          + " X: " + px);
    bHeader.addElement(text);
  }

  private void addFieldValue(GridColumnVO columnVO) throws JRException {
    JRDesignBand bDetalle = (JRDesignBand) jasperDesign.getDetail();

    JRDesignField f = new JRDesignField();
    f.setName(columnVO.getDbName());
    f.setValueClass(columnVO.getFieldClass());
    jasperDesign.addField(f);

    JRDesignExpressionChunk chunk = new JRDesignExpressionChunk();
    chunk.setText(columnVO.getDbName());
    chunk.setType(JRDesignExpressionChunk.TYPE_FIELD);
    JRDesignExpression expression = new JRDesignExpression();
    expression.addChunk(chunk);
    expression.setValueClass(columnVO.getFieldClass());
    JRDesignTextField textField = new JRDesignTextField();
    textField.setWidth(columnVO.getWidth());
    textField.setHeight(bDetalle.getHeight());
    textField.setX(px);
    textField.setExpression(expression);
    textField.setBlankWhenNull(true);
    textField.setFontName(gridReportVO.getDetailBandStyle().getFontName());
    textField.setFontSize(gridReportVO.getDetailBandStyle().getFontSize());
    textField.setForecolor(gridReportVO.getDetailBandStyle().getForeColor());
    textField.setBold(gridReportVO.getDetailBandStyle().isBold());
    textField.setItalic(gridReportVO.getDetailBandStyle().isItalic());
    textField.setUnderline(gridReportVO.getDetailBandStyle().isUnderline());
    textField.setStretchWithOverflow(true);
    textField.setStretchType(JRElement.STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT);

    bDetalle.addElement(textField);
  }
View Full Code Here

      addField((GridColumnVO) it.next());
    }
  }

  private void defineTitle(String title) throws JRException {
    JRDesignBand bTitulo = (JRDesignBand) jasperDesign.getTitle();
    JRDesignStaticText text = (JRDesignStaticText) bTitulo.getElementByKey("staticTitle");
    text.setText(title);
  }
View Full Code Here

    JRDesignStaticText text = (JRDesignStaticText) bTitulo.getElementByKey("staticTitle");
    text.setText(title);
  }

  private void defineLineWidth() throws JRException {
    JRDesignBand bTitulo = (JRDesignBand) jasperDesign.getTitle();
    JRDesignLine line = (JRDesignLine) bTitulo.getElementByKey("title-top-line");
    line.setWidth(this.pageWidth);
    line = (JRDesignLine) bTitulo.getElementByKey("title-bottom-line");
    line.setWidth(this.pageWidth);
    bTitulo = (JRDesignBand) jasperDesign.getColumnHeader();
    line = (JRDesignLine) bTitulo.getElementByKey("columnHeader-top-line");
    line.setWidth(this.pageWidth);
    line = (JRDesignLine) bTitulo.getElementByKey("columnHeader-bottom-line");
    line.setWidth(this.pageWidth);
    bTitulo = (JRDesignBand) jasperDesign.getPageFooter();
    line = (JRDesignLine) bTitulo.getElementByKey("pageFooter-top-line");
    line.setWidth(this.pageWidth);
  }
View Full Code Here

    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

    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

  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

   */
  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

TOP

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

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.