Examples of JRDesignFrame


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

    // we need to put everything in a frame so that we can tell the frame
    // not to print when there are no detail bands on the current page
    //
    // we can't do that directly to the band since its print when expression
    // is evaluated too soon
    JRDesignFrame footerFrame = new JRDesignFrame();
    footerFrame.setX(0);
    footerFrame.setY(0);
    footerFrame.setWidth(computeTableWidth(fillColumns));
    footerFrame.setHeight(pageFooter.getHeight());
    footerFrame.getLineBox().setPadding(0);
    footerFrame.getLineBox().getPen().setLineWidth(0f);
    footerFrame.setRemoveLineWhenBlank(true);
   
    // we only need an empty expression object here
    // the evaluation logic is separate
    JRDesignExpression footerPrintWhen = new JRDesignExpression();
    builtinEvaluators.put(footerPrintWhen, new SummaryGroupFooterPrintWhenEvaluator());
    footerFrame.setPrintWhenExpression(footerPrintWhen);
   
    // clone the contents of the page footer in the frame
    List footerElements = pageFooter.getChildren();
    for (Iterator iterator = footerElements.iterator(); iterator
        .hasNext();)
    {
      JRChild child = (JRChild) iterator.next();
      JRChild childClone = (JRChild) child.clone(footerFrame);
      if (childClone instanceof JRElement)
      {
        footerFrame.addElement((JRElement) childClone);
      }
      else if (childClone instanceof JRElementGroup)
      {
        footerFrame.addElementGroup((JRElementGroup) childClone);
      }
      else
      {
        throw new JRRuntimeException("Uknown child type "
            + childClone.getClass().getName());
View Full Code Here

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

 
  protected JRDesignFrame createCellFrame(Cell cell,
      int originalWidth, int width,
      int x, int y)
  {
    JRDesignFrame frame = new JRDesignFrame(this);
    frame.setX(x);
    frame.setY(y);
    frame.setWidth(width);
    frame.setHeight(cell.getHeight());
    frame.setStretchType(StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT);
   
    frame.setStyle(cell.getStyle());
    frame.setStyleNameReference(cell.getStyleNameReference());
    frame.copyBox(cell.getLineBox());
   
    for (Iterator it = cell.getChildren().iterator(); it.hasNext();)
    {
      JRChild child = (JRChild) it.next();
      if (child instanceof JRElement)
      {
        JRElement element = (JRElement) child;
        // clone the element in order to set the frame as group
        element = (JRElement) element.clone(frame);
        if (width != originalWidth)
        {
          scaleCellElement(element, originalWidth, width);
         
          if (element instanceof JRElementGroup)//i.e. frame
          {
            JRElementGroup elementGroup = (JRElementGroup) element;
            for (JRElement subelement : elementGroup.getElements())
            {
              scaleCellElement(subelement, originalWidth, width);
            }
          }
        }
        frame.addElement(element);
      }
      else if (child instanceof JRElementGroup)
      {
        JRElementGroup elementGroup = (JRElementGroup) child;
        // clone the elements in order to set the frame as group
        elementGroup = (JRElementGroup) elementGroup.clone(frame);
        frame.addElementGroup(elementGroup);
       
        if (width != originalWidth)
        {
          for (JRElement element : elementGroup.getElements())
          {
View Full Code Here

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

    {
      Cell cell = columnCell(column);
     
      if (cell != null)
      {
        JRDesignFrame cellFrame = createCellFrame(cell,
            column.getWidth(), fillColumn.getWidth(),
            xOffset, yOffset);
        int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan();
        bandInfo.addElement(level + rowSpan - 1, cellFrame);
       
View Full Code Here

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

      int cellHeight = 0;
      int sublevel = level;
      if (cell != null)
      {
        int rowSpan = cell.getRowSpan() == null ? 1 : cell.getRowSpan();
        JRDesignFrame cellFrame = createCellFrame(cell,
            columnGroup.getWidth(), fillColumn.getWidth(),
            xOffset, yOffset);
        bandInfo.addElement(level + rowSpan - 1, cellFrame);
        cellHeight = cell.getHeight();
        sublevel += rowSpan;
View Full Code Here

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

        }
      }
     
      if (cell != null)
      {
        JRDesignFrame cellFrame = createCellFrame(cell,
            columnGroup.getWidth(), fillColumn.getWidth(),
            origXOffset, yOffset);
        bandInfo.addElement(level + rowSpan - 1, cellFrame);
        yOffset += cell.getHeight();
      }
View Full Code Here

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

 
  public Object createObject(Attributes attributes)
  {
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
   
    return new JRDesignFrame(jasperDesign);
  }
View Full Code Here

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

    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);
View Full Code Here

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

            (int)Math.round(leftPos + nameSize), 0,
            (int)Math.round(valSize), (int)Math.round(getFieldHeigth()), dataExp);
     
      nameField.setStretchType(JRDesignTextField.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT);
      dataField.setStretchType(JRDesignTextField.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT);
      JRDesignFrame    farme = new JRDesignFrame();
      farme.setX(0);
      farme.setY((int)Math.round(startPosition));
      farme.setWidth(destingWidth);
      farme.getLineBox().setPadding(0);
      farme.setHeight((int)Math.round(getFieldHeigth()));
      farme.setStyle(normalStyle);
      farme.setPositionType(JRDesignFrame.POSITION_TYPE_FLOAT);
      farme.addElement(nameField);
      farme.addElement(dataField);
     
      switch (val.alignmentType){
        case dataInOneColoumnByRightAndHalfRigthAlign:
          nameField.setHorizontalAlignment(JRDesignTextField.HORIZONTAL_ALIGN_RIGHT);
          break;
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.