Easiest way is to create a custom component representing the page you want
to print. Example code, using component called ChartsPrint:

 

public function print2():void{

                        var printJob:FlexPrintJob=new FlexPrintJob();

                        if(printJob.start()){

                              var printView:ChartsPrint=new ChartsPrint(); 

                              Alert.show("Print Start","");

                              addChild(printView);

                              printView.height=1200;

                              printView.width=900;


 
printView.mainPieChart.dataProvider=mainPieChart.dataProvider;

 
printView.chrtTotalEquity.dataProvider=chrtTotalEquity.dataProvider;

 
printView.chrtPayments.dataProvider=chrtPayments.dataProvider;


 
printJob.addObject(printView,FlexPrintJobScaleType.SHOW_ALL);


                              printJob.send();                          

                              removeChild(printView);

                              

                        }

                  }

 

The three charts (mainPieChart, chrtTotalEquity, chrtPayments) created just
by pasting code from main app into the ChartPrint component, changing some
formatting, removing dataProviders and effects, and generally laying it out
for printing. DataProviders supplied when the print function is called, as
you see. You can similarly set values for labels, text, etc. in the
component.

Reply via email to