// 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;