Apache flex Flex-FlexPrintJob如何正确打印一组字段和PrintDataGrid?

Apache flex Flex-FlexPrintJob如何正确打印一组字段和PrintDataGrid?,apache-flex,printing,flash-builder,Apache Flex,Printing,Flash Builder,我正在尝试打印一个多页FlexPrintJob,第一页包括几个标签,然后是一个PrintDataGrid。它全部打印,除了PrintDataGrid仅使用所有页面上的一半页面进行打印 我知道这与我在第1页上打印的标签有关,因为去掉或隐藏标签会解决问题,网格会打印整页所有页面 我尝试了网格和标签周围的各种容器,包括VBox、VGroup、Group,并为一些容器指定了height=“100%”的不同组合 在第1页上打印半页的变量/标签,然后在同一页上启动数据网格(值半页),然后在接下来的页面上转到

我正在尝试打印一个多页FlexPrintJob,第一页包括几个标签,然后是一个PrintDataGrid。它全部打印,除了PrintDataGrid仅使用所有页面上的一半页面进行打印

我知道这与我在第1页上打印的标签有关,因为去掉或隐藏标签会解决问题,网格会打印整页所有页面

我尝试了网格和标签周围的各种容器,包括VBox、VGroup、Group,并为一些容器指定了height=“100%”的不同组合

在第1页上打印半页的变量/标签,然后在同一页上启动数据网格(值半页),然后在接下来的页面上转到整页,这是不可能的吗

这是我的打印作业代码:

   var printJob:FlexPrintJob = new FlexPrintJob();
    if (printJob.start()) {
var thePrintView:printViewEventUser = new printViewEventUser(); // Create a FormPrintView control as a child of the application.
        addElement(thePrintView);
                        thePrintView.width=printJob.pageWidth; 
                        thePrintView.height=printJob.pageHeight;
                        thePrintView.parentEncounter=parentEncounter;  //pass in my object for the labels to print
                        thePrintView._currentRec=_currentRec;  //pass in my object for the labels to print

                        thePrintView.myDataGrid.dataProvider = bedSearchEditList._recs;
                        thePrintView.showPage("single"); // Create a single-page image.
                        if(!thePrintView.myDataGrid.validNextPage) // If the print image's DataGrid can hold all the data provider's rows, add the page to the print job. 
                        {
                            printJob.addObject(thePrintView,FlexPrintJobScaleType.NONE);
                        }
                        else // Otherwise, the job requires multiple pages.
                        {
                            thePrintView.showPage("first"); // Create the first page and add it to the print job.
                            printJob.addObject(thePrintView);
                            thePrintView.pageNumber++;
                            while(true) //queue pages
                            {
                                thePrintView.myDataGrid.nextPage(); // Move the next page of data to the top of the PrintDataGrid.
                                thePrintView.showPage("last");   // Try creating a last page.
                                if(!thePrintView.myDataGrid.validNextPage) // 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.
                                {   
                                    printJob.addObject(thePrintView,FlexPrintJobScaleType.MATCH_WIDTH); // This is the last page; queue it and exit the print loop.
                                    break;
                                }
                                else // This is not the last page. Queue a middle page. 
                                {
                                    thePrintView.showPage("middle");
                                    printJob.addObject(thePrintView,FlexPrintJobScaleType.MATCH_WIDTH);
                                    thePrintView.pageNumber++;
                                }
                            }
                        }

                        removeElement(thePrintView);  

                }
                printJob.send(); // Send the job to the printer.

我的打印视图对象基本上只是一个围绕标签的对象,然后是一个PrintDataGrid

如果我没记错的话,我修复了过去类似的情况,在我的mx:PrintDataGrid中指定了一个minHeight属性,如下所示

<mx:PrintDataGrid id="printViewDataGrid" width="100%" minHeight="500">
...
</mx:PrintDataGrid>

...
祝你好运