Пример #1
0
        //----------------------------------------------------------------------------------------------

        protected void btnRefresh_Click(object sender, EventArgs e)
        {
            Facade.IDriver facDriver       = new Facade.Resource();
            DataSet        dsDriverRevenue = facDriver.GetDriverRevenue(Convert.ToInt32(cboDriver.SelectedValue),
                                                                        dteStartDate.SelectedDate.Value.Date, dteEndDate.SelectedDate.Value.Date);

            NameValueCollection reportParams = new NameValueCollection();

            reportParams.Add("ResourceId", cboDriver.SelectedValue);
            reportParams.Add("StartDate", dteStartDate.SelectedDate.Value.Date.ToString("dd/MM/yyyy"));
            reportParams.Add("EndDate", dteEndDate.SelectedDate.Value.Date.ToString("dd/MM/yyyy"));

            // Configure the Session variables used to pass data to the report
            Session[Orchestrator.Globals.Constants.ReportTypeSessionVariable]       = eReportType.DriverRevenue;
            Session[Orchestrator.Globals.Constants.ReportDataSessionTableVariable]  = dsDriverRevenue;
            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;
        }