• Content count

  • Joined

  • Last visited

About eilob

  • Rank
    Forum Newbie
  1. Dear Sirs, I am working with Fusion Charts, and I have a small problem I cant resolve. I have a column3D chart and in my X axis I have day of week. My chart works fine my only problem is that I cant order the days of the week as per Monday, Tues, Wed, Thu, Fri... they come up in different order I have my tables in SQL 2000 and using Visual studio C# I have the following code, which works fine: 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"); My problem is when I put together my query: If I use the below it works, the column3D works fine but the days of the week are not in the correct order in the X axis, it shows as per sunday, wed, mon etc: String query = (String)ViewState["select"] + " FROM " + (String)ViewState["table"] + " WHERE " + (String)ViewState["where"] + " And QtrWeek Like '" + (String)ViewState["Week"] + "'" + (String)ViewState["Group By"]; But If I add the Order by section it doesnt work anymore, like: 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
  2. 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); } }