Chart1.Series.Clear(); Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray; Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray; MultiView1.Visible = true; DataTable table = new DataTable(); table.Columns.Add("FunctionGroup"); table.Columns.Add("AverageGrading"); table.Columns.Add("Date"); ArrayList listofdates = dbmanager.GetListofDatesViaSection(section); string[] functionsplit = functionlist.Split(','); foreach (DateTime date in listofdates) { foreach (string function in functionsplit) { double gradingresult = dbmanager.GetAverageAppraisalForFunction(section, function, date); string monthname = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(date.Month); table.Rows.Add(function, gradingresult, monthname.Substring(0, 3) + "/" + date.Year.ToString().Substring(2, 2)); } } DataTableReader datareader = table.CreateDataReader(); Chart1.DataBindCrossTable(datareader, "FunctionGroup", "Date", "AverageGrading", ""); Chart1.Legends.Add("Legend"); Chart1.Legends[0].Enabled = true; Chart1.Legends[0].BackColor = System.Drawing.Color.Transparent; Chart1.Width = 500; Chart1.Height = 500; Chart1.SaveImage(Server.MapPath("./Image/MemoryStreamImage.png")); Microsoft.Reporting.WebForms.ReportParameter[] ReportParameters = new Microsoft.Reporting.WebForms.ReportParameter[1]; ReportParameters[0] = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter1", "file:///" + Server.MapPath("./Image/MemoryStreamImage.png")); ReportViewer1.LocalReport.SetParameters(ReportParameters); MultiView1.ActiveViewIndex = 0;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)