コード例 #1
0
        private void LoadReport(string sortExpression)
        {
            Facade.Job facJob = new Facade.Job();

            int identityId = 0;

            if (cboClient.SelectedValue != "")
            {
                identityId = int.Parse(cboClient.SelectedValue);
            }

            DataSet dsCallInLog = facJob.GetCallInLog(Convert.ToInt32(cboControlArea.SelectedValue), identityId);

            DataView dv = dsCallInLog.DefaultViewManager.CreateDataView(dsCallInLog.Tables[0]);

            if (this.SortExpression != string.Empty)
            {
                dv.Sort = this.SortExpression + " " + this.SortDirection;
            }

            this.gvJobs.DataSource = dv;
            this.gvJobs.DataBind();

            bool gpsActive = bool.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["GPS.Active"]);

            if (!gpsActive)
            {
                gvJobs.Columns[12].Visible = false;
            }
            if (dsCallInLog.Tables[0].Rows.Count > 0)
            {
                //// Configure the report settings collection
                NameValueCollection reportParams = new NameValueCollection();
                reportParams.Add("selectUrl", "CallInLog.aspx?prepop=true&ca=" + cboControlArea.SelectedValue + "&oi=" + cboClient.SelectedValue);

                // Configure the Session variables used to pass data to the report
                Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable]       = eReportType.CallInLog;
                Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable]  = dsCallInLog;
                Session[Orchestrator.Globals.Constants.ReportDataSessionSortVariable]   = String.Empty;
                Session[Orchestrator.Globals.Constants.ReportDataMemberSessionVariable] = "Table";
                Session[Orchestrator.Globals.Constants.ReportParamsSessionVariable]     = reportParams;

                // Show the user control
                //reportViewer.Visible = true;

                //reportViewer.IdentityId = identityId;
                //dgJobs.DataSource = dsCallInLog.Tables[0];
                //dgJobs.DataBind();
                lblCallInCount.Text = dsCallInLog.Tables[0].Rows.Count.ToString();
            }
            else
            {
                lblError.Text    = "No runs found";
                lblError.Visible = true;
                //reportViewer.Visible = false;
                //dgJobs.Visible = false;
            }
        }