What result do you get?  No second page or second page is same as first?  If 
the latter, try calling validateNow() after nextPage()


On 9/5/12 12:21 PM, "Sells, Fred" <fred.se...@adventistcare.org> wrote:






I’m using the printdatagrid control and can print one page just fine, but 
cannot get the second page to print.  The code below is a bit hacked from 
trying to apply Adobe’s examples, which I cannot translate to my problem.  Any 
help would be appreciated…

                private function print():void             {
                       var printJob:FlexPrintJob = new FlexPrintJob();

                       //start the print job
                      if(printJob.start())                      {
                             printJob.addObject(printcontainer);
                             //printJob.addObject(printDataGrid);
                             printDataGrid.nextPage();
                              printJob.addObject(printDataGrid);
                             while(printDataGrid.validNextPage)                 
         {

                                    printDataGrid.nextPage();
                                   printJob.addObject(printDataGrid);
                              }
                             printJob.send();
                              printDataGrid.dataProvider = Appointments; 
//needed to reset for next time.
                        }
                  }


     <mx:VBox id="printcontainer"  width="100%" height="1450"  
backgroundAlpha="1.0" backgroundColor="white"
                  paddingLeft="20" paddingRight="20" paddingTop="50"
                  borderThickness="20" verticalAlign="top" 
horizontalAlign="center"
                  visible="false"  includeInLayout="false">
           <mx:Label id="PageHeader" fontSize="24"  textAlign="center"   
fontWeight="bold"
                          text="{picker.selectedItem.nickname} on 
{String(Globals.SelectedDate).substr(0,10)}.
                          />

           <mx:PrintDataGrid  id="printDataGrid" dataProvider="{Appointments}" 
fontSize="12"  >
                 <mx:columns>
                       <mx:DataGridColumn  headerText="Start"   
dataField="starttime" width="80" textAlign="right"/>
                        …






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui

Reply via email to