国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > Flex > 正文

flex打印操作(FlexPrintJob)還有分頁打印操作具體實現(xiàn)

2024-09-08 18:16:53
字體:
供稿:網(wǎng)友
首先要導(dǎo)入 import mx.printing.FlexPrintJob;
import mx.printing.PrintAdvancedDataGrid;
1.使用FlexPrintJob進行打印操作
1.如果沒有分頁和下拉框的時候

復(fù)制代碼 代碼如下:


public function doPrint():void{
var printer:FlexPrintJob = new FlexPrintJob();
if(printer.start()){
printer.addObject(body);
printer.send();
}
}


這個方法即可 下面的可以使用,由于我使用的是Flex3,Flex3里面沒有標(biāo)簽“PrintDataGrid”,只有“PrintAdvancedDataGrid”。所以下面就使用(“PrintAdvancedDataGrid”,“AdvancedDataGrid ”,“DataGrid ”)這三種方式,切記上面的方式只適合于單個頁面(數(shù)據(jù)較少)且沒有下拉框

復(fù)制代碼 代碼如下:


<mx:PrintAdvancedDataGrid x="188" y="232">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="username"/>
<mx:AdvancedDataGridColumn dataField="password"/>
</mx:columns>
</mx:PrintAdvancedDataGrid>


--------------------------------------------------------------------------------------
[/code]
<mx:AdvancedDataGrid x="188" y="232">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="username"/>
<mx:AdvancedDataGridColumn dataField="password"/>
</mx:columns>
</mx:AdvancedDataGrid>
[/code]
-----------------------------------------------------------------------------------------

復(fù)制代碼 代碼如下:


<mx:DataGrid x="188" y="232">
<mx:columns>
<mx:DataGridColumn dataField="username"/>
<mx:DataGridColumn dataField="password"/>
</mx:columns>
</mx:DataGrid>


----------------------------------------------------------------------------------------------------------------------------------------------------------
如果要使用分頁效果,則必須使用標(biāo)簽"PrintAdvancedDataGrid"(Flex3中的標(biāo)簽)才能夠?qū)崿F(xiàn)分頁效果

復(fù)制代碼 代碼如下:


private function doPrint():void{
var PrintJob:FlexPrintJob = new FlexPrintJob();
if(PrintJob.start()){
addChild(body);
//設(shè)置的打印視圖屬性
while(true){
PrintJob.addObject(body);
if(body.validNextPage){
body.nextPage();
}else{
break;
}
}
}
PrintJob.send();
}


這個方法,所對應(yīng)的標(biāo)簽是:

復(fù)制代碼 代碼如下:


<mx:PrintAdvancedDataGrid x="188" y="232">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="username"/>
<mx:AdvancedDataGridColumn dataField="password"/>
</mx:columns>
</mx:PrintAdvancedDataGrid>

(編輯:武林網(wǎng))

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 孟连| 盘锦市| 道孚县| 驻马店市| 蓬安县| 明水县| 武威市| 临邑县| 河源市| 贺兰县| 喀喇沁旗| 仙桃市| 太原市| 七台河市| 新建县| 察隅县| 明星| 英吉沙县| 望谟县| 双城市| 静宁县| 西丰县| 通城县| 兴业县| 涿鹿县| 抚州市| 德保县| 永城市| 永善县| 阿鲁科尔沁旗| 锡林郭勒盟| 岳普湖县| 安龙县| 湘潭市| 汉沽区| 古丈县| 正宁县| 兰州市| 长宁区| 张家港市| 秀山|