2 Replies Latest reply on Jul 19, 2011 11:55 AM by Shravan P

    How can i print a AdvancedDataGrid in multiple pages with ColumnHeaders?

    Shravan P

      Hi all,

       

      I need to print a AdavancedDataGrid in multiple pages with columnheaders in all pages.

       

      Rite now, i can able to print column headers in first page only.

       

      is there any chance to split the ADG into multiple pages with columnheaders??

       

      Thanks in Advance

      Shravan.

        • 1. Re: How can i print a AdvancedDataGrid in multiple pages with ColumnHeaders?
          ShardulSingh Level 3

          HI,

           

           

          You should take one another in the background some where else means it should not be visible on the screen with the same filed of your origional grid.

          Now on click of the print button fill that datagrid by say 30 rows of the main datagrid and print it.Now repeate the same thing till all the rows of your origional datagrid gets printed by using the looping.

           

          with Regards,

          Shardul

          1 person found this helpful
          • 2. Re: How can i print a AdvancedDataGrid in multiple pages with ColumnHeaders?
            Shravan P Level 1

            Shardul,

             

            Thanks for your help.

             

            Your logic is working fine when i have a single datagrid.

             

            What i'm doing here is, i took a VBox(playout) and printing 2 ADG's in that,so the column headers of 2nd ADG are not printing when it continues to next page.

             

            Here is the sample code:

             

            custComp1

            custComp2 are ADG's

             

            <mx:VBox id="playout" width="100%" visible="false" includeInLayout="false"></mx:VBox>

             

            private function preparePrint():void{

             

            var x:custComp1 = new custComp1();

            var y:custComp2 = new custComp2();

             

            x.dataProvider = arrayColl1;

            playout.addChild(x);

             

            if(arrayColl2 >=1){

             

            playout.addChild(y);

            y.dataprovider = arryColl2;

             

            while(y.adg.validNextPage){

            playout.addChild(y);

            y.adg.nextPage();

            }

             

            }

             

             

            private function doPrint(event:Event):void{

             

            var printJob:FlexPrintJob = new FlexPrintJob();

             

            if(printJob.start()) {

            playout.includeInLayout = true;

            playout.visible = true;

             

            printJob.addObject(playout);

             

            printJob.send();

            playout.visible = false;

            playout.includeInLayout = false;

            }

             

             

            is there any way to get column headers when we use printing multiple ADG's in a VBox?