protected void ServerListResetButton_Click(object sender, EventArgs e) { //this.ServerListFilterComboBox.SelectedIndex = -1; //2/2/2015 NS added for VSPLUS-1370 this.ServerTypeFilterListBox.UnselectAll(); this.ServerListFilterListBox.UnselectAll(); fillcombo(""); DashboardReports.DailyMemoryUsedXtraRpt report = new DashboardReports.DailyMemoryUsedXtraRpt(); string date = DateTime.Now.ToString("M/d/yyyy"); DateTime dt = Convert.ToDateTime(date); report.Parameters["DateM"].Value = dt.Month; report.Parameters["DateY"].Value = dt.Year; report.Parameters["ServerName"].Value = ""; report.Parameters["ServerType"].Value = ""; this.ReportViewer1.Report = report; this.ReportViewer1.DataBind(); }
public void Report() { string selectedServer = ""; string date; /* * if (this.ServerListFilterComboBox.SelectedIndex >= 0) * { * selectedServer = this.ServerListFilterComboBox.SelectedItem.Value.ToString(); * } */ if (this.ServerListFilterListBox.SelectedItems.Count > 0) { selectedServer = ""; for (int i = 0; i < this.ServerListFilterListBox.SelectedItems.Count; i++) { selectedServer += "'" + this.ServerListFilterListBox.SelectedItems[i].Text + "'" + ","; } try { selectedServer = selectedServer.Substring(0, selectedServer.Length - 1); } catch { selectedServer = ""; // throw ex; } finally { } } //10/22/2013 NS modified - added jQuery month/year control /* * if (this.DateParamEdit.Text == "") * { * date = DateTime.Now.ToString(); * } * else * { * date = this.DateParamEdit.Value.ToString(); * } */ if (startDate.Value.ToString() == "") { date = DateTime.Now.ToString(); } else { date = startDate.Value.ToString(); } //2/2/2015 NS added for VSPLUS-1370 if (this.ServerTypeFilterListBox.SelectedItems.Count > 0) { selectedType = ""; for (int i = 0; i < this.ServerTypeFilterListBox.SelectedItems.Count; i++) { selectedType += "'" + this.ServerTypeFilterListBox.SelectedItems[i].Text + "'" + ","; } try { selectedType = selectedType.Substring(0, selectedType.Length - 1); } catch { selectedType = ""; // throw ex; } finally { } } DateTime dt = Convert.ToDateTime(date); DashboardReports.DailyMemoryUsedXtraRpt report = new DashboardReports.DailyMemoryUsedXtraRpt(); 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; //2/2/2015 NS added for VSPLUS-1370 report.Parameters["ServerType"].Value = selectedType; this.ReportViewer1.Report = report; this.ReportViewer1.DataBind(); }