Package net.sf.jasperreports.crosstabs.design

Examples of net.sf.jasperreports.crosstabs.design.JRDesignCrosstab


  public static final String ATTRIBUTE_isDataPreSorted = "isDataPreSorted";

  public Object createObject(Attributes atts)
  {
    JRDesignCrosstab crosstab = (JRDesignCrosstab) digester.peek();
    JRDesignCrosstabDataset dataset = crosstab.getDesignDataset();
   
    String sortedAttr = atts.getValue(ATTRIBUTE_isDataPreSorted);
    if (sortedAttr != null && sortedAttr.length() > 0)
    {
      dataset.setDataPreSorted(Boolean.valueOf(sortedAttr).booleanValue());
View Full Code Here


 
  public Object createObject(Attributes atts)
  {
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
   
    JRDesignCrosstab crosstab = new JRDesignCrosstab(jasperDesign);
   
    String columnBreakOffsetAttr = atts.getValue(ATTRIBUTE_columnBreakOffset);
    if (columnBreakOffsetAttr != null && columnBreakOffsetAttr.length() > 0)
    {
      crosstab.setColumnBreakOffset(Integer.parseInt(columnBreakOffsetAttr));
    }
   
    String repeatColHeadersAttr = atts.getValue(ATTRIBUTE_isRepeatColumnHeaders);
    if (repeatColHeadersAttr != null && repeatColHeadersAttr.length() > 0)
    {
      crosstab.setRepeatColumnHeaders(Boolean.valueOf(repeatColHeadersAttr).booleanValue());
    }
   
    String repeatRowHeadersAttr = atts.getValue(ATTRIBUTE_isRepeatRowHeaders);
    if (repeatRowHeadersAttr != null && repeatColHeadersAttr.length() > 0)
    {
      crosstab.setRepeatRowHeaders(Boolean.valueOf(repeatRowHeadersAttr).booleanValue());
    }
   
    String runDirectionAttr = atts.getValue(JRXmlConstants.ATTRIBUTE_runDirection);
    if (runDirectionAttr != null)
    {
      RunDirectionEnum runDir = RunDirectionEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_runDirection));
      if (runDir != null)
      {
        crosstab.setRunDirection(runDir);
      }
    }
   
    String ignoreWidthAttr = atts.getValue(ATTRIBUTE_ignoreWidth);
    if (ignoreWidthAttr != null)
    {
      crosstab.setIgnoreWidth(Boolean.valueOf(ignoreWidthAttr));
    }
   
    return crosstab;
  }
View Full Code Here

      units[sourcesCount] = createCompileUnit(jasperDesign, dataset, expressionCollector, tempDirFile, nameSuffix);
    }
   
    for (Iterator it = crosstabs.iterator(); it.hasNext(); ++sourcesCount)
    {
      JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
      // generating source code for a sub dataset
      units[sourcesCount] = createCompileUnit(jasperDesign, crosstab, expressionCollector, tempDirFile, nameSuffix);
    }
   
    //TODO component - component compilation units?

    String classpath = JRProperties.getProperty(JRProperties.COMPILER_CLASSPATH);
   
    try
    {
      // compiling generated sources
      String compileErrors = compileUnits(units, classpath, tempDirFile);
      if (compileErrors != null)
      {
        throw new JRException("Errors were encountered when compiling report expressions class file:\n" + compileErrors);
      }

      // creating the report compile data
      JRReportCompileData reportCompileData = new JRReportCompileData();
      reportCompileData.setMainDatasetCompileData(units[0].getCompileData());
     
      for (ListIterator it = datasets.listIterator(); it.hasNext();)
      {
        JRDesignDataset dataset = (JRDesignDataset) it.next();
        reportCompileData.setDatasetCompileData(dataset, units[it.nextIndex()].getCompileData());
      }
     
      for (ListIterator it = crosstabs.listIterator(); it.hasNext();)
      {
        JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
        Integer crosstabId = expressionCollector.getCrosstabId(crosstab);
        reportCompileData.setCrosstabCompileData(crosstabId.intValue(), units[datasets.size() + it.nextIndex()].getCompileData());
      }

      // creating the report
View Full Code Here

   */
  public void preprocess()
  {
    for (Iterator it = getCrosstabs().iterator(); it.hasNext();)
    {
      JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
      crosstab.preprocess();
    }
  }
View Full Code Here

  public JRDesignCrosstab createCrosstab(DJCrosstab djcrosstab, AbstractLayoutManager layoutManager) {
    this.djcross = djcrosstab;
    this.layoutManager = layoutManager;
    this.design = layoutManager.getDesign();

    jrcross = new JRDesignCrosstab();

    jrcross.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);

    cols = (DJCrosstabColumn[]) djcrosstab.getColumns().toArray(new DJCrosstabColumn[]{});
    rows = (DJCrosstabRow[]) djcrosstab.getRows().toArray(new DJCrosstabRow[]{});
View Full Code Here

    for (Iterator iterator = columnsGroup.getHeaderCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupHeader();
      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        LayoutUtils.moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
      LayoutUtils.moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      if (djcross.getTopSpace() != 0){
        LayoutUtils.moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        band.addElement(rect);
      }

    }

    for (Iterator iterator = columnsGroup.getFooterCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupFooter();
      int yOffset = LayoutUtils.findVerticalOffset(band);
      if (djcross.getTopSpace() != 0){
//        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), yOffset);
        rect.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        band.addElement(rect);
        crosst.setY(rect.getY() + rect.getHeight());
      }

      band.addElement(crosst);


      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), crosst.getY() + crosst.getHeight());
        band.addElement(rect);
      }
    }

