ASP.NET Page /Reports/NumberQuestionsCreated.aspx.cs (C#)
1: using System;  
2: using System.Collections;  
3: using System.ComponentModel;  
4: using System.Data;  
5: using System.Drawing;  
6: using System.Web;  
7: using System.Web.SessionState;  
8: using System.Web.UI;  
9: using System.Web.UI.WebControls;  
10: using System.Web.UI.HtmlControls;  
11: using System.Web.UI.DataVisualization.Charting;  
12: using QuizNetOnline.Logic;  
13: using System.Data.SqlClient;  
14:   
15: namespace QuiznetOnline.Web.UI.Reports  
16: {  
17:     public partial class NumberQuestionsCreated : QuiznetOnline.Web.UI.BusinessClasses.BasePage  
18:     {  
19:         Tools tools = new Tools();  
20:   
21:   
22:         protected System.Web.UI.WebControls.Label Label2;  
23:         protected System.Web.UI.WebControls.Label Label1;  
24:   
25:   
26:         protected override void Page_Load(object sender, System.EventArgs e)  
27:         {  
28:             base.Page_Load(sender, e);  
29:   
30:             txtStartDate.Value = txtStartDate.Value == "" ? DateTime.Now.AddMonths(-3).ToString("d") : txtStartDate.Value;  
31:             txtEndDate.Value = txtEndDate.Value == "" ? DateTime.Now.ToString("d") : txtEndDate.Value;  
32:   
33:             SqlDataReader rdr = tools.NumberQuestionsCreated(Convert.ToDateTime(txtStartDate.Value), Convert.ToDateTime(txtEndDate.Value));  
34:   
35:             // Populate series data  
36:             Chart1.Series["Series1"].Points.DataBindXY(rdr, "CreationDate", rdr, "NumberOfQuestions");  
37:   
38:             // Set series chart type  
39:             Chart1.Series["Series1"].ChartType = SeriesChartType.Column;  
40:             Chart1.Series["Series1"].ToolTip = "Y value \t= #VALY\nX value \t= #AXISLABEL";  
41:   
42:             // Set X axis margin  
43:             Chart1.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = true;  
44:             Chart1.ChartAreas["ChartArea1"].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;  
45:   
46:             Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;  
47:             Chart1.Series["Series1"].BorderWidth = 3;  
48:         }  
49:     }  
50: }

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.