Beispiel #1
0
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.GetALlChannelReport(StartDate.Date, EndDate.Date);

            tb.Columns.Add("UpperName");
            tb.Columns.Add("ChannelName");
            tb.Columns.Add("MoCode");

            tb.AcceptChanges();

            foreach (DataRow row in tb.Rows)
            {
                SPClientChannelSettingWrapper spClientChannelSetting =
                    SPClientChannelSettingWrapper.FindById(Convert.ToInt32(row["ChannelClientID"]));

                row.BeginEdit();

                row["UpperName"]   = spClientChannelSetting.ChannelID.UperName;
                row["ChannelName"] = spClientChannelSetting.ChannelID.Name;
                row["MoCode"]      = spClientChannelSetting.MoCode;

                row.EndEdit();
            }

            tb.AcceptChanges();

            ReportDataSource rds = new ReportDataSource("DataSet1", tb);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);



            string reportName = string.Format("【{0}】-【{1}】上家结算报表", StartDate.ToString("yyyy-MM-dd"), EndDate.ToString("yyyy-MM-dd"));

            ReportParameter rpReportName = new ReportParameter();

            rpReportName.Name = "ReportName";
            rpReportName.Values.Add(reportName);

            ReportViewer1.LocalReport.SetParameters(
                new ReportParameter[] { rpReportName });



            ReportViewer1.LocalReport.Refresh();
        }