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

首頁 > 網站 > WEB開發 > 正文

26.11.打印頁眉和頁腳

2024-04-27 13:52:39
字體:
來源:轉載
供稿:網友
26.11.1. 問題
我想打印出頁眉和頁腳
26.11.2. 解決辦法
創建打印渲染器組件控制頁面布局
26.11.3. 討論
結合打印渲染器的PrintDataGrid比PrintDataGrid自身具備更多的布局控制能力。常見的任務就是打印頁眉和頁腳。這個技術涉及是否在布局中包含頁眉和頁腳以及PrintDataGrid的validNextPage屬性的測試結果。下面的代碼,HeaderFooterPrintRenderer.mxml,定義了一個打印渲染器生成多頁打印內容,包括在適當位置的頁眉和頁腳:
+展開
-XML
<?xml version="1.0"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="#ffffffhorizontalAlign="center">

<mx:Script>
<![CDATA[
public function startJob():void
{
//Try to print this on a single page
header.visible = true;
header.includeInLayout = true;
footer.visible = true;
footer.includeInLayout = true;
this.validateNow();
if (printGrid.validNextPage)
{
//The grid is too big to fit on a single page
footer.visible = false;
footer.includeInLayout = false;
this.validateNow();
}
}
public function nextPage():Boolean
{
header.visible = false;
header.includeInLayout = false;
printGrid.nextPage();
footer.visible = !printGrid.validNextPage;
footer.includeInLayout = !printGrid.validNextPage;
this.validateNow();
return printGrid.validNextPage;
}

]]>
</mx:Script>
<mx:DateFormatter id="formatterformatString="M/D/YYYY" />
<mx:Canvas id="headerheight="80width="100%">
<mx:Label text="Population by State"
fontSize="24"
color="0x666666"
horizontalCenter="0"
verticalCenter="0"
width="100%"
textAlign="center" />

</mx:Canvas>
<mx:VBox height="100%width="80%">
<mx:PrintDataGrid id="printGridwidth="100%"
height="100%">

<mx:columns>
<mx:DataGridColumn dataField="@name"
headerText="State" />

<mx:DataGridColumn dataField="@population"
headerText="Population"/>

</mx:columns>
</mx:PrintDataGrid>
</mx:VBox>
<mx:DateFormatter id="formatformatString="m/d/yyyy" />
<mx:Canvas id="footerheight="80width="100%">
<mx:Label text="{formatter.format(new Date())}"
left="20bottom="5" />

</mx:Canvas>
</mx:VBox>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 玉林市| 广水市| 英山县| 安吉县| 会宁县| 滨州市| 略阳县| 思茅市| 宣武区| 东丰县| 图们市| 讷河市| 读书| 德江县| 阳江市| 安阳县| 望都县| 贡嘎县| 华安县| 汉阴县| 正宁县| 珲春市| 莱州市| 新营市| 桐庐县| 湘潭市| 彝良县| 台南县| 板桥市| 昌黎县| 呼伦贝尔市| 冷水江市| 广安市| 沁源县| 韶关市| 广灵县| 建瓯市| 高州市| 车险| 柳江县| 廉江市|