Code Behind Page Page /Reports/NumberQuestions.aspx.cs (C#)
Used by Page /Reports/NumberQuestions.aspx (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 NumberQuestions : 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.NumberOfQuestionsAnsweredByDate(Convert.ToDateTime(txtStartDate.Value),Convert.ToDateTime(txtEndDate.Value));  
34:   
35:             // Populate series data  
36:   
37:               
38:             Chart1.Series["Series1"].Points.DataBindXY(rdr, "ResultDate", rdr, "TotalQuestions");  
39:   
40:             // Set series chart type  
41:             Chart1.Series["Series1"].ChartType = SeriesChartType.Column;  
42:             Chart1.Series["Series1"].ToolTip = "Y value \t= #VALY\nX value \t= #AXISLABEL";  
43:   
44:             // Set X axis margin  
45:             Chart1.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = true;  
46:             Chart1.ChartAreas["ChartArea1"].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;  
47:   
48:             Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;  
49:             Chart1.Series["Series1"].BorderWidth = 3;  
50:         }  
51:     }  
52: }

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