dataAccess Report post Posted September 10, 2008 (edited) Hi, the chart does not appear in my page, I spent 2 hours on this but failed, I doubled check the paths to the Fusionchart.js and the path to Oie3D.swf they both correct. The following is my code: In the front page I included the name of the function: <% =GetEmpChartHtml()%>and here is the body of the function in the code behind: Public Function GetEmpChartHtml() As String 'xmlData will be used to store the entire XML document generated Dim xmlData As New StringBuilder() 'Generate the chart elementxmlData.Append( "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>") Dim strConnection As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim objConnection As New SqlConnection(strConnection) Dim strSQL As String = "SELECT Emp_Name, id FROM employee;" Dim objCommand As New SqlCommand(strSQL, objConnection) Try If objConnection.State = 0 Then _objConnection.Open() Dim dr As SqlDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection) If dr.HasRows() Then While dr.Read()xmlData.Append( "<set label='" & dr.Item("Emp_Name").ToString() & "' value='" & dr.Item("ID").ToString() & "' />") End While End Ifdr.Close() Catch e As Exception FinallyobjConnection.Close() End Try ' 'Close chart elementxmlData = xmlData.Append( "</chart>") 'Create the chart - Pie 3D Chart with data from xmlData Return InfoSoftGlobal.FusionCharts.RenderChart("../../Charts/Pie3D.swf", "", xmlData.ToString, "FactorySum", "600", "300", False, False) End Function Edited September 10, 2008 by Guest Share this post Link to post Share on other sites
Arindam Report post Posted September 11, 2008 Hi, Could you please tell us whether chart appears white or given some error on page? Also I found one error in your program please rectify it and test again. 'Close chart element xmlData = xmlData.Append("</chart>") Change to: xmlData.Append("</chart>") Share this post Link to post Share on other sites
dataAccess Report post Posted September 11, 2008 It works fine now. thanks. Share this post Link to post Share on other sites