Flex 4 PrintDataGrid validNextPage 不起作用
我正在尝试为 Flex 创建一个报告查看器。 报告将从 PrintDataGrid 构建,因为它是 Flex 中唯一通过 validNextPage 和 nextPage() 支持多页的组件。
基本上,我试图通过以下代码填充报告页面的集合:
var index:int = 0;
dataProvider = new ArrayCollection();
do {
var rep:Report = new Report();
rep.height = 841;
rep.width = 595;
rep.pageNumber = index + 1;
var i:int = index;
while (i > 0) {
rep.nextPage();
i--;
}
dataProvider.addItem(rep);
index++;
} while (rep.validNextPage);
我的问题是我陷入了无限循环,因为 validNextPage 始终返回 true。 我正在尝试做一些不可能的事情吗?我看到了一些将报告页面添加到 FlexPrintJob 的示例,但我从未见过将报告页面添加到屏幕上的组件的示例。
我遇到的另一个问题是,该报告应该是动态的(可排序),但我无法将相同的报告添加到两个父级,因此我在每次迭代时创建一个新报告(但这在我尝试对报告进行排序时会出现问题)因为我将有此报告的几个实例)
有人知道如何做到这一点吗?
I'm trying to create a report viewer for flex.
The reports will be built from a PrintDataGrid since it's the only component in flex that supports multi-pages through validNextPage and nextPage().
Basically, I'm trying to populate a collection of the report pages through the following code:
var index:int = 0;
dataProvider = new ArrayCollection();
do {
var rep:Report = new Report();
rep.height = 841;
rep.width = 595;
rep.pageNumber = index + 1;
var i:int = index;
while (i > 0) {
rep.nextPage();
i--;
}
dataProvider.addItem(rep);
index++;
} while (rep.validNextPage);
My problem is that I get stuck in an endless loop since validNextPage returns true all the time.
Am I trying to do something impossible? I saw some examples of adding a report page to FlexPrintJob but I've never seen an example of adding a report page to a component on the screen.
Another issue that I have is that this report should be dynamic (sortable) but I can't add the same report to 2 parents, hence I create a new Report on every iteration (but that will become problematic as I try to sort the report since i'll have several instances of this report)
Anyone has any idea how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你能提供更多的代码吗?例如,Report 对象是什么?
您还可以在此处。
could you provide more code. What is the Report object for example?
You can also check Adobe's website about Printing Multipage Output here.