eilob
-
Content count
2 -
Joined
-
Last visited
Posts posted by eilob
-
-
Hi, I am working with Fusion charts and visual studio, I was reading the instructions to develop a website, were it says that we must place the folder on the root directory of the application, I added it as a new item to my Visual studio application. Then I was trying to do the DBExample on the example on FusionCharts_EvaluationCodeC# folder, and is giving me two errors, one is doesnt recognise the FusionChart variable at the end of the code and then doesnt recognised the DBHelper.Connection
Any advise?, please find attached the code I am using and let me know if I am going in the correct direction... Thanks a lot! eilob
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Data.Odbc;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string GetFactorySummaryChartHtml()
{
//xmlData will be used to store the entire document generated
string xmlData;
//Generate the chart element
xmlData = "<chart caption='Mailbox' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>";
//Iterate through each factory
string factoryQuery = "select * from mailbox";
using (OdbcConnection connection = DBHelper.Connection(DBHelper.ConnectionStringFactory))
{
using (OdbcCommand factoryCommand = new OdbcCommand(factoryQuery, connection))
{
using (OdbcDataAdapter adapter = new OdbcDataAdapter(factoryCommand))
{
DataTable table = new DataTable();
adapter.Fill(table);
foreach (DataRow row in table.Rows)
{
string quantityQuery = "select sum(Quantity) as TotOutput from Factory_Output where FactoryId=" + row["FactoryId"].ToString();
using (OdbcCommand quantityCommand = new OdbcCommand(quantityQuery, connection))
{
xmlData += "<set label='" + row["FactoryName"].ToString() + "' value='" + quantityCommand.ExecuteScalar().ToString() + "' />";
}
}
}
}
connection.Close();
xmlData += "</chart>";
}
//Create the chart - Pie 3D Chart with data from xmlData
return FusionCharts.RenderChart("C:/Documents and Settings/obroie1/Desktop/Charts/FusionCharts/Pie3D.swf", "", xmlData, "FactorySum", "600", "300", false, false);
}
}
Column3D Order By
in FusionCharts and ASP.NET
Posted · Report reply
ViewState.Add(
"select", "Select Count(DayOfWk) as 'Total', obroie1.Calendar2.DayOfWk, QtrWeek, obroie1.Calendar2.NumberID");ViewState.Add(
"table", "dbo.tbl_PSC_Mailbox, obroie1.Calendar2");ViewState.Add(
"where", "((convert(varchar(8), dbo.tbl_PSC_Mailbox.DateEmailed, 1)) = (convert(varchar(8), obroie1.Calendar2.DateEmailed, 1)))");ViewState.Add(
"Group By", "Group By DayOfWk, QtrWeek, NumberID");ViewState.Add(
"Order By", "Order By NumberID");ViewState.Add(
"chartType", "Column3D.swf");String query = (String)ViewState["select"] + " FROM " + (String)ViewState["table"] + " WHERE " + (String)ViewState["where"] + " And QtrWeek Like '" + (String)ViewState["Week"] + "'" + (String)ViewState["Group By"] + (String)ViewState["Order By"] ;
Please if you could help me to solve this problem, maybe something wrong with my sql string???
Thanks & Regards
Eileen O'Broin