Пример #1
0
 protected void ResetButton_Click(object sender, EventArgs e)
 {
     this.ServerListFilterListBox.UnselectAll();
     fillcombo("Mail_SentCount");
     DashboardReports.ExchangeMsgXtraRpt report = new DashboardReports.ExchangeMsgXtraRpt();
     report.Parameters["ServerName"].Value = "";
     this.ReportViewer1.Report             = report;
     this.ReportViewer1.DataBind();
 }
Пример #2
0
        public void Report()
        {
            string selectedServer = "";

            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 { }
            }
            string strfrom = "";
            string strto   = "";
            string rpttype = "1";

            strfrom = dtPick.FromDate;
            strto   = dtPick.ToDate;
            DateTime dtfrom = DateTime.Parse(strfrom);
            DateTime dtto   = DateTime.Parse(strto);

            if (dtfrom.Date == dtto.Date)
            {
                rpttype = "0";
            }
            DashboardReports.ExchangeMsgXtraRpt report = new DashboardReports.ExchangeMsgXtraRpt();
            report.Parameters["ServerName"].Value = selectedServer;
            report.Parameters["DateFrom"].Value   = strfrom;
            report.Parameters["DateTo"].Value     = strto;
            report.Parameters["RptType"].Value    = rpttype;
            this.ReportViewer1.Report             = report;
            this.ReportViewer1.DataBind();
        }