<?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" backgroundColor="#FFFFFF" fontFamily="simsun" fontSize="12" paddingTop="50" paddingBottom="50" paddingLeft="30" paddingRight="30" height="268" width="748"> <mx:Script> <![CDATA[ import mx.controls.DateField; import mx.core.* import mx.collections.ArrayCollection; import mx.printing.*; [Bindable] private var pageNumber:Number = 1; [Bindable] private var prodTotal:Number = 0; [Bindable] private var reportTitle:String = "报表标题"; [Bindable] private var datetime:String = ""; public static var footerHeight:Number = 20; public static var prodIndex:Number; public static var prodTotal:Number = 0; public static function doPrint(datap:Object,title:String,columns:Array):void { var printJob:FlexPrintJob = new FlexPrintJob(); if (printJob.start()) { var thePrintView:FormPrintView = new FormPrintView(); Application.application.addChild(thePrintView); thePrintView.reportTitle = title; thePrintView.datetime = mx.controls.DateField.dateToString(new Date(),"YYYY年MM月DD日"); thePrintView.printDataGrid.columns = columns; thePrintView.width=printJob.pageWidth; thePrintView.height=printJob.pageHeight; thePrintView.prodTotal = (datap as ArrayCollection).length; thePrintView.printDataGrid.dataProvider = datap;//设置数据v thePrintView.showPage("single"); if(!thePrintView.printDataGrid.validNextPage){ printJob.addObject(thePrintView); } else{ thePrintView.showPage("first"); printJob.addObject(thePrintView); thePrintView.pageNumber++; while(true){ thePrintView.printDataGrid.nextPage(); thePrintView.showPage("last"); if(!thePrintView.printDataGrid.validNextPage) { printJob.addObject(thePrintView); break; } else{ thePrintView.showPage("middle"); printJob.addObject(thePrintView); thePrintView.pageNumber++; } } } Application.application.removeChild(thePrintView); } printJob.send(); } private function showPage(pageType:String):void { if(pageType == "first" || pageType == "middle") { footer.includeInLayout=false; footer.visible = false; } if(pageType == "middle" || pageType == "last") { header.includeInLayout=false; header.visible = false; } if(pageType == "last") { // Show the footer. footer.includeInLayout=true; footer.visible = true; } //Update the DataGrid layout to reflect the results. validateNow(); } ]]> </mx:Script> <!-- The template for the printed page, with the contents for all pages. --> <mx:VBox width="100%" horizontalAlign="left"> <mx:Label text="第 {pageNumber}页" color="#9e9e9e"/> <mx:Label id="header" text="{reportTitle}" fontWeight="bold" fontSize="21" textAlign="center" width="100%"/> <mx:HRule width="100%" height="1" strokeColor="#000000"/> </mx:VBox> <mx:PrintDataGrid id="printDataGrid" width="100%" height="100%" fontFamily="simsun" fontSize="12"/> <mx:VBox width="100%" horizontalAlign="left" id="footer" > <mx:Spacer height="100%"/> <mx:HRule width="100%" height="1" strokeColor="#000000"/> <mx:HBox width="100%"> <mx:Label text="记录总数:{prodTotal}"/> <mx:Spacer width="100%"/> <mx:Label text="打印日期:{datetime}"/> </mx:HBox> </mx:VBox> </mx:VBox> headerText=(_view.main._dataGrid._mainData.columns[event.columnIndex] as DataGridColumn).headerText; if (headerText == "Vol(B)" || headerText == "Px(B)" || headerText == "CP(B)") { var pt:Point=UIUtils.idbGlobalToContent(event, event.localX, event.localY); var _headHeight:int=(event.currentTarget as DataGrid).headerHeight; if (pt.y < _headHeight) { return; } var tableHeaderText:String=(_view.main._homeOffer._topDG.columns[event.columnIndex] as DataGridColumn).headerText; if(tableHeaderText == "代码"||tableHeaderText == "简称"){ _view.main._homeOffer._topDG.selectedItem as BondOfferVO; }else{ bondEdit(BondRate.EDIT_TYPE); }
相关推荐
Flex 打印 例子 Flex 打印 例子 Flex 打印 例子
flex 打印源代码
关于Flex自带的打印及打印功能,代码较全,较容易理解。不错的资源!
Flex打印预览,本人找N久才找到希望能给朋友们帮上忙
flex 打印控件 应该说是相当完美了。 但只能够用于grid打印和打印预览
flex打印机制,使用flex内置打印容器类解决打印问题。
flex 打印预览
flex 打印小实例源码,已经测试过的,希望能对大家有所帮助。
有两个ArcGis实现的打印功能,以及使用的包,及查看例子的地址等.是自己做时的总结
FlexReport.zip,这个是Flex的打印程序
NULL 博文链接:https://goby2008.iteye.com/blog/836201
NULL 博文链接:https://shuaiqixiao4.iteye.com/blog/650162
FLEX内存释放优化原则,内存泄露解决方法,内存泄露情况
如果要使用分页效果,则必须使用标签"PrintAdvancedDataGrid"(Flex3中的标签)才能够实现分页效果,感兴趣的朋友可以参考下
第8章 Flex打印 265 8.1 Web打印方案 265 8.1.1 原生打印 265 8.1.2 宿主打印 265 8.1.3 外部打印 266 8.2 为什么使用Flex来打印 267 8.3 使用PrintJob打印 267 8.4 深入了解PrintJob 268 8.5 实战PrintJob...
本人从其他网站上下载的,333页全,看到CSDN上没有完整的版本,所以共享一下。...第8章 Flex打印 第9章 Flex企业应用性能优化 第10章 Flex企业应用开发的其他技术 附录 Flex Builder 中的项目如何迁移至Flash Builder
本人从其他网站上下载的,333页全,看到CSDN上没有完整的版本,所以共享一下。...第8章 Flex打印 第9章 Flex企业应用性能优化 第10章 Flex企业应用开发的其他技术 附录 Flex Builder 中的项目如何迁移至Flash Builder
ArcGIS FlexViewer 中只提供了打印功能但没有打印预览功能,该代码包将为你提供真实的打印预览。
关于Flex中各种图形的例子 LineChart Columnchart Areachart Bubblechart Barchart 的例子 数据从后台的Java类获取 也可以从数据库获取