protected void Page_Load(object sender, EventArgs e)
 {
     if (X.IsAjaxRequest)
     {
         return;
     }
     this.dfStart.SelectedDate = System.DateTime.Now.Date.AddDays(-7);
     ReportViewHelper.FixReportDefinition(this.Server.MapPath("RecordExportTemplateForChannel.rdl"));
     rptvExport.LocalReport.ReportPath = this.Server.MapPath("RecordExportTemplateForChannel.rdl");
 }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack)
            {
                return;
            }

            ReportViewHelper.FixReportDefinition(this.Server.MapPath("ReportProvinceChart.rdl"));
            rptvContainer.LocalReport.ReportPath = this.Server.MapPath("ReportProvinceChart.rdl");
            BindData();
        }
        protected void ExportToExcel(object sender, EventArgs e)
        {
            List <QueryFilter> queryFilters = new List <QueryFilter>();

            int channelID = 0;

            if (this.cmbSChannelID.SelectedItem != null && this.cmbSChannelID.SelectedItem.Value != "")
            {
                channelID = Convert.ToInt32(this.cmbSChannelID.SelectedItem.Value);
            }

            if (this.cmbSOperatorType.SelectedItem != null && this.cmbSOperatorType.SelectedItem.Value != "")
            {
                queryFilters.Add(new QueryFilter(SPCodeInfoWrapper.PROPERTY_NAME_OPERATORTYPE, this.cmbSOperatorType.SelectedItem.Value, FilterFunction.EqualTo));
            }

            if (this.cmbSProvince.SelectedItem != null && this.cmbSProvince.SelectedItem.Value != "")
            {
                queryFilters.Add(new QueryFilter(SPCodeInfoWrapper.PROPERTY_NAME_PROVINCE, this.cmbSProvince.SelectedItem.Value, FilterFunction.Contains));
            }

            if (!string.IsNullOrEmpty(this.txtSMo.Text))
            {
                queryFilters.Add(new QueryFilter(SPCodeInfoWrapper.PROPERTY_NAME_MO, this.txtSMo.Text.Trim(), FilterFunction.Contains));
            }

            if (!string.IsNullOrEmpty(this.txtSPort.Text))
            {
                queryFilters.Add(new QueryFilter(SPCodeInfoWrapper.PROPERTY_NAME_SPCODE, this.txtSPort.Text.Trim(), FilterFunction.Contains));
            }

            if (this.cmbSEnbale.SelectedItem != null && this.cmbSEnbale.SelectedItem.Value != "")
            {
                queryFilters.Add(new QueryFilter(SPCodeInfoWrapper.PROPERTY_NAME_ISENABLE, this.cmbSEnbale.SelectedItem.Value.Equals("1").ToString(), FilterFunction.EqualTo));
            }

            if (this.cmbLimit.SelectedItem != null && this.cmbLimit.SelectedItem.Value != "")
            {
                queryFilters.Add(new QueryFilter(SPCodeInfoWrapper.PROPERTY_NAME_ISLIMIT, this.cmbLimit.SelectedItem.Value.Equals("1").ToString(), FilterFunction.EqualTo));
            }



            List <SPCodeInfoWrapper> dataSource = SPCodeInfoWrapper.FindAllByOrderByAndChannelID(channelID, queryFilters, "", false);

            byte[] reportFile = ReportViewHelper.ExportListToExcel(this.rptvExport, dataSource, "DataSet1", "自定义数据导出报表");

            this.Response.Clear();
            this.Response.ContentType = "application/vnd.ms-excel";
            this.Response.AddHeader("Content-Disposition", "attachment; filename=submittedData.xls");
            this.Response.BinaryWrite(reportFile);
            this.Response.End();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (X.IsAjaxRequest)
            {
                return;
            }

            GridPanel1.Reload();



            ReportViewHelper.FixReportDefinition(this.Server.MapPath("RecordExportTemplateForChannel.rdl"));
            rptvExport.LocalReport.ReportPath = this.Server.MapPath("RecordExportTemplateForChannel.rdl");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }


            ReportViewHelper.FixReportDefinition(this.Server.MapPath("CodeInfoExport.rdl"));
            rptvExport.LocalReport.ReportPath = this.Server.MapPath("CodeInfoExport.rdl");

            btnExport.Hidden = IsSPCommUser;

            this.gridPanelSPCodeInfo.Reload();
        }
        protected void ExportToExcel(object sender, EventArgs e)
        {
            RecordSortor recordSortor = new RecordSortor();

            recordSortor.OrderByColumnName = "";

            ReportSearchCondition reportSearchCondition = GetReportSearchCondition(recordSortor);

            List <SPRecordWrapper> dataSource = SPRecordWrapper.QueryRecord(reportSearchCondition.Channel, reportSearchCondition.Code, reportSearchCondition.Client, SPRecordWrapper.DayReportType_AllUp, reportSearchCondition.StartDate, reportSearchCondition.EndDate, reportSearchCondition.QueryFilters, reportSearchCondition.RecordSortor.OrderByColumnName, reportSearchCondition.RecordSortor.IsDesc);

            byte[] reportFile = ReportViewHelper.ExportListToExcel(this.rptvExport, dataSource, "DataSet1", "自定义数据导出报表");

            this.Response.Clear();
            this.Response.ContentType = "application/vnd.ms-excel";
            this.Response.AddHeader("Content-Disposition", "attachment; filename=submittedData.xls");
            this.Response.BinaryWrite(reportFile);
            this.Response.End();
        }
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.QueryChannelInvoiceReport(StartDate, EndDate, ChannelID, CodeID).Tables[0];

            string channelName = "所有";

            if (ChannelID.HasValue && ChannelID > 0)
            {
                channelName = "【" + SPChannelWrapper.FindById(ChannelID.Value).Name + "】";
            }

            string codeName = "";

            if (CodeID.HasValue && CodeID > 0)
            {
                codeName = "【" + SPCodeWrapper.FindById(CodeID.Value).MoCode + "】指令";
            }

            string reportName = string.Format("【{0}】-【{1}】 {2} 通道 {3} 结算报表", StartDate.Value.ToString("yyyy-MM-dd"),
                                              EndDate.Value.ToString("yyyy-MM-dd"), channelName, codeName);

            ReportViewHelper.BindDataTableToReport(rptvContainer, tb, "DataSet1", reportName);
        }