Components Flex



  
    
    import mx.collections.ArrayCollection;
    import mx.printing.FlexPrintJob;
    [Bindable]
    public var dp:ArrayCollection;
    private function initData():void{
      this.dp = new ArrayCollection();
      for(var i:Number=0; i<10; i++){
        this.dp.addItem({row:i,data:"item " + i});
      }
    }
    public function print():void {
      var printJob:FlexPrintJob = new FlexPrintJob();
      if(printJob.start()){
        printJob.addObject(printGrid);
        while(true) {
          printGrid.nextPage();
          if(!printGrid.validNextPage){
            printJob.addObject(printGrid);
            break;
          }
        }
        printJob.send();
      }
    }