BV-EII Report post Posted December 15, 2010 I have a chart loading in a ModalPopup in an asp.net application. My client wants to have a button to print the chart instead of right clicking on chart to print it. Is there way to access "Print It" menu using javascript. If yes then please share the code Share this post Link to post Share on other sites
Guest Angie Report post Posted December 15, 2010 Hi, Welcome to FusionCharts Forum! Please refer to the link below for more information: http://www.fusioncharts.com/docs/?JavaScript/JS_PrintManager.html Hope this helps! Share this post Link to post Share on other sites
BV-EII Report post Posted December 15, 2010 Thanks Angie for reply. But I am not finding FusionCharts.printManager class in FusionChart.js. Its throwing error for me. Please let me know if I have to download any new version of JS file to use this feature. Hi, Welcome to FusionCharts Forum! Please refer to the link below for more information: http://www.fusioncha...intManager.html Hope this helps! Share this post Link to post Share on other sites
BV-EII Report post Posted December 15, 2010 Angie I downloaded the eval version got the latest script file. Now it could load the printManager class. Now on button click in IE it working window.print(), printing everything on page and in firefox no chart. Any idea on this issue. Thanks Angie for reply. But I am not finding FusionCharts.printManager class in FusionChart.js. Its throwing error for me. Please let me know if I have to download any new version of JS file to use this feature. Share this post Link to post Share on other sites
Guest Angie Report post Posted December 16, 2010 Hi, Could you please send us a screenshot to look into the issue? Awaiting for your reply. Share this post Link to post Share on other sites
BV-EII Report post Posted December 17, 2010 Hello Angie, I am attaching 6 files. 1. TEST-IE-PAGE.JPG : This is how page looks on Internet explorer. Chart is loading on a ModalPopupExtender. I have print button which calling the javascipt as mentioned on link. 2. TEST-IE-Print.JPG : This is how it is getting printed from IE. Basically it is printing as we get from window.print (not just the chart). It is printing everything printable on the page along with the chart. 3. TEST-FIREFOX-PAGE.JPG : This is how page looks on Firefox . 4. TEST-Firefox-Print.JPG : This is how it is getting printed from Firefox. It prints everything on page but chart. 5. TEST-IE-RightClick-Print.JPG 6.TEST-Firefox-RightClick-Print.JPG My requirement is to print just the chart not everything on the page as we can achieve using Right Clicking on chart. I have attached sample image 5 & 6 . Thank you for your help. Hope you will help me find a solution. Hi, Could you please send us a screenshot to look into the issue? Awaiting for your reply. Share this post Link to post Share on other sites
FusionCharts Support Report post Posted December 31, 2010 Hi, You would need to wait for a bit to let the print manager make the chart ready for print. You can trap event when the print manager become ready. This is a sample that shows how you can trap this event: <html> <head> <title>FusionCharts Print Manager</title> <script type="text/javascript" src="FusionCharts/FusionCharts.js"></script> </head> <body> <div id="chartContainer">FusionCharts will load here!</div> <script type="text/javascript"><!-- FusionCharts.printManager.enabled(true); var myChart = new FusionCharts( "FusionCharts/Column3D.swf", "myChartId", "400", "300", "0", "1" ); myChart.setXMLUrl("Data.xml"); myChart.render("chartContainer"); FusionCharts.addEventListener ( FusionChartsEvents.PrintReadyStateChange , function (identifier, parameter) { if(parameter.ready){ alert("Chart is now ready for printing."); document.getElementById('printButton').disabled = false; } }); // --></script> <input type="button" onclick="FusionCharts.printManager.managedPrint()" value="Managed Print" disabled="disabled" id="printButton" > </body> </html> You can try this sample live from :http://www.fusioncharts.com/Code/JavaScript/Basics/ManagedPrintForMozilla/ManagedPrintingInMozillaBrowsers.html And Documentation on : http://www.fusioncharts.com/docs/?JavaScript/JS_PrintManager.html Share this post Link to post Share on other sites