or
| namespace AWS_Reports |
| { |
| using System; |
| using System.ComponentModel; |
| using System.Drawing; |
| using System.Windows.Forms; |
| using System.Configuration; |
| using Telerik.Reporting; |
| using Telerik.Reporting.Drawing; |
| /// <summary> |
| /// Summary description for MyAccountEstimator. |
| /// </summary> |
| public partial class MyAccountEstimatorStats : Telerik.Reporting.Report |
| { |
| public MyAccountEstimatorStats() |
| { |
| /// <summary> |
| /// Required for telerik Reporting designer support |
| /// </summary> |
| InitializeComponent(); |
| // Remove the design time data source to force use of NeedDataSource event |
| this.DataSource = null; |
| lstSummary.DataSource = null; |
| } |
| private void MyAccountEstimatorStats_NeedDataSource(object sender, EventArgs e) |
| { |
| // Try to get connection string from config file |
| ConnectionStringSettings cnStr = cnStrSettings(); |
| if ((cnStr != null) && (cnStr.ConnectionString != null)) |
| { |
| this.dsEstimatorUsageDetailsTableAdapter1.Connection.ConnectionString = cnStrSettings().ConnectionString; |
| } |
| try |
| { |
| this.dsEstimatorUsageDetailsTableAdapter1.Fill(this.dsEstimatorUsage.dsEstimatorUsageDetailsTable, StartDate, EndDate); |
| this.DataSource = this.dsEstimatorUsage; |
| this.DataMember = "dsEstimatorUsageDetailsTable"; |
| } |
| catch (System.Exception ex) |
| { |
| // An error has occurred while filling the data set. Please check the exception for more information. |
| System.Diagnostics.Debug.WriteLine(ex.Message); |
| } |
| } |
| private void lstSummary_NeedDataSource(object sender, EventArgs e) |
| { |
| // Try to get connection string from config file |
| ConnectionStringSettings cnStr = cnStrSettings(); |
| if ((cnStr != null) && (cnStr.ConnectionString != null)) |
| { |
| this.prWEP_MyAccountUsageTotalsTableAdapter1.Connection.ConnectionString = cnStrSettings().ConnectionString; |
| } |
| try |
| { |
| this.prWEP_MyAccountUsageTotalsTableAdapter1.Fill(this.dsEstimatorUsage.prWEP_MyAccountUsageTotals, StartDate, EndDate); |
| this.lstSummary.DataSource = this.dsEstimatorUsage; |
| this.lstSummary.DataMember = "prWEP_MyAccountUsageTotals"; |
| } |
| catch (System.Exception ex) |
| { |
| // An error has occurred while filling the data set. Please check the exception for more information. |
| System.Diagnostics.Debug.WriteLine(ex.Message); |
| } |
| } |
| private ConnectionStringSettings cnStrSettings() |
| { |
| // Get connection string from web.config |
| ConnectionStringSettings connStrSettings = ConfigurationManager.ConnectionStrings["AnchorWallConnectionString"]; |
| return connStrSettings; |
| } |
| public DateTime StartDate |
| { |
| get { return DateTime.Parse(this.ReportParameters["StartDate"].Value.ToString()); } |
| set { this.ReportParameters["StartDate"].Value = value; } |
| } |
| public DateTime EndDate |
| { |
| get { return DateTime.Parse(this.ReportParameters["EndDate"].Value.ToString()); } |
| set { this.ReportParameters["EndDate"].Value = value; } |
| } |
| } |
| } |
| reportBook = new ReportBook(); |
| for (int i = 0; i < regionList.Count; i++) |
| { |
| RegionReport regionReport = new RegionReport(); |
| regionReport.ReportParameters["RegionId"].Value = regionList[j]; |
| reportBook.Reports.Add(regionReport); |
| for (int j = 0; j < areaList.Count; j++) |
| { |
| AreaReport areaReport = new AreaReport(); |
| areaReport.ReportParameters["AreaId"].Value = areaList[j]; |
| reportBook.Reports.Add(areaReport); |
| } |
| } |
| private void RegionReport_NeedDataSource(object sender, EventArgs e) |
| { |
| Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender; |
| //If I had two RegionReport reports added to the book, RegionId parameter's value would be always of the last one added. |
| int param = Convert.ToInt16(this.ReportParameters["RegionId"].Value); |
| ... |
| http://img.exi.cz/2009-06-15_153528.png |
| http://img.exi.cz/2009-06-15_153708.png |
| http://img.exi.cz/2009-06-15_153720.png |
| 2009 |
|
||||||||||||||||||||||||
| 2008 |
|
||||||||||||||||||||||||
| 2007 |
|