1 Reply Latest reply on Oct 6, 2008 7:35 AM by Newsgroup_User

    [SOLVED]Using FlexPrintJob makes Pie Chart disappear!

    _apk
      Hi,
      I have a button that, once clicked by the user will let him to print one pie chart that is inside a <mx:VBox id="chart" >.
      On button click, flex will call this function:
      private function doPrint():void {
      var myPrintJob:FlexPrintJob=new FlexPrintJob();
      myPrintJob.start();
      myPrintJob.addObject(grafici);
      myPrintJob.send();
      }

      # SOLUTION
      The solution is to check the return value of the myPrintJob.start() method:
      if (myPrintJob.start() != true) return;

      The problem is this:
      If I don't have already configured a printer on my Windows pc, a Windows "alert" will pop-up, telling the user if he want to add a new printer... If I select "No" to that answer (or simply close the pop-up) and then close the window where you can choose/configure the printer too, the chart will disappear from the page, and I have to reload the page to make it appear again.

      What am I doing wrong? I suspect that this is a bug, but before filing a bug, I prefer to ask here.
      Regards,
      Gabriele
        • 1. Re: Using FlexPrintJob makes Pie Chart disappear!
          Level 7

          "_apk" <webforumsuser@macromedia.com> wrote in message
          news:gccerq$3f6$1@forums.macromedia.com...
          > Hi,
          > I have a button that, once clicked by the user will let him to print one
          > pie
          > chart that is inside a <mx:VBox id="chart" >.
          > On button click, flex will call this function:
          > private function doPrint():void {
          > var myPrintJob:FlexPrintJob=new FlexPrintJob();
          > myPrintJob.start();
          > myPrintJob.addObject(grafici);
          > myPrintJob.send();
          > }
          >
          > The problem is this:
          > If I don't have already configured a printer on my Windows pc, a Windows
          > "alert" will pop-up, telling the user if he want to add a new printer...
          > If I
          > select "No" to that answer (or simply close the pop-up) and then close the
          > window where you can choose/configure the printer too, the chart will
          > disappear from the page, and I have to reload the page to make it appear
          > again.
          >
          > What am I doing wrong? I suspect that this is a bug, but before filing a
          > bug,
          > I prefer to ask here.
          > Regards,
          > Gabriele

          I think in the printing docs there's a certain amount of error checking
          you're supposed to do to prevent this, but I'd have to go back and read it
          too to give you specifics :-)