示例#1
0
 protected void ServerListResetButton_Click(object sender, EventArgs e)
 {
     //this.ServerListFilterComboBox.SelectedIndex = -1;
     this.ServerListFilterListBox.UnselectAll();
     DashboardReports.ClusterSecXtraReport report = new DashboardReports.ClusterSecXtraReport();
     report.Parameters["ServerName"].Value = "";
     report.Parameters["StartDate"].Value  = DateTime.Now.ToString();
     //ServerListFilterComboBox.Text = "";
     StartDateEdit.Text        = DateTime.Now.ToShortDateString();
     this.ReportViewer1.Report = report;
     this.ReportViewer1.DataBind();
 }
示例#2
0
        public void Report()
        {
            string selectedServer = "";

            //8/5/2013 NS modified

            /*
             * 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 { }
            }
            DashboardReports.ClusterSecXtraReport report = new DashboardReports.ClusterSecXtraReport();
            report.Parameters["ServerName"].Value = selectedServer;

            if (StartDateEdit.Text == "")
            {
                StartDateEdit.Text = DateTime.Now.ToShortDateString();
            }

            report.Parameters["StartDate"].Value = StartDateEdit.Text;
            this.ReportViewer1.Report            = report;
            this.ReportViewer1.DataBind();
        }