Page 1 of 1

Print a Zoomed Chart

Posted: Wed Aug 02, 2006 7:47 pm
by 9641714
After I did a zoom on the chart, I want to print this zoomed chart. I have a print button to do this. But when I push this button, the chart is reloaded as a new chart that's zoomed once more, so did the print out image. I want the chart to be the previous one, how can I achieve this?

I had tried to modify a little bit of your GetChart.aspx.cs file to store the chartStream in a session and then get it to load to chart when do the printing, but it gives the error of: invalid binary format...

All the code I use are same with your sample, like use session variable to hold original chart stream and also the print methods.

Thanks for your help!
Jin

Posted: Thu Aug 03, 2006 8:08 am
by Chris

thanks but

Posted: Thu Aug 03, 2006 7:10 pm
by 9641714
Thanks for the reply, but this example does not use zoom at all. I think the scenerio I described is caused by using zoom. When print button does a post back, the zoom variables are submitted again so another zoom is done.
Is there someway to avoid the zoom being done again and just print out the chart of current?

thanks.
Jin

Posted: Fri Aug 04, 2006 6:39 am
by Chris
Hello,

Are you zooming programatically or letting your clients zoom within their browsers using the mouse button? If the latter, then the code in the post and hence the problem itself could be relevant.

If using the browser's print facilities (e.g. File -> Print) to print works OK with your zoomed chart, which it should, you could consider using an HTML button with JavaScript to print the page instead of an ASP.NET button and in this way you could avoid the post back.

thanks

Posted: Fri Aug 04, 2006 6:42 pm
by 9641714
Thanks for the message. I make it work by updaing session variable to hold always the latest chart. The javascript print works too but it also prints other info on the page, this way will print the chart only.

regards,
Jin