karn Report post Posted January 28, 2010 hello, i try to make a simple export, the function FC_Exported say that work, but in the directory, the image doesn't exist... How i can fix that? Thank for your help! My code of default.aspx <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="chart_test_export._Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> <script type="text/javascript" language="JavaScript" src="FusionCharts/JSClass/FusionCharts.js"></script> <script type="text/javascript"> //Callback handler method which is invoked after the chart has saved image on server. 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); } } function FC_Rendered(DomID) { var chartObject = getChartFromId(DomID); chartObject.exportChart(); } </script> </head> <body> <form id="form1" runat="server"> <div> <div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div> <script type="text/javascript"> //Create the chart. Make sure registerWithJS is set to 1, else callback cannot happen. var myChart = new FusionCharts("FusionCharts/Charts/Column2D.swf", "myChartId", "400", "300", "0", "1"); myChart.setDataURL("SaveData.xml"); myChart.render("chartdiv"); </script> </div> </form> </body> </html> Code of FCExporter.aspx.cs private const string SAVE_PATH = "./"; /// <summary> /// IMPORTANT: This constant HTTP_URI stores the HTTP reference to /// the folder where exported charts will be saved. /// Please enter the HTTP representation of that folder /// in this constant e.g., http://www.yourdomain.com/images/ /// </summary> private const string HTTP_URI = "http://soliserv02/chart_test_export/"; My Xml : <chart yAxisName='Sales Figure' caption='Top 5 Sales Person' numberPrefix='$' useRoundEdges='1' bgColor='FFFFFF,FFFFFF' showBorder='0' exportEnabled='1' exportAtClient='0' exportAction='save' exportHandler='http://soliserv02/chart_test_export/FusionCharts/ExportHandlers/ASP_net/FCExporter.aspx'> <set label='Alex' value='25000' /> <set label='Mark' value='35000' /> <set label='David' value='42300' /> <set label='Graham' value='35300' /> <set label='John' value='31300' /> </chart> Share this post Link to post Share on other sites
Guest Madhumita Report post Posted January 29, 2010 Hi Karn, You need to use the FCExpoter.swf for the save button to come. Because of flash security reasons, user interraction is required to save the chart image. ref. - http://www.fusioncharts.com/docs/?ECClientSimple.html Share this post Link to post Share on other sites