Examples of MasterDataRow


Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    if (parentState == null)
    {
      return EMPTY_LAYOUTER_LEVEL;
    }

    MasterDataRow dataRow = state.getFlowController().getMasterRow();
    dataRow = dataRow.getParentDataRow();
    if (dataRow == null)
    {
      throw new IllegalStateException("Parent-DataRow in a subreport-state must be defined.");
    }

    final ArrayList<LayouterLevel> stack = new ArrayList<LayouterLevel>();
    while (parentState != null)
    {
      if (parentState.isInlineProcess() == false)
      {
        final LayoutExpressionRuntime runtime = createRuntime(dataRow, parentState, processingContext);
        stack.add(new LayouterLevel
            (parentState.getReport(), parentState.getCurrentGroupIndex(), runtime, parentState.isInItemGroup()));
      }
      parentState = parentState.getParentSubReportState();
      dataRow = dataRow.getParentDataRow();
      if (dataRow == null)
      {
        throw new IllegalStateException("Parent-DataRow in a subreport-state must be defined.");
      }
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    // second run. Now with padding ..
    final ProcessingContext prc = new DefaultProcessingContext();
    final GlobalMasterRow gmr = GlobalMasterRow.createReportRow
        (prc, new DefaultDataSchemaDefinition(), new ParameterDataRow(), null, false);
    final TableModel data = createTableModel();
    MasterDataRow wdata = gmr.deriveWithQueryData(new ReportDataRow(data));
    int advanceCount = 0;
    wdata = wdata.startCrosstabMode(specification);
    logger.debug("Region:  " + wdata.getGlobalView().get("Region"));
    logger.debug("Product: " + wdata.getGlobalView().get("Product"));
    logger.debug("Year:    " + wdata.getGlobalView().get("Time"));
    Object grpVal = wdata.getGlobalView().get("Region");
    while (wdata.isAdvanceable())
    {
      logger.debug("-- Advance -- ");
      MasterDataRow nextdata = wdata.advance();
      Object nextGrpVal = nextdata.getGlobalView().get("Region");
      if (ObjectUtilities.equal(grpVal, nextGrpVal) == false)
      {
        nextdata = nextdata.resetRowCursor();
      }

      logger.debug("Do Advance Count: " + nextdata.getReportDataRow().getCursor());
      logger.debug("Region:  " + nextdata.getGlobalView().get("Region"));
      logger.debug("Product: " + nextdata.getGlobalView().get("Product"));
      logger.debug("Year:    " + nextdata.getGlobalView().get("Time"));
      advanceCount += 1;
      wdata = nextdata;
      grpVal = nextGrpVal;
    }
    if (advanceCount != (data.getRowCount() - 1))
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

  {
    final ProcessingContext prc = new DefaultProcessingContext();
    final GlobalMasterRow gmr = GlobalMasterRow.createReportRow
        (prc, new DefaultDataSchemaDefinition(), new ParameterDataRow(), null, false);
    final TableModel data = createTableModel();
    MasterDataRow wdata = gmr.deriveWithQueryData(new ReportDataRow(data));
    final CrosstabSpecification cs = new SortedMergeCrosstabSpecification
        (createDummyKey(), new String[]{"Product", "Time"});
    int advanceCount = 0;
    System.out.println(wdata.getReportDataRow().getCursor());
    cs.startRow();
    cs.add(wdata.getGlobalView());
    Object grpVal = wdata.getGlobalView().get("Region");
    while (wdata.isAdvanceable())
    {
      final MasterDataRow nextdata = wdata.advance();
      Object nextGrpVal = nextdata.getGlobalView().get("Region");
      if (ObjectUtilities.equal(grpVal, nextGrpVal) == false)
      {
        cs.endRow();
        cs.startRow();
      }

      cs.add(nextdata.getGlobalView());
      logger.debug("Prepare Advance Count: " + nextdata.getReportDataRow().getCursor());
      advanceCount += 1;
      wdata = nextdata;
      grpVal = nextGrpVal;
    }
    cs.endRow();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    return flowController.getMasterRow().getGlobalView();
  }

  public int getNumberOfRows()
  {
    final MasterDataRow masterRow = flowController.getMasterRow();
    final ReportDataRow reportDataRow = masterRow.getReportDataRow();
    if (reportDataRow != null)
    {
      return reportDataRow.getReportData().getRowCount();
    }
    return 0;
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

  public ProcessState commit(final ProcessState state) throws ReportProcessingException
  {
    // better clone twice than to face the subtle errors that crawl out here..
    final ProcessState next = state.deriveForAdvance();
    final DefaultFlowController flowController = next.getFlowController();
    final MasterDataRow masterRow = flowController.getMasterRow();
    final ExpressionDataRow expressionDataRow = masterRow.getExpressionDataRow();
    final Expression[] expressions = expressionDataRow.getExpressions();

    if (next.isSubReportEvent())
    {
      next.setAdvanceHandler(EndSubReportHandler.HANDLER);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

  {
    final ProcessingContext prc = new DefaultProcessingContext();
    final GlobalMasterRow gmr = GlobalMasterRow.createReportRow
        (prc, new DefaultDataSchemaDefinition(), new ParameterDataRow());
    gmr.requireStructuralProcessing();
    MasterDataRow masterDataRow = gmr.deriveWithQueryData(data);
    final CrosstabSpecification crosstabSpecification = new SortedMergeCrosstabSpecification
        (new ReportStateKey(), new String[]{"Product", "Time"}, new String[] {"Region"});

    int advanceCount = 0;
    logger.debug("Building Crosstab: Cursor: " + String.valueOf(masterDataRow.getReportDataRow().getCursor()));
    crosstabSpecification.startRow();
    crosstabSpecification.add(masterDataRow.getGlobalView());
    Object grpVal = masterDataRow.getGlobalView().get("Region");
    while (masterDataRow.isAdvanceable())
    {
      final MasterDataRow nextdata = masterDataRow.advance();
      final Object nextGrpVal = nextdata.getGlobalView().get("Region");
      if (ObjectUtilities.equal(grpVal, nextGrpVal) == false)
      {
        crosstabSpecification.endRow();
        crosstabSpecification.startRow();
      }

      crosstabSpecification.add(nextdata.getGlobalView());
      logger.debug("Prepare Advance Count: " + nextdata.getReportDataRow().getCursor());
      advanceCount += 1;
      masterDataRow = nextdata;
      grpVal = nextGrpVal;
    }
    crosstabSpecification.endRow();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    // second run. Now with padding ..
    final ProcessingContext prc = new DefaultProcessingContext();
    final GlobalMasterRow gmr = GlobalMasterRow.createReportRow
        (prc, new DefaultDataSchemaDefinition(), new ParameterDataRow());
    gmr.requireStructuralProcessing();
    MasterDataRow wdata = gmr.deriveWithQueryData(data);
    int advanceCount = 1;
    wdata = wdata.startCrosstabMode(specification);
    logger.debug("Rows:  " + wdata.getGlobalView().get("Rows"));
    logger.debug("Cols:  " + wdata.getGlobalView().get("Cols"));
    logger.debug("Data: " + wdata.getGlobalView().get("Data"));

    Assert.assertEquals(valData[0][0], wdata.getGlobalView().get("Rows"));
    Assert.assertEquals(valData[0][1], wdata.getGlobalView().get("Cols"));

    Object grpVal = wdata.getGlobalView().get("Rows");
    while (wdata.isAdvanceable())
    {
      logger.debug("-- Advance -- " + advanceCount);
      MasterDataRow nextdata = wdata.advance();
      final Object rows = nextdata.getGlobalView().get("Rows");
      if (ObjectUtilities.equal(grpVal, rows) == false)
      {
        nextdata = nextdata.resetRowCursor();
      }

      logger.debug("Do Advance Count: " + nextdata.getReportDataRow().getCursor());
      logger.debug("Rows:  " + rows);
      final Object cols = nextdata.getGlobalView().get("Cols");
      logger.debug("Cols:  " + cols);
      logger.debug("Data: " + nextdata.getGlobalView().get("Data"));

      Assert.assertEquals(valData[advanceCount][0], rows);
      Assert.assertEquals(valData[advanceCount][1], cols);

      advanceCount += 1;
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    // second run. Now with padding ..
    final ProcessingContext prc = new DefaultProcessingContext();
    final GlobalMasterRow gmr = GlobalMasterRow.createReportRow
        (prc, new DefaultDataSchemaDefinition(), new ParameterDataRow());
    gmr.requireStructuralProcessing();
    MasterDataRow wdata = gmr.deriveWithQueryData(data);
    int advanceCount = 1;
    wdata = wdata.startCrosstabMode(specification);
    logger.debug("Region:  " + wdata.getGlobalView().get("Region"));
    logger.debug("Product: " + wdata.getGlobalView().get("Product"));
    logger.debug("Year:    " + wdata.getGlobalView().get("Time"));
    assertEquals(valData[0][0], wdata.getGlobalView().get("Region"));
    assertEquals(valData[0][1], wdata.getGlobalView().get("Product"));
    assertEquals(valData[0][2], wdata.getGlobalView().get("Time"));

    Object grpVal = wdata.getGlobalView().get("Region");
    while (wdata.isAdvanceable())
    {
      logger.debug("-- Advance -- " + advanceCount);
      MasterDataRow nextdata = wdata.advance();
      final Object nextGrpVal = nextdata.getGlobalView().get("Region");
      if (ObjectUtilities.equal(grpVal, nextGrpVal) == false)
      {
        nextdata = nextdata.resetRowCursor();
      }

      logger.debug("Do Advance Count: " + nextdata.getReportDataRow().getCursor());
      logger.debug("Region:  " + nextdata.getGlobalView().get("Region"));
      logger.debug("Product: " + nextdata.getGlobalView().get("Product"));
      logger.debug("Year:    " + nextdata.getGlobalView().get("Time"));
      assertEquals(valData[advanceCount][0], nextdata.getGlobalView().get("Region"));
      assertEquals(valData[advanceCount][1], nextdata.getGlobalView().get("Product"));
      assertEquals(valData[advanceCount][2], nextdata.getGlobalView().get("Time"));
      advanceCount += 1;
      wdata = nextdata;
      grpVal = nextGrpVal;
    }
    return advanceCount;
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    // second run. Now with padding ..
    final ProcessingContext prc = new DefaultProcessingContext();
    final GlobalMasterRow gmr = GlobalMasterRow.createReportRow
        (prc, new DefaultDataSchemaDefinition(), new ParameterDataRow());
    gmr.requireStructuralProcessing();
    MasterDataRow wdata = gmr.deriveWithQueryData(data);
    int advanceCount = 1;
    wdata = wdata.startCrosstabMode(specification);
    logger.debug("Rows:  " + wdata.getGlobalView().get("Rows"));
    logger.debug("Cols:  " + wdata.getGlobalView().get("Cols"));
    logger.debug("Data: " + wdata.getGlobalView().get("Data"));

    assertEquals(valData[0][0], wdata.getGlobalView().get("Rows"));
    assertEquals(valData[0][1], wdata.getGlobalView().get("Cols"));

    Object grpVal = wdata.getGlobalView().get("Rows");
    while (wdata.isAdvanceable())
    {
      logger.debug("-- Advance -- " + advanceCount);
      MasterDataRow nextdata = wdata.advance();
      final Object rows = nextdata.getGlobalView().get("Rows");
      if (ObjectUtilities.equal(grpVal, rows) == false)
      {
        nextdata = nextdata.resetRowCursor();
      }

      logger.debug("Do Advance Count: " + nextdata.getReportDataRow().getCursor());
      logger.debug("Rows:  " + rows);
      final Object cols = nextdata.getGlobalView().get("Cols");
      logger.debug("Cols:  " + cols);
      logger.debug("Data: " + nextdata.getGlobalView().get("Data"));

      assertEquals(valData[advanceCount][0], rows);
      assertEquals(valData[advanceCount][1], cols);

      advanceCount += 1;
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.states.datarow.MasterDataRow

    if (parentState == null)
    {
      return EMPTY_LAYOUTER_LEVEL;
    }

    MasterDataRow dataRow = state.getFlowController().getMasterRow();
    dataRow = dataRow.getParentDataRow();
    if (dataRow == null)
    {
      throw new IllegalStateException("Parent-DataRow in a subreport-state must be defined.");
    }

    final ArrayList<LayouterLevel> stack = new ArrayList<LayouterLevel>();
    while (parentState != null)
    {
      if (parentState.isInlineProcess() == false)
      {
        final LayoutExpressionRuntime runtime = createRuntime(dataRow, parentState, processingContext);
        stack.add(new LayouterLevel(parentState.getReport(),
            parentState.getPresentationGroupIndex(), runtime, parentState.isInItemGroup()));
      }
      parentState = parentState.getParentSubReportState();
      dataRow = dataRow.getParentDataRow();
      if (dataRow == null)
      {
        throw new IllegalStateException("Parent-DataRow in a subreport-state must be defined.");
      }
    }
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.