Flex 4 动态组件打印错误
我有一组动态添加到我的 Flex 4 阶段的组件。
问题一: 将这些对象添加到打印时如何处理这些对象。我无法动态生成对象并附加它们,因为打印管理器不会等待动态数据填充。
我目前使用以下代码来动态处理失败的项目:
public function PrintDashPreview():void{
var ItemsDrawn:int = 0;
var printJob:FlexPrintJob = new FlexPrintJob();
if(printJob.start()){
for each (var item:Object in GetDashBoardPreviewItems.lastResult.DashboardItem)
{
ItemsDrawn ++
this.addElement(dashPreview["flexShape" + TheID]);
printJob.addObject(dashPreview["flexShape" + TheID]);
this.removeElement(dashPreview["flexShape" + TheID]);
}
printJob.send()
Alert.show('Sent: ' + ItemsDrawn + ' items to page for printing.','Print Progress Debug');
}
}
如何告诉 Flex 获取这些特定项目并将它们添加到打印作业中。
问题 2:
我如何告诉 flex 将每页的每个项目放在另外 2 个项目的下面。
请并感谢您提供的任何帮助。
问候 克雷格·麦克
I have a set of components that are added to my Flex 4 stage dynamically.
Problem 1:
How do I address these objects when adding them to print.I cant generate objects on the fly and append them because then the print manager does not wait for the dynamic data to populate.
I currently use the following code to address items dynamically which fails:
public function PrintDashPreview():void{
var ItemsDrawn:int = 0;
var printJob:FlexPrintJob = new FlexPrintJob();
if(printJob.start()){
for each (var item:Object in GetDashBoardPreviewItems.lastResult.DashboardItem)
{
ItemsDrawn ++
this.addElement(dashPreview["flexShape" + TheID]);
printJob.addObject(dashPreview["flexShape" + TheID]);
this.removeElement(dashPreview["flexShape" + TheID]);
}
printJob.send()
Alert.show('Sent: ' + ItemsDrawn + ' items to page for printing.','Print Progress Debug');
}
}
How can I tell flex to grab these specific items and add them to the print job.
Problem 2:
How do I tell flex to lay each item out one below the other 2 per page.
Please and thank you for any help you can provide.
Regards
Craig Mc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
打印动态内容的方法通常是这样的:
(1) 启动打印作业:
(2) 获取打印页面尺寸。如果内容溢出,请使用它:
(3) 创建所有动态对象并等待相应的 CREATION_COMPLETE 事件:
(4) 等待所有 CREATION_COMPLETE 事件:
(5 ) 打印页面:
The recipe for printing dynamic content usually goes like this:
(1) Start the printJob:
(2) Obtain the print page dimensions. Use it if you have overflowing content:
(3) Create all of the dynamic objects and wait for the corresponding CREATION_COMPLETE events:
(4) Waiting for all CREATION_COMPLETE events:
(5) Print the pages: