Package net.sf.jasperreports.engine.design

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


   */
  public Object createObject(Attributes atts)
  {
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

    JRDesignLine line = new JRDesignLine(jasperDesign);

    LineDirectionEnum direction = LineDirectionEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_direction));
    if (direction != null)
    {
      line.setDirection(direction);
    }

    return line;
  }
View Full Code Here


    expression = new JRDesignExpression();
    expression.setValueClass(java.lang.String.class);
    expression.setText("\"  \" + String.valueOf($V{CityNumber}) + \". \" + String.valueOf($F{City})");
    textField.setExpression(expression);
    band.addElement(textField);
    JRDesignLine line = new JRDesignLine();
    line.setX(0);
    line.setY(19);
    line.setWidth(515);
    line.setHeight(0);
    band.addElement(line);
    ((JRDesignSection)group.getGroupHeaderSection()).addBand(band);

    band = new JRDesignBand();
    band.setHeight(20);
    line = new JRDesignLine();
    line.setX(0);
    line.setY(-1);
    line.setWidth(515);
    line.setHeight(0);
    band.addElement(line);
    JRDesignStaticText staticText = new JRDesignStaticText();
    staticText.setX(400);
    staticText.setY(0);
    staticText.setWidth(60);
    staticText.setHeight(15);
    staticText.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
    staticText.setStyle(boldStyle);
    staticText.setText("Count : ");
    band.addElement(staticText);
    textField = new JRDesignTextField();
    textField.setX(460);
    textField.setY(0);
    textField.setWidth(30);
    textField.setHeight(15);
    textField.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
    textField.setStyle(boldStyle);
    expression = new JRDesignExpression();
    expression.setValueClass(java.lang.Integer.class);
    expression.setText("$V{CityGroup_COUNT}");
    textField.setExpression(expression);
    band.addElement(textField);
    ((JRDesignSection)group.getGroupFooterSection()).addBand(band);

    jasperDesign.addGroup(group);

    //Title
    band = new JRDesignBand();
    band.setHeight(50);
    line = new JRDesignLine();
    line.setX(0);
    line.setY(0);
    line.setWidth(515);
    line.setHeight(0);
    band.addElement(line);
    textField = new JRDesignTextField();
    textField.setBlankWhenNull(true);
    textField.setX(0);
    textField.setY(10);
    textField.setWidth(515);
    textField.setHeight(30);
    textField.setHorizontalAlignment(HorizontalAlignEnum.CENTER);
    textField.setStyle(normalStyle);
    textField.setFontSize(22);
    expression = new JRDesignExpression();
    expression.setValueClass(java.lang.String.class);
    expression.setText("$P{ReportTitle}");
    textField.setExpression(expression);
    band.addElement(textField);
    jasperDesign.setTitle(band);
   
    //Page header
    band = new JRDesignBand();
    band.setHeight(20);
    JRDesignFrame frame = new JRDesignFrame();
    frame.setX(0);
    frame.setY(5);
    frame.setWidth(515);
    frame.setHeight(15);
    frame.setForecolor(new Color(0x33, 0x33, 0x33));
    frame.setBackcolor(new Color(0x33, 0x33, 0x33));
    frame.setMode(ModeEnum.OPAQUE);
    band.addElement(frame);
    staticText = new JRDesignStaticText();
    staticText.setX(0);
    staticText.setY(0);
    staticText.setWidth(55);
    staticText.setHeight(15);
    staticText.setForecolor(Color.white);
    staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
    staticText.setMode(ModeEnum.OPAQUE);
    staticText.setHorizontalAlignment(HorizontalAlignEnum.CENTER);
    staticText.setStyle(boldStyle);
    staticText.setText("ID");
    frame.addElement(staticText);
    staticText = new JRDesignStaticText();
    staticText.setX(55);
    staticText.setY(0);
    staticText.setWidth(205);
    staticText.setHeight(15);
    staticText.setForecolor(Color.white);
    staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
    staticText.setMode(ModeEnum.OPAQUE);
    staticText.setStyle(boldStyle);
    staticText.setText("Name");
    frame.addElement(staticText);
    staticText = new JRDesignStaticText();
    staticText.setX(260);
    staticText.setY(0);
    staticText.setWidth(255);
    staticText.setHeight(15);
    staticText.setForecolor(Color.white);
    staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
    staticText.setMode(ModeEnum.OPAQUE);
    staticText.setStyle(boldStyle);
    staticText.setText("Street");
    frame.addElement(staticText);
    jasperDesign.setPageHeader(band);

    //Column header
    band = new JRDesignBand();
    jasperDesign.setColumnHeader(band);

    //Detail
    band = new JRDesignBand();
    band.setHeight(20);
    textField = new JRDesignTextField();
    textField.setX(0);
    textField.setY(4);
    textField.setWidth(50);
    textField.setHeight(15);
    textField.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
    textField.setStyle(normalStyle);
    expression = new JRDesignExpression();
    expression.setValueClass(java.lang.Integer.class);
    expression.setText("$F{Id}");
    textField.setExpression(expression);
    band.addElement(textField);
    textField = new JRDesignTextField();
    textField.setStretchWithOverflow(true);
    textField.setX(55);
    textField.setY(4);
    textField.setWidth(200);
    textField.setHeight(15);
    textField.setPositionType(PositionTypeEnum.FLOAT);
    textField.setStyle(normalStyle);
    expression = new JRDesignExpression();
    expression.setValueClass(java.lang.String.class);
    expression.setText("$F{FirstName} + \" \" + $F{LastName}");
    textField.setExpression(expression);
    band.addElement(textField);
    textField = new JRDesignTextField();
    textField.setStretchWithOverflow(true);
    textField.setX(260);
    textField.setY(4);
    textField.setWidth(255);
    textField.setHeight(15);
    textField.setPositionType(PositionTypeEnum.FLOAT);
    textField.setStyle(normalStyle);
    expression = new JRDesignExpression();
    expression.setValueClass(java.lang.String.class);
    expression.setText("$F{Street}");
    textField.setExpression(expression);
    band.addElement(textField);
    line = new JRDesignLine();
    line.setX(0);
    line.setY(19);
    line.setWidth(515);
    line.setHeight(0);
    line.setForecolor(new Color(0x80, 0x80, 0x80));
    line.setPositionType(PositionTypeEnum.FLOAT);
    band.addElement(line);
    ((JRDesignSection)jasperDesign.getDetailSection()).addBand(band);

    //Column footer
    band = new JRDesignBand();
