Printing the next page of a Datagrid in flash\air
Hi, I can only print the first page of my datagrid but not the next pages?? Any help with my code will
be appreciated very much!
function printProducts(evt:MouseEvent):void
{
Dg_prods.rowCount = Dg_prods_Rowcount;
Dg_prods.visible = false;
sheets=Dg_prods.numChildren;
printContainer=new Sprite();
addChild(printContainer);
printJob=new PrintJob();
PrintOptions=new PrintJobOptions();
PrintOptions.printAsBitmap=false;
if(printJob.start()){try{addContentSheet();}
catch(error:Error){trace("error");}printJob.send();removeContentAndSprite();}else{removeChild(printContainer);}
function addContentSheet():void
{
for (var i:int=0;i < sheets;i++)
{
printContainer.addChild(Dg_prods.getChildAt(0));
printContainer.scaleX = .30;
printContainer.scaleY = .30;
printContainer.width = printJob.pageWidth;
}
printJob.addPage(printContainer,null,PrintOptions);
}
function removeContentAndSprite():void
{
if(Dg_prods_Rowcount > 26) {Dg_prods.height = 560;}
Dg_prods.visible = true;
for (var i:int=0;i < sheets;i++){Dg_prods.addChild(printContainer.getChildAt(0));}removeChild(printContainer);
}
}