View Full Code Here

  public JRDesignCrosstab createCrosstab(DJCrosstab djcrosstab, AbstractLayoutManager layoutManager) {
    this.djcross = djcrosstab;
    this.layoutManager = layoutManager;
    this.design = layoutManager.getDesign();

    jrcross = new JRDesignCrosstab();

    jrcross.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);

    cols = (DJCrosstabColumn[]) djcrosstab.getColumns().toArray(new DJCrosstabColumn[]{});
    rows = (DJCrosstabRow[]) djcrosstab.getRows().toArray(new DJCrosstabRow[]{});
View Full Code Here

    for (Iterator iterator = columnsGroup.getHeaderCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupHeader();
      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
      moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      if (djcross.getTopSpace() != 0){
        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        band.addElement(rect);
      }

    }

    for (Iterator iterator = columnsGroup.getFooterCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupFooter();
      int yOffset = findVerticalOffset(band);
      if (djcross.getTopSpace() != 0){
//        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), yOffset);
        rect.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        band.addElement(rect);
        crosst.setY(rect.getY() + rect.getHeight());
      }

      band.addElement(crosst);


      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), crosst.getY() + crosst.getHeight());
        band.addElement(rect);
      }
    }

View Full Code Here

  public JRDesignCrosstab createCrosstab(DJCrosstab djcrosstab, AbstractLayoutManager layoutManager) {
    this.djcross = djcrosstab;
    this.layoutManager = layoutManager;
    this.design = layoutManager.getDesign();

    jrcross = new JRDesignCrosstab();

    jrcross.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);

    cols = (DJCrosstabColumn[]) djcrosstab.getColumns().toArray(new DJCrosstabColumn[]{});
    rows = (DJCrosstabRow[]) djcrosstab.getRows().toArray(new DJCrosstabRow[]{});
View Full Code Here

    for (Iterator iterator = columnsGroup.getHeaderCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupHeader();
      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        moveBandsElemnts(rect.getHeight(), band);
        band.addElement(rect);
      }
      moveBandsElemnts(crosst.getHeight(), band);
      band.addElement(crosst);
      if (djcross.getTopSpace() != 0){
        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), 0);
        band.addElement(rect);
      }

    }

    for (Iterator iterator = columnsGroup.getFooterCrosstabs().iterator(); iterator.hasNext();) {
      DJCrosstab djcross = (DJCrosstab) iterator.next();

      Dj2JrCrosstabBuilder djcb = new Dj2JrCrosstabBuilder();

      JRDesignCrosstab crosst = djcb.createCrosstab(djcross,this);
      JRDesignBand band = (JRDesignBand) jgroup.getGroupFooter();
      int yOffset = findVerticalOffset(band);
      if (djcross.getTopSpace() != 0){
//        moveBandsElemnts(djcross.getTopSpace(), band);
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), yOffset);
        rect.setPositionType(JRDesignElement.POSITION_TYPE_FIX_RELATIVE_TO_TOP);
        band.addElement(rect);
        crosst.setY(rect.getY() + rect.getHeight());
      }

      band.addElement(crosst);


      if (djcross.getBottomSpace() != 0){
        JRDesignRectangle rect = createBlankRectableCrosstab(djcross.getBottomSpace(), crosst.getY() + crosst.getHeight());
        band.addElement(rect);
      }
    }

View Full Code Here

TOP

Related Classes of net.sf.jasperreports.crosstabs.design.JRDesignCrosstab

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.