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

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

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

2024-04-27 13:52:39
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
26.11.1. 問(wèn)題
我想打印出頁(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ā)表
主站蜘蛛池模板: 金阳县| 赤水市| 延寿县| 海原县| 浑源县| 淮北市| 会东县| 积石山| 玛沁县| 泰宁县| 射阳县| 西丰县| 中西区| 高陵县| 肥城市| 永善县| 安塞县| 乐安县| 虞城县| 牙克石市| 伊通| 龙川县| 合作市| 吉首市| 栾川县| 泰和县| 白朗县| 灌云县| 岳池县| 应城市| 射阳县| 高平市| 沐川县| 定南县| 白山市| 宜州市| 大邑县| 弥勒县| 深水埗区| 太仆寺旗| 康平县|