【问题标题】:Multiple-page printing from datagrid从数据网格打印多页
【发布时间】:2015-05-07 02:55:10
【问题描述】:

this 教程我得到了很好的打印结果,this 关于如何从 html 打印多个页面的教程,我正在尝试用 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();
        }

结果:我得到了第一页,但其余的只是空白Datagrid

【问题讨论】:

    标签: actionscript-3 apache-flex datagrid air flex4


    【解决方案1】:

    这个答案:http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c7e.html

    总结: 创建外部Itemrenderer 并将数据填充到其中。

    【讨论】:

      猜你喜欢
      • 2015-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多