从this教程我得到了良好的打印结果,以及this教程如何从html打印多个页面,我试图用{做同样的事情{1}}。
我的问题是当行数超过Datagrid
的高度时所以我试图将其分解为几页,这是我的代码:
Datagrid
结果:我得到了第一页,但其余的只是空白 protected function button3_clickHandler(event:MouseEvent):void
{
var success:Boolean = printJob.start2(disablePageRange.selected ? this.printUIOptions : null, false);
var pjo:PrintJobOptions = new PrintJobOptions;
if (methodBitmap.selected){
pjo.printMethod = PrintMethod.BITMAP;
}
else if (methodVector.selected){
pjo.printMethod = PrintMethod.VECTOR;
}
else{
pjo.printMethod = PrintMethod.AUTO;
}
if (printJob.maxPixelsPerInch > 600){
pjo.pixelsPerInch = 600;
}
updateForm();
updateThePage();
updateTheWindow();
//--------------------------------------
var b:int = 0;
var H:int = myDataGrid.rowHeight *2;
for each (var item:Object in meme as ArrayCollection ){
if (H > myDataGrid.height){
myDataGrid.dataProvider = arlst;
printJob.addPage(thePrintableArea, null, pjo);
arlst.removeAll();
H = myDataGrid.rowHeight *2;
b++;
//Alert.show(b.toString());
}else{
arlst.addItem(item);
H += myDataGrid.rowHeight;
}
}
printJob.send();
}
:
答案 0 :(得分:0)
这回答:http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c7e.html
要点:
创建外部Itemrenderer
并将数据填充到其中。