国产探花免费观看_亚洲丰满少妇自慰呻吟_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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 淮安市| 台山市| 聊城市| 炎陵县| 潞城市| 新绛县| 云南省| 沂水县| 浑源县| 江源县| 西平县| 彭泽县| 化州市| 荔波县| 建德市| 康平县| 嘉定区| 措美县| 湘阴县| 永清县| 桃江县| 栾川县| 布拖县| 怀宁县| 佛冈县| 治县。| 芷江| 高碑店市| 秭归县| 鲁山县| 昆山市| 连江县| 宁德市| 木兰县| 崇礼县| 稻城县| 新兴县| 涪陵区| 龙门县| 通道| 黎平县|