国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 泰和县| 鄄城县| 镇安县| 陆川县| 石景山区| 萨迦县| 阜新市| 历史| 平原县| 伊金霍洛旗| 和林格尔县| 沿河| 修水县| 温宿县| 盖州市| 鸡东县| 浠水县| 江北区| 阳城县| 惠东县| 富顺县| 民县| 敖汉旗| 南乐县| 吴堡县| 淮阳县| 武清区| 修水县| 临邑县| 青州市| 基隆市| 凤台县| 东安县| 商南县| 理塘县| 潍坊市| 乐山市| 黑龙江省| 长丰县| 台东县| 象州县|