Esempio n. 1
0
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.GetALlClientGroupPriceReport(StartDate.Date, EndDate.Date);


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

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


            ReportParameter rpStartDate = new ReportParameter();

            rpStartDate.Name = "StartDate";
            rpStartDate.Values.Add(StartDate.ToShortDateString());

            ReportParameter rpEndDate = new ReportParameter();

            rpEndDate.Name = "EndDate";
            rpEndDate.Values.Add(EndDate.ToShortDateString());


            ReportViewer1.LocalReport.SetParameters(
                new ReportParameter[] { rpStartDate, rpEndDate });



            ReportViewer1.LocalReport.Refresh();
        }
Esempio n. 2
0
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.GetALlClientGroupPriceReport(StartDate.Date, EndDate.Date);

            foreach (DataRow row in tb.Rows)
            {
                string moCode = "";

                if (row["ClientID"] != null && row["ClientID"] != System.DBNull.Value && !string.IsNullOrEmpty(row["ClientID"].ToString()))
                {
                    SPClientWrapper client = SPClientWrapper.FindById((int)row["ClientID"]);

                    if (client != null)
                    {
                        SPClientChannelSettingWrapper channelSetting = client.DefaultClientChannelSetting;

                        if (channelSetting != null)
                        {
                            moCode = channelSetting.MoCode;
                        }
                    }
                }


                row["ClientAliasName"] = row["ClientAliasName"] + " " + row["ClientID"].ToString() + " " + moCode;
            }



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

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


            ReportParameter rpStartDate = new ReportParameter();

            rpStartDate.Name = "StartDate";
            rpStartDate.Values.Add(StartDate.ToShortDateString());

            ReportParameter rpEndDate = new ReportParameter();

            rpEndDate.Name = "EndDate";
            rpEndDate.Values.Add(EndDate.ToShortDateString());


            ReportViewer1.LocalReport.SetParameters(
                new ReportParameter[] { rpStartDate, rpEndDate });



            ReportViewer1.LocalReport.Refresh();
        }