View Full Code Here

    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

      jasperDesign.addFont(italicFont);

      //Title
      JRDesignBand band = new JRDesignBand();
      band.setHeight(50);
      JRDesignLine line = new JRDesignLine();
      line.setX(0);
      line.setY(0);
      line.setWidth(968);
      line.setHeight(0);
      band.addElement(line);
     
      JRDesignStaticText text = new JRDesignStaticText();
     
      text.setX(0);
View Full Code Here

    Iterator iterator = fields.iterator();
    int x = 0;
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
      if(isAggregable(field)) {
        JRDesignLine line = new JRDesignLine();
        line.setX(x);
        line.setY(0);
        line.setWidth(field.getColumnWidth());
        line.setHeight(0);
        band.addElement(line);
        line.setY(2);
        band.addElement(line);

        JRDesignTextField textField = new JRDesignTextField();
        textField.setX(x);
        textField.setY(4);
View Full Code Here

  }
  private void addPageFooter() throws JRException {
    //page footer
    JRDesignBand band = new JRDesignBand();
    band.setHeight(30);
    JRDesignLine line = new JRDesignLine();
    line.setX(0);
    line.setY(0);
    line.setWidth(968);
    line.setHeight(0);
    band.addElement(line);
   
    band.addElement(getPageFooter());
    jasperDesign.setPageFooter(band);
  }
View Full Code Here

TOP

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

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.