This content has been marked as final. Show 4 replies
If you want an exact reproduction of the displayed chart you can capture the display and send it to the server as a png or jpeg file. API for creating the PDF file depends of the server you use. Flex is only for the client side.
var bmp : BitmapData = new BitmapData ( chart.width, chart.height ) ;
bmp.draw ( chart ) ;
var png : ByteArray = PNGEncoder.encode( bmp ) ;
// here send png to your server....
Have a look to alivePDF which can create a PDF file from Flex on the client side.
However, what if there is no displayed chart for a particular data set on the client.
For example: Google Analytics displays the charts (they are using flex I am guessing). Plus, they also have a way to schedule sending these reports in email.
Now, when these reports are generated (at some later time) its all pure server side code. I am looking to solve this scenario.
Well Flex charts are components made to be interactive. I doubt that a server side solution implements the exact same visual aspect chart, but may be...
If you choose Flex to generate server side reports including charts, I think you are on the wrong road.
hmm .. no I think you misunderstand me.
1) I do want client (browser based) interactive flex charting.
2) However, I also want to be able to generate offline - server side reports in PDF that can be emailed - which should look - <b>as if </b> - a snapshot of the chart on the client was taken.
Google Analytics is doing it. They have live charts plus offline scheduled emailed reports containing snapshots of these charts. I dont know if they have some sort of a client emulation on the server side or something. I dont think they are creating separate images on the server - they are somehow taking a snapshot of the flex app on the server side in an image and to a PDF and then emailing that.