tags:

views:

14

answers:

0

Hi,

I'm trying following print routine to print my advancedatagrid control ( with grouping enabled ) but few columns are not coming in a single page, they are appearing in another page.

Here is my code,

private function doPrint():void {
                // Create an instance of the FlexPrintJob class.
                var printJob:FlexPrintJob = new FlexPrintJob();

                // Initialize the PrintAdvancedDataGrid control.
                var printADG:PrintAdvancedDataGrid = new PrintAdvancedDataGrid();

              //  var printJob:FlexPrintJob = new FlexPrintJob();


                // Exclude the PrintAdvancedDataGrid control from layout.
                printADG.includeInLayout = false;
                printADG.source = dataGrid;

                // Add the print-specific control to the application.                
                addChild(printADG);

                // Start the print job.
                if (printJob.start() == false) {                
                    // User cancelled print job.
                    // Remove the print-specific control to free memory.                
                    removeChild(printADG);
                    return;
                }

                // Add the object to print. Do not scale it.
                printJob.addObject(printADG, FlexPrintJobScaleType.NONE);

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

                // Remove the print-specific control to free memory.                
                removeChild(printADG);
            }