Hello,

i know, there was already something questions about using the 
PrintDataGrid but they can't help me.

I have already tests the demos on the livedocs, but i have not the 
result, that i want.

I use the PrintDataGrid not included in the layout with a 
dataprovider of a visibile DataGrid.

<mx:PrintDataGrid width="65%"  id="PrintGrid" wordWrap="true" 
backgroundColor="#000000" fontSize="8" visible="false" 
labelFunction="lfnGeneral" >
...

After pressing the print button i set the attribute like in the 
livedocs or posts, that found here and about search engines ;)
But on the printouts i have different spacings to the bottom of the 
page or data are cut off.

Following Code is my Printfunction:

        var myPrintDataGrid :PrintDataGrid = new PrintDataGrid;
        var myPrintJob = new FlexPrintJob();
        
        if (myPrintJob.start()) 
        {
                myPrintDataGrid = this.PrintGrid;
                myPrintDataGrid.width = myPrintJob.pageWidth;
                myPrintDataGrid.height = myPrintJob.pageHeight;
                myPrintDataGrid.sizeToPage = true;
                myPrintDataGrid.dataProvider = 
this.InhabitantGrid.dataProvider;
                myPrintDataGrid.visible = false;
                myPrintDataGrid.includeInLayout = false;
                myPrintDataGrid.variableRowHeight = true;
                
                if(!myPrintDataGrid.validNextPage) {
                        myPrintJob.addObject(myPrintDataGrid);
                }
                 else 
                        {
                        myPrintJob.addObject(myPrintDataGrid);
                
                        while(true) 
                        {
                                myPrintDataGrid.nextPage();
        
                                if(!myPrintDataGrid.validNextPage) 
                                {
                                        myPrintJob.addObject
(myPrintDataGrid);
                                        validateNow();
                                        break;
                                } 
                                else 
                                {
                                        myPrintJob.addObject
(myPrintDataGrid);
                                }
                        }
        
                }
        
                myPrintJob.send();
        }
        
Can anybody help me?

Thx

Matze

Reply via email to