0 Replies Latest reply on May 23, 2007 4:22 AM by konkivo

    Printing a chart in many pages

      Hello everyone!! I was hoping someone could help me... here's the thing I'm trying to do:

      I have a column chart that its horizontal axis has a maximum of 42000 values. The problem is that if the user prints this chart it will show many values together and he couldn't see it well. So, I have implemented a HTTPService that populates the chart based in two parameters and I want to separate that chart in many charts with an interval of values. For example, first page: values from 0 to 200, second page: values from 200 to 400 and so on...
      For doing this I tried to call the HTTPService everytime I wanted a new interval of values, implementing its result event... but doesn't work!!! I'm not able to add to the PrintJob the chart that I re-populated with the new service.send() method, instead it prints the first chart o the last one many times!!! could someone help me please? here's my code:

      public function doPrint():void
      var of:int=0;
      var dis:int=200;
      printJob=new FlexPrintJob();

      //I want to print 4 charts (values from 0 to 800)
      while(i < 4)

      srv.url=" http://localhost:1937/Web/datosFlex.aspx?offset=" + of.toString() +
      "&distancia=" + dis.toString();

      var call:Object = srv.send();

      // Add a variable to the call object that is returned.
      // You can name this variable whatever you want.
      call.marker = "option1";





      catch (error:Error)
      mx.controls.Alert.show("<Error> " + error.message);



      // In a result event listener, execute conditional
      // logic based on the value of call.marker.
      private function resultHandler(event:ResultEvent):void {
      //mx.controls.Alert.show("dentro del evento Result");
      var call:Object = event.token;
      if (call.marker == "option1") {

      //mx.controls.Alert.show("ya tenemos respuesta");
      // Hundreds of milliseconds later, my results
      // have arrived, and I can add them to my list!
      this.resultado.text=this.resultado.text+" " + srv.url.toString();


      I tried everything, I wrote the PrintJob.addObject in the result event method but it shows an error. Also, I tried to save every new chart in an object array but it saves a referenfe to that chart, and I want to clone it, so I can print every position of the array (every chart).

      I don't know if I explained the problem right, hope you understand what I'm trying to say :) Can anyone help me please???