mravikrish Report post Posted August 2, 2010 Hi All, I want to download the chart without right clicking on it , is there any function which i can call to save the chart as respective mediums. Thanks in advance. Ravi Krish Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted August 2, 2010 Hi, Please try calling a function, where :- 1) You first you need get the chart id using getChartFromId method 2) Then you need to call the exportChart function using the chart id. Ref.- <script type="text/javascript"> function ExportMyChart() { var chartObject = getChartFromId('myChart'); if( chartObject.hasRendered() ) chartObject.exportChart(); } </script> For further details please refer to the link below :- Ref.- http://www.fusioncharts.com/docs?/ECJavaScript.html Hope this helps. Share this post Link to post Share on other sites
mravikrish Report post Posted August 3, 2010 Hi Basundhara Ghosal, Thanks for your quick response. I was able to capture the screen but it is not downloading the chart which doesnt shows popup message to save the file after capturing the chart 100%. Could u suggest me for further processing. function ExportMyChart() { var chartObject = getChartFromId('chart'); if( chartObject.hasRendered() ){ chartObject.exportChart( { exportAtClient: '1', exportFormat: 'PDF' } ); } } Regards, Ravi Krish Share this post Link to post Share on other sites
Guest Rajroop Report post Posted August 3, 2010 Hey Ravi, Could you please ensure that you are using Flash Player version 10 for this? Also, do check whether you have the registerWithJS parameter set for the chart? Ref.- http://www.fusioncharts.com/docs/?JS_Overview.html I hope this helps. Share this post Link to post Share on other sites
mravikrish Report post Posted August 3, 2010 Hi Rajroop, Thanks for response,its working fine when right click on the chart but its not working when i use the download button. Regards, Ravi Krish. Share this post Link to post Share on other sites
Guest Rajroop Report post Posted August 3, 2010 Hey, Could you send us a snap-shot of the error you are viewing when you press the download button? Looking forward to your response. Share this post Link to post Share on other sites
mravikrish Report post Posted August 3, 2010 (edited) Hi Rajroop, I'm not getting any error instead page is getting refreshed after completing 100% capturing. Regards, Ravi Edited August 3, 2010 by Guest Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted August 3, 2010 Hi Ravi, Could you please send us the code as an attachment? Awaiting your reply. Share this post Link to post Share on other sites
mravikrish Report post Posted August 3, 2010 (edited) Hi Team, Here is my code .Suggest me where im wrong. function ExportMyChart() { var chartObject = getChartFromId('chart1'); if( chartObject.hasRendered() ){ chartObject.exportChart( { exportAtClient: '1', exportFormat: 'PDF' } ); } } In Body <% String strXML=(String)session.getAttribute("XML"); System.out.println("************JSP**************"); System.out.println(strXML); %> jsp:include page="FusionChartsRenderer.jsp" flush="true" jsp:param name="chartSWF" value="../FusionCharts/MSColumn3DLineDY.swf" jsp:param name="strURL" value="" jsp:param name="strXML" value="<%=strXML %>" jsp:param name="chartId" value="chart1" jsp:param name="chartWidth" value="750" jsp:param name="chartHeight" value="400" jsp:param name="debugMode" value="false" jsp:param name="registerWithJS" value="true" /jsp:include input type="button" value="Export My Chart" onclick="ExportMyChart()" Regards, Ravi Krish Edited August 3, 2010 by Guest Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted August 3, 2010 Hi Ravi, Could you please confirm whether you have set the value for the attributes "exportEnabled", "exportFormats", "exportAtClient" in your XML code? Also, could you please confirm whether the root path for the .js file is mentioned correctly? Please note, in case you wish to save the chart as image/PDF as a download, you need to set the value of the attribute "exportAction" to "download" in your XML codes. Also, as of now, FusionCharts supports the 'download' action for server-side export and not for client-side export. Hope this helps. Share this post Link to post Share on other sites
mravikrish Report post Posted August 3, 2010 Hi Team, Thanks for your great support. Finally i could download the chart. Regards, Ravi Krish Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted August 3, 2010 Hi Ravi, You are most welcome. We are glad to help you. Keep smiling and keep FusionCharting. Share this post Link to post Share on other sites
mravikrish Report post Posted August 3, 2010 Hi Team, Thanks for your great support , Its working fine. Regards, Ravi Krish Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted August 3, 2010 Hi Ravi, We are glad to help you. Happy FusionCharting. Share this post Link to post Share on other sites
mravikrish Report post Posted September 11, 2010 (edited) Hi Team, Is there any way to call exportChart() after loading the page to save the chart on server side. i dont want to click on any button nor right click. ive tried calling exportchart() at the end of body tag but no luck it is getting called before the chart is rendered. is there any param of jsp include along with those eight param to call this function when page is loaded. Please suggest me. Thanks in advance, Krish Edited September 12, 2010 by Guest Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted September 12, 2010 Hi Ravi, Please try calling the export() function inside the FC_Rendered() function so that the chart starts getting exported automatically as soon as it gets rendered on the browser page. Hope this helps. Share this post Link to post Share on other sites
mravikrish Report post Posted September 13, 2010 (edited) Hi Team, Thanks for reply, Actually im using the below functions exportChart and FC_Exported . When i use button onclick im calling exportchart() which intern calls FC_Exported(objRtn) , but when i use it onload=exportchart() of body tag it gets called before page gets loaded and it doesnt call FC_Exported(objRtn) . Suggest me how to use thos functions. function exportChart() { var chartObject=getChartFromId("graph1"); if( chartObject.hasRendered() ) chartObject.exportChart({exportFormat:'JPEG'}); } function FC_Exported(objRtn){ if (objRtn.statusCode=="1"){ alert("The chart was successfully saved on server. The file can be accessed from " + objRtn.fileName); }else{ alert("The chart could not be saved on server. There was an error. Description : " + objRtn.statusMessage); } } Im attaching the jsp page of mine Thanks, Ravi Krish Chart.zip Edited September 13, 2010 by Guest Share this post Link to post Share on other sites