Ejemplo n.º 1
0
        private void RenderReportModels(ReportData reportData, string Venue, string classid, string startDate, string endDate)
        {
            long     ClassID    = Convert.ToInt64(classid);
            long     venue      = Convert.ToInt64(Venue);
            DateTime startdatet = DateTime.ParseExact(startDate, "dd/MM/yyyy",
                                                      CultureInfo.InvariantCulture);
            DateTime enddatet = DateTime.ParseExact(endDate, "dd/MM/yyyy",
                                                    CultureInfo.InvariantCulture);

            // Reset report properties.
            ReportViewerRSFReports.Height   = Unit.Parse("100%");
            ReportViewerRSFReports.Width    = Unit.Parse("100%");
            ReportViewerRSFReports.CssClass = "table";
            var rptPath = Server.MapPath(@"../../../Report/" + reportData.ReportName + ".rdlc");

            this.ReportViewerRSFReports.LocalReport.ReportPath = rptPath;
            DataTable dt = _PersonBAL.GetOccVenueDetailsForReports(Convert.ToInt64(classid),
                                                                   Convert.ToInt64(Venue), startdatet, enddatet); ReportViewerRSFReports.ProcessingMode = ProcessingMode.Local;

            ReportViewerRSFReports.LocalReport.DataSources.Clear();
            ReportViewerRSFReports.LocalReport.EnableExternalImages = true;
            List <OrganizationModel> logoPath  = _PersonBAL.GetOrganizationLogo(Convert.ToInt64(HttpContext.Current.Session["CompanyID"]));
            ReportParameter          paramLogo = new ReportParameter();

            paramLogo.Name = "Path";
            string imagePath = new Uri(Server.MapPath(@"~/" + logoPath.FirstOrDefault().Logo)).AbsoluteUri;

            paramLogo.Values.Add(imagePath);
            ReportViewerRSFReports.LocalReport.SetParameters(paramLogo);
            ReportViewerRSFReports.LocalReport.DataSources.Add(new ReportDataSource("OccupancyReport", dt));
            ReportViewerRSFReports.LocalReport.Refresh();
        }
Ejemplo n.º 2
0
        //public DataSet GetTrainerDetailsForReports
        //{
        //    get
        //    {
        //        return _GetTrainerDetailsForReports ??
        //               (_GetTrainerDetailsForReports = _PersonBAL.GetOccVenueDetailsForReports(Convert.ToInt64(DdlClass.SelectedValue),
        //                       Convert.ToInt64(DdlVenue.SelectedValue),StartDate, EndDate));
        //    }
        //    set { _GetTrainerDetailsForReports = value; }
        //}
        private void LoadTraineeDetailReport()
        {
            StartDate = Convert.ToDateTime(TxtStartDate.Text);
            EndDate   = Convert.ToDateTime(TxtEndDate.Text);

            DataTable dt = _PersonBAL.GetOccVenueDetailsForReports(Convert.ToInt64(DdlClass.SelectedValue),
                                                                   Convert.ToInt64(DdlVenue.SelectedValue), StartDate, EndDate);

            ReportViewer1.ProcessingMode         = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report/Tran_VenueOccupancyReport.rdlc");
            //  DataSet ds = GetTrainerDetailsForReports;
            ReportDataSource datasource = new ReportDataSource("OccupancyReport", dt);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(datasource);
            ReportViewer1.LocalReport.Refresh();


            ////  DataSet ds = GetTrainerDetailsForReports;

            //  ReportViewer1.LocalReport.DataSources.Clear();
            //  ReportDataSource RDS1 = new ReportDataSource("OccupancyReport", ds.Tables[0]);
            //  ReportViewer1.ProcessingMode = ProcessingMode.Local;
            //  ReportViewer1.LocalReport.EnableExternalImages = true;
            //  ReportViewer1.LocalReport.ReportEmbeddedResource = "~/Report/Tran_VenueOccupancyReport.rdlc";
            //  ReportViewer1.LocalReport.DataSources.Clear();
            //  ReportViewer1.LocalReport.DataSources.Add(RDS1);
        }