Package net.sf.jasperreports.engine.design

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


    // columns in page header
    Iterator iterator = fields.iterator();
    int x = 0;
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
      JRDesignStaticText staticText = new JRDesignStaticText();
      staticText.setX(x);
      if(isSub) {
        staticText.setY(20);
      } else {
        staticText.setY(5);
      }
      staticText.setWidth(field.getColumnWidth());
      staticText.setHeight(15);
      staticText.setForecolor(Color.white);
      if(isSub) {
        staticText.setBackcolor(new Color(0x99, 0x99, 0x99));
      } else {
        staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
      }
      staticText.setMode(JRElement.MODE_OPAQUE);
      staticText.setTextAlignment(JRTextElement.TEXT_ALIGN_RIGHT);
      staticText.setFont(boldFont);
      staticText.setText(field.getName());
      band.addElement(staticText);
     
      x += field.getColumnWidth();
    }
   
View Full Code Here


        System.out.println("column header is " + interval.getText2());
       
        // add columns
        JRDesignBand columnHeader = (JRDesignBand) design.getColumnHeader();
 
        JRDesignStaticText staticText = new JRDesignStaticText();
        staticText.setX(maxX);
        staticText.setY(0);
        staticText.setWidth(80);
        staticText.setHeight(15);
        staticText.setTextAlignment(JRTextElement.TEXT_ALIGN_RIGHT);
        staticText.setFont(normalFont);
        staticText.setText(interval.getText1());
        staticText.setPrintWhenDetailOverflows(true);
        columnHeader.addElement(staticText);

        // add textFields
        JRDesignBand detailBand = (JRDesignBand) design.getDetail();
 
View Full Code Here

TOP

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

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.