Esempio n. 1
0
        public FileResult PrintInvoice_Read()
        {
            string _classID        = System.Web.HttpContext.Current.Session["InvoiceID"].ToString();
            string _PrintDublicate = System.Web.HttpContext.Current.Session["PrintDublicate"].ToString();
            bool   bit             = false;

            if (_PrintDublicate == "True")
            {
                bit = true;
            }
            if (_classID.Equals("-1"))
            {
                Session["InvoiceID"] = -1;
                return(null);
            }
            else
            {
                ReIssued reIssued = new ReIssued();
                reIssued.Invoice_ID      = Convert.ToInt64(_classID);
                reIssued.Re_Issued_By    = CurrentUser.NameIdentifierInt64;
                reIssued.Re_Issued_Date  = DateTime.Now;
                reIssued.Organization_ID = CurrentUser.CompanyID;
                reIssued.ID = _CustomerBAL.create_InvoiceReIssueBAL(reIssued);
                InvoiceHistory invoiceHistory = new InvoiceHistory();
                invoiceHistory.History_Name    = "Invoice Issued";
                invoiceHistory.Type            = InvoiceStatus.InvoiceReIssued;
                invoiceHistory.Description     = "";
                invoiceHistory.Invoice_Number  = Convert.ToInt64(_classID);
                invoiceHistory.User_ID         = CurrentUser.NameIdentifierInt64;
                invoiceHistory.Organization_ID = CurrentUser.CompanyID;
                invoiceHistory.Date_TIME       = DateTime.Now;
                var          x = _CustomerBAL.create_InvoiceHistoryBAL(invoiceHistory);
                ReportViewer ReportViewerRSFReports = new ReportViewer();
                ReportViewerRSFReports.Height   = Unit.Parse("100%");
                ReportViewerRSFReports.Width    = Unit.Parse("100%");
                ReportViewerRSFReports.CssClass = "table";
                var rptPath = Server.MapPath(@"../Report/INO_InvoiceRecipt.rdlc");
                ReportViewerRSFReports.LocalReport.ReportPath = rptPath;
                long      cID = Convert.ToInt64(CurrentUser.CompanyID);
                DataTable dt  = _CustomerBAL.GetInvoiceReportsBAL(Convert.ToInt64(_classID), Convert.ToInt64(CurrentUser.CompanyID), bit);
                ReportViewerRSFReports.ProcessingMode = ProcessingMode.Local;
                ReportViewerRSFReports.LocalReport.DataSources.Clear();
                ReportViewerRSFReports.LocalReport.EnableExternalImages = true;
                List <OrganizationModel> logoPath  = _PersonBAL.GetOrganizationLogo(CurrentUser.CompanyID);
                ReportParameter          paramLogo = new ReportParameter();
                paramLogo.Name = "Picture";
                string imagePath = new Uri(Server.MapPath(@"~/" + logoPath.FirstOrDefault().Logo)).AbsoluteUri;
                paramLogo.Values.Add(imagePath);
                ReportViewerRSFReports.LocalReport.SetParameters(paramLogo);
                ReportViewerRSFReports.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt));
                ReportViewerRSFReports.LocalReport.Refresh();
                byte[] mybytes = ReportViewerRSFReports.LocalReport.Render(format: "PDF", deviceInfo: "");
                Session["InvoiceID"]      = -1;
                Session["PrintDublicate"] = false;
                return(File(mybytes, System.Net.Mime.MediaTypeNames.Application.Octet, "Invoice.pdf"));
            }
        }
Esempio n. 2
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();
        }
Esempio n. 3
0
        private void RenderReportModels(ReportData reportData, string classid, string courseid)
        {
            long ClassID  = Convert.ToInt64(classid);
            long CourseID = Convert.ToInt64(courseid);


            // 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 = _CourseBAL.GetCourseReportData(ClassID, CourseID);

            ReportViewerRSFReports.ProcessingMode = ProcessingMode.Local;
            ReportViewerRSFReports.LocalReport.DataSources.Clear();
            ReportViewerRSFReports.LocalReport.EnableExternalImages = true;
            List <OrganizationModel> logoPath  = _CourseBAL.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("VewCourseAttendanceReportDataSet", dt));
            ReportViewerRSFReports.LocalReport.Refresh();
            //ReportViewerRSFReports.RefreshReport();
            //// Clear out any previous datasources.
            //this.ReportViewerRSFReports.LocalReport.DataSources.Clear();

            //// Set report mode for local processing.
            //ReportViewerRSFReports.ProcessingMode = ProcessingMode.Remote;

            //// Validate report source.
            //var rptPath = Server.MapPath(@"../../../Report/" + reportData.ReportName + ".rdlc");

            ////@"E:\RSFERP_SourceCode\RASolarERP\RASolarERP\Reports\Report\" + reportData.ReportName + ".rdlc";
            ////Server.MapPath(@"./Report/ClosingInventory.rdlc");

            //if (!File.Exists(rptPath))
            //    return;

            //// Set report path.
            //this.ReportViewerRSFReports.LocalReport.ReportPath = rptPath;

            //// Set report parameters.
            //var rpPms = ReportViewerRSFReports.LocalReport.GetParameters();
            //foreach (var rpm in rpPms)
            //{
            //    var p = reportData.ReportParameters.SingleOrDefault(o => o.ParameterName.ToLower() == rpm.Name.ToLower());
            //    if (p != null)
            //    {
            //        ReportParameter rp = new ReportParameter(rpm.Name, p.Value);
            //        ReportViewerRSFReports.LocalReport.SetParameters(rp);
            //    }
            //}

            //////Set data paramater for report SP execution
            ////objClosingInventory = dal.ClosingInventoryReport(this.ReportDataObj.DataParameters[0].Value);

            ////// Load the dataSource.
            //// ReportViewerRSFReports.LocalReport.DataSources.Clear();
            ////var dsmems = ReportViewerRSFReports.LocalReport.GetDataSourceNames();
            //// ReportViewerRSFReports.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", objClosingInventory));
            //// ReportViewerRSFReports.RefreshReport();
            //// Refresh the ReportViewer.
            //DataTable dt = _CourseBAL.GetCourseReportData(ClassID, CourseID);
            //ReportViewerRSFReports.ProcessingMode = ProcessingMode.Local;
            ////ReportViewerRSFReports.LocalReport.ReportPath = Server.MapPath("~/Report/Tran_ViewCourseAttendanceReport.rdlc");
            ////  DataSet ds = GetTrainerDetailsForReports;
            //ReportViewerRSFReports.LocalReport.DataSources.Clear();
            ////ReportViewerRSFReports.Reset();
            //ReportDataSource datasource = new ReportDataSource("VewCourseAttendanceReportDataSet", dt);
            //ReportViewerRSFReports.LocalReport.DataSources.Add(datasource);


            //this.ReportViewerRSFReports.LocalReport.Refresh();
        }