If I print an AdvancedDataGrid that is more than a single page, all is fine. If, however, there is less than a page to print the last row always ends up at the top of a second page.
The method doing the print jop is listed below. Am I missing something if not what can I do to make it work properly with a single page.
Thanks
const printJob:FlexPrintJob = new FlexPrintJob();
if ( printJob.start() ) {
const printDataGrid:PrintAdvancedDataGrid = new PrintAdvancedDataGrid();
printDataGrid.width = printJob.pageWidth;
printDataGrid.height = printJob.pageHeight;
printDataGrid.columns = districtVolunteers_dg.columns;
printDataGrid.dataProvider = districtVolunteersXML.copy();
printDataGrid.setStyle("fontSize", 8);
printDataGrid.setStyle("fontFamily", 'Times');
printDataGrid.sizeToPage;
printDataGrid.visible = false;
FlexGlobals.topLevelApplication.addChild(printDataGrid);
while (printDataGrid.validNextPage) {
printDataGrid.nextPage();
printJob.addObject(printDataGrid);
}
printJob.send();
FlexGlobals.topLevelApplication.removeChild(printDataGrid);
}