Beispiel #1
0
        private void GenerateReport()
        {
            ReportBLL          cls           = new ReportBLL();
            ICallDetail        callDetail    = new CallDetailEntity();
            LocalReportManager reportManager = new LocalReportManager(rptViewer, "CallTypeWiseDailyRpt", ConfigurationManager.AppSettings["ReportNamespace"].ToString(), ConfigurationManager.AppSettings["ReportPath"].ToString());
            string             rptName       = "CallTypeWiseDailyRpt.rdlc";
            DateTime           fromDate;
            DateTime           toDate;

            fromDate = Convert.ToDateTime(txtFromDt.Text, _culture);
            toDate   = Convert.ToDateTime(txtToDt.Text, _culture);
            BuildEntity(callDetail);
            IEnumerable <ICallDetail> lst = cls.GetCallTypeWiseDailyData(fromDate, toDate, callDetail, _userId);

            rptViewer.Reset();
            rptViewer.LocalReport.Dispose();
            rptViewer.LocalReport.DataSources.Clear();
            rptViewer.LocalReport.ReportPath = this.Server.MapPath(this.Request.ApplicationPath) + ConfigurationManager.AppSettings["ReportPath"].ToString() + "/" + rptName;
            rptViewer.LocalReport.DataSources.Add(new ReportDataSource("ReportDataSet", lst));
            rptViewer.LocalReport.SetParameters(new ReportParameter("CompanyName", Convert.ToString(ConfigurationManager.AppSettings["CompanyName"])));
            rptViewer.LocalReport.SetParameters(new ReportParameter("FromDate", txtFromDt.Text));
            rptViewer.LocalReport.SetParameters(new ReportParameter("ToDate", txtToDt.Text));
            rptViewer.LocalReport.SetParameters(new ReportParameter("Location", ddlLoc.SelectedItem.Text));
            rptViewer.LocalReport.SetParameters(new ReportParameter("SalesPerson", ddlSales.SelectedItem.Text));
            rptViewer.LocalReport.SetParameters(new ReportParameter("CallType", ddlType.SelectedItem.Text));
            rptViewer.LocalReport.Refresh();
        }