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

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