Exemplo n.º 1
0
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.QueryRecordProvine(StartDate, EndDate, DataType, ChannelID, CodeID, ClientID).Tables[0];

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

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

            string reportName = string.Format("【{0}】-【{1}】数据省份分布报表", StartDate.Value.ToString("yyyy-MM-dd"), EndDate.Value.ToString("yyyy-MM-dd"));

            ReportParameter rpReportName = new ReportParameter();

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

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

            rptvContainer.LocalReport.Refresh();
        }