0 Replies Latest reply on Sep 16, 2009 9:31 PM by sathiyabala

    Hai  Shardul Singh Bartwal displaying grid values in PDF

    sathiyabala Level 1

      Hai  Shardul Singh Bartwal     

       

            I have converted the flex datagrid to PDF using Alive PDF, i can get the datas displayed in the PDF Format.

       

           My datagrid values are taken dynamically from db.


           But i have the headers of the datagrid in random way i.e not in alphabetical order, but in the PDF the headers are displayed in the  alphabetical order.


           This is my problem , i need it as such in the datagrid , how to change it...


           I have attached the sample code below.

        

          Can any one help me....


      Emergency pl

       
      Thanks in Advance

       

      var displayMode:String = Display.FULL_PAGE;   
      var howToOutput:String  = Download.ATTACHMENT;
      var howToResize:String = ResizeMode.NONE
      var serverScript:String = contextPath+"/CreatePDFServlet";  
      printPDF = new PDF(orientation, Unit.MM, Size.A4);
      printPDF.addPage();
      printPDF.setDisplayMode(displayMode, Layout.SINGLE_PAGE); 
      printPDF.textStyle(new RGBColor(0x000000));
      printPDF.setFont(FontFamily.HELVETICA,Style.BOLD);
      printPDF.setFontSize(08);
      printPDF.setXY(1,1);
      printPDF.setFontSize(12);
      printPDF.setMargins(10,10,10,10);
      printPDF.addText("Grid",07,07);
      printPDF.setFontSize(08);   
      var gridcollection:ArrayCollection  = girdid.dataProvider as ArrayCollection;
      var detailgrid:Grid = new Grid (gridcollection.toArray(),100,100, new RGBColor (0x778899), new RGBColor (0xFFFFFF), new RGBColor ( 0x0 ), false, new RGBColor ( 0x0 ));
      var gridcolumns:Array = new Array();
      var i:int;
      for(i=0;i<gridcollection.length;i++){
        gridcolumns[i]  =  new GridColumn(gridcollection[i],gridcollection[i],50,'L','L');
      }  
      printPDF.addGrid(detailgrid,printPDF,'ACD',0,0);         
      printPDF.save(Method.REMOTE, serverScript, howToOutput,'report.pdf');