0 Replies Latest reply on Aug 1, 2011 2:03 PM by ^^GOUST^^

    FlexReport export pdf with AlivePDF

    ^^GOUST^^ Level 1

      hi guys
      I have a little problem.

      Many may have already used the known FlexReport.
      Well then, on the side of the Print button is a button to export PDF which I am not able to run.

      What I can do so far was to import the swc AlivePDF into the project.

       

      I wonder what is the name claque pdf export button so that I can invoke the click event to call the method which is in review.

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="900" height="590" xmlns:print="org.print.*"
          showCloseButton="true" close="{PopUpManager.removePopUp(this);}">
          <mx:Style>
              ToggleButtonBar {
         buttonStyleName: "mytoggleButtonBarButtonStyle";
         firstButtonStyleName: "mytoggleButtonBarFirstButtonStyle";
         lastButtonStyleName: "mytoggleButtonBarLastButtonStyle";
         selectedButtonTextStyleName: "mytoggleButtonBarSelectedButtonStyle";
      }

       

      .mytoggleButtonBarButtonStyle {
         fillAlphas: 1, 1, 1, 1;
         fillColors: #333333, #000000, #999999, #333333;
         color: #ffffff;
         textRollOverColor: #99ff00;
         themeColor: #ff6600;
      }

       

      .mytoggleButtonBarFirstButtonStyle {
      }

       

      .mytoggleButtonBarLastButtonStyle {
      }

       

      .mytoggleButtonBarSelectedButtonStyle {
      }
      Button {
         fillAlphas: 1, 1, 0.75, 0.65;
         fillColors: #333333, #000000, #000000, #333333;
         color: #ffffff;
         textRollOverColor: #ffffff;
         borderColor: #666666;
         themeColor: #ffffff;
      }
          </mx:Style>

       

          <mx:Script>
              <![CDATA[
                  import mx.managers.PopUpManager;
                 
                 
                  /*
                   import org.alivepdf.pdf.PDF;
                  import org.alivepdf.layout.Orientation;
                  import org.alivepdf.layout.Size;
                  import org.alivepdf.layout.Unit;
                  import org.alivepdf.display.Display;
                  import org.alivepdf.saving.Method;
                  import org.alivepdf.fonts.FontFamily;
                  import org.alivepdf.fonts.Style;
                  import org.alivepdf.colors.RGBColor;
                 
                  private var myPDF:PDF;

       

                  public function generatePDF ( e:MouseEvent )
                  {
                      // we create the PDF
                      myPDF = new PDF(  Orientation.PORTRAIT, Unit.MM, Size.LETTER );
                      // we set the zoom to 100%
                      myPDF.setDisplayMode ( Display.FULL_WIDTH );
                     
             
                      // we add a page
                      myPDF.addPage();
                     
                      // to save the PDF your specificy the path to the create.php script
                      // alivepdf takes care of the rest, if you are using AIR and want to save the PDF locally just use Method.LOCAL
                      // and save the returned bytes on the disk through the FileStream class
                      myPDF.savePDF( Method.REMOTE, "http://alivepdf.bytearray.org/wp-content/demos/create.php", "drawing.pdf" );
                     
                  }*/
              ]]>
          </mx:Script>
          <print:Preview id="reportCaixa" width="100%" height="100%">
          </print:Preview>
      </mx:TitleWindow>