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

首頁(yè) > 網(wǎng)站 > WEB開發(fā) > 正文

26.11.打印頁(yè)眉和頁(yè)腳

2024-04-27 13:52:39
字體:
供稿:網(wǎng)友
26.11.1. 問題
我想打印出頁(yè)眉和頁(yè)腳
26.11.2. 解決辦法
創(chuàng)建打印渲染器組件控制頁(yè)面布局
26.11.3. 討論
結(jié)合打印渲染器的PrintDataGrid比PrintDataGrid自身具備更多的布局控制能力。常見的任務(wù)就是打印頁(yè)眉和頁(yè)腳。這個(gè)技術(shù)涉及是否在布局中包含頁(yè)眉和頁(yè)腳以及PrintDataGrid的validNextPage屬性的測(cè)試結(jié)果。下面的代碼,HeaderFooterPrintRenderer.mxml,定義了一個(gè)打印渲染器生成多頁(yè)打印內(nèi)容,包括在適當(dāng)位置的頁(yè)眉和頁(yè)腳:
+展開
-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>
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 科技| 齐河县| 吉水县| 英超| 石渠县| 当雄县| 南宁市| 湾仔区| 左云县| 东乌珠穆沁旗| 应城市| 巴塘县| 泰和县| 河北区| 申扎县| 苍山县| 敦化市| 浦江县| 丰台区| 陇西县| 梁山县| 广宗县| 巴里| 平江县| 朝阳市| 郁南县| 金沙县| 孟连| 梅河口市| 灌南县| 福清市| 南安市| 黄浦区| 丰镇市| 通渭县| 庆元县| 邛崃市| 新河县| 交城县| 开化县| 德安县|