首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flash Builder (FlexPrintJob & PrintDataGrid) Chrome Shockwave错误

Flash Builder (FlexPrintJob & PrintDataGrid) Chrome Shockwave错误
EN

Stack Overflow用户
提问于 2016-01-06 16:36:00
回答 1查看 90关注 0票数 0

我有一个使用Flex4.6.0SDK的mx:应用程序,而且我只在Chrome中遇到了一些FlexPrintJob问题。FlexPrintJob在chrome中运行良好,直到几周前(我没有对代码做任何更改),现在我开始体验“Shockwave Crashes”。

在打印时,我使用:

  • 第一个标题页模板
  • 处理DataGrid的中间部分模板。这是使用PrintDataGrid并循环通过dataProvider来查看数据是否适合于一个页面,如果不是,它将创建另一个页面。
  • 最后一页模板

Problem:我已经把范围缩小到这一点,当数据(中间部分)超过一个页面并尝试创建另一个页面时,我会得到铬中的Shockwave崩溃错误。这才刚刚开始,我猜是用一个铬更新的…对不起,如果我遗漏了一些东西,而且我的描述缺乏细节。如果需要的话,我可以补充更多的说明。

有什么好主意吗?

谢谢!

-moe

代码语言:javascript
复制
public function doPrint(): void {
    // Create a FlexPrintJob instance.


    var printJob: FlexPrintJob = new FlexPrintJob();

    // Start the print job.
    if (printJob.start()) {
        // Create a FormPrintView control as a child of the application.
        var thePrintView: FormPrintView = new FormPrintView();

        addElement(thePrintView);

        // Set the print view properties.
        thePrintView.width = printJob.pageWidth;
        thePrintView.height = printJob.pageHeight;
        thePrintView.horizontalAlign = "center";

        // Set the data provider of the FormPrintView  component's DataGrid to be the data provider of the displayed DataGrid.
        thePrintView.summaryGrid.dataProvider = summaryGrid.dataProvider;

        // Create a single-page image.
        thePrintView.showPage("single");

        // If the print image's DataGrid can hold all the  data provider's rows, add the page to the print job. 
        if (!thePrintView.summaryGrid.validNextPage) {
            printJob.printAsBitmap = false;
            printJob.addObject(UIComponent(mainPagePrint), FlexPrintJobScaleType.MATCH_WIDTH);
            printJob.addObject(thePrintView);
            printJob.addObject(UIComponent(terms), FlexPrintJobScaleType.MATCH_WIDTH);
        }
        // Otherwise, the job requires multiple pages.
        else {
            // Create the first page and add it to the print job.
            thePrintView.showPage("first");
            printJob.printAsBitmap = false;
            printJob.addObject(UIComponent(mainPagePrint), FlexPrintJobScaleType.MATCH_WIDTH);
            printJob.addObject(thePrintView);

            thePrintView.pageNumber++;

            // Loop through the following code  until all pages are queued.
            while (true) {
                // Move the next page of data to the top of the PrintDataGrid.
                thePrintView.summaryGrid.nextPage();
                printJob.printAsBitmap = false;
                // Try creating a last page.
                thePrintView.showPage("last");

                // If the page holds the remaining data, or if the last page was completely filled by the last   grid data, queue it for printing.
                // Test if there is data for another  PrintDataGrid page.
                if (!thePrintView.summaryGrid.validNextPage) {
                    // This is the last page; queue it and exit the print loop.
                    printJob.addObject(thePrintView);
                    printJob.addObject(UIComponent(terms), FlexPrintJobScaleType.MATCH_WIDTH);
                    break;
                } else // This is not the last page. Queue a middle page. 
                {
                    thePrintView.showPage("middle");
                    printJob.addObject(thePrintView);
                    thePrintView.pageNumber++;

                }
            }
        }
        // All pages are queued; remove the FormPrintView control to free memory.
        removeElement(thePrintView);
    }
    // Send the job to the printer.
    printJob.send();

}
EN

回答 1

Stack Overflow用户

发布于 2016-01-06 19:40:15

最后,我一个接一个地拆开了东西,弄明白了它是什么--问题是FormPrintView。我的PrintDataGrid中有一些不需要的属性,我认为这些属性最初是从我的应用程序中的主数据集复制的。

我不知道为什么它以前起作用了,现在才开始崩溃,但不管怎样,我本来就不应该有一些这样的财产。

谢谢!

-moe

代码语言:javascript
复制
<mx:PrintDataGrid  id="summaryGrid" width="100%" height="100%" sizeToPage="true"
                  alternatingItemColors="[#f7f7f7, #ffffff]" alpha="0.8"
                  borderStyle="solid" borderThickness="1" color="#646262"
                  creationComplete="summaryGrid_creationCompleteHandler(event)" fontSize="9"
                  headerColors="[#ffffff, #e8e8e8]" headerHeight="25" paddingTop="5"
                  rowHeight="55" textAlign="center" wordWrap="true" paddingRight="-1" >
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34638084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档