protected void SubmitButton_Click(object sender, EventArgs e) { string selectedServer = ""; string selectedServerList = ""; string date; exactmatch = false; if (this.ServerFilterTextBox.Text != "") { selectedServer = this.ServerFilterTextBox.Text; } if (this.ServerListFilterListBox.SelectedItems.Count > 0) { selectedServer = ""; for (int i = 0; i < this.ServerListFilterListBox.SelectedItems.Count; i++) { selectedServer += this.ServerListFilterListBox.SelectedItems[i].Text + ","; selectedServerList += "'" + this.ServerListFilterListBox.SelectedItems[i].Text + "'" + ","; } exactmatch = true; try { selectedServer = selectedServer.Substring(0, selectedServer.Length - 1); selectedServerList = selectedServerList.Substring(0, selectedServerList.Length - 1); } catch { selectedServer = ""; // throw ex; selectedServerList = ""; exactmatch = false; } finally { } } if (this.DateParamEdit.Text == "") { date = DateTime.Now.ToString(); this.DateParamEdit.Date = Convert.ToDateTime(date); } else { date = this.DateParamEdit.Value.ToString(); } DateTime dt = Convert.ToDateTime(date); DashboardReports.OverallStatisticsXtraRpt report = new DashboardReports.OverallStatisticsXtraRpt(); report.Parameters["DateM"].Value = dt.Month; report.Parameters["DateY"].Value = dt.Year; System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); string strMonthName = mfi.GetMonthName(dt.Month).ToString() + ", " + dt.Year.ToString(); report.Parameters["MonthYear"].Value = strMonthName; report.Parameters["ServerName"].Value = selectedServer; report.Parameters["ServerNameSQL"].Value = selectedServerList; report.Parameters["ExactMatch"].Value = exactmatch; this.ReportViewer1.Report = report; this.ReportViewer1.DataBind(); }
protected void ResetButton_Click(object sender, EventArgs e) { this.ServerFilterTextBox.Text = ""; this.ServerListFilterListBox.UnselectAll(); DashboardReports.OverallStatisticsXtraRpt report = new DashboardReports.OverallStatisticsXtraRpt(); report.Parameters["ServerName"].Value = ""; this.ReportViewer1.Report = report; this.ReportViewer1.DataBind(); }