Пример #1
0
        public ActionResult ShiftWiseReport(DateTime fromdate, DateTime todate, string Shift)
        {
            System.Data.DataSet ds        = posTransactions.ShiftwiseItemSaleReport(fromdate, todate, Shift);
            System.Data.DataSet ds1       = posTransactions.companyname();
            string      strcompanyname    = ds1.Tables[0].Rows[0]["vchcompanyname"].ToString();
            string      strcompanyAddress = ds1.Tables[0].Rows[0]["address"].ToString();
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Reports/ShiftWiseSaleReport 2.rpt");
            rptH.Load();
            rptH.SetDataSource(ds.Tables[0]);
            rptH.SetParameterValue("CompanyName", strcompanyname);
            rptH.SetParameterValue("Address", strcompanyAddress);
            rptH.SetParameterValue("Date", fromdate);
            rptH.SetParameterValue("Todate", todate);
            //if (true)
            //{
            //    Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.ExcelRecord);
            //    return File(stream, "application/excel");
            //}
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            //  stream.Seek(0, SeekOrigin.Begin);
            return(File(stream, "application/pdf"));
        }
Пример #2
0
        /**
         * Funcion que crea el pdf y lo convierte a un httpresponseMessage para enviar por http
         * @param  pbjeto de Crystal report que contiene la tabla del pdf a generar
         * @returns httpResponseMessage del pdf
         */
        public HttpResponseMessage obtener_Response(ReportClass objRpt)
        {
            ExportOptions           CrExportOptions;
            PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();

            CrExportOptions = objRpt.ExportOptions;

            CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
            CrExportOptions.FormatOptions    = CrFormatTypeOptions;
            Stream stream = objRpt.ExportToStream(ExportFormatType.PortableDocFormat);

            objRpt.Export(CrExportOptions);
            MemoryStream ms = new MemoryStream();

            stream.CopyTo(ms);
            var result = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new ByteArrayContent(ms.ToArray())
            };

            result.Content.Headers.ContentDisposition =
                new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment")
            {
                FileName = "Report.pdf"
            };
            result.Content.Headers.ContentType =
                new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
            return(result);
        }
Пример #3
0
        public ActionResult BillGenerationReport(string billno)
        {
            System.Data.DataSet ds        = posTransactions.BillGenerationReport(billno);
            System.Data.DataSet ds1       = posTransactions.companyname();
            string      strcompanyname    = ds1.Tables[0].Rows[0]["vchcompanyname"].ToString();
            string      strcompanyAddress = ds1.Tables[0].Rows[0]["address"].ToString();
            string      Hostname          = "";
            string      session           = "";
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Reports/rptBillGeneration.rpt");
            rptH.Load();
            rptH.SetDataSource(ds.Tables[0]);
            rptH.SetParameterValue("CompanyName", strcompanyname);
            rptH.SetParameterValue("Address", strcompanyAddress);
            rptH.SetParameterValue("TableId", ds.Tables[0].Rows[0]["tableid"]);
            rptH.SetParameterValue("BillNo", ds.Tables[0].Rows[0]["vchbillno"]);
            rptH.SetParameterValue("HostName", Hostname);
            rptH.SetParameterValue("SessionNo", session);
            rptH.SetParameterValue("Printtype", "Original");
            //  rptH.SetParameterValue("Billtype", "billtype");

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
        public JsonResult InitializeMonthlyRFCReport(IenumerableReportResult model, string param)
        {
            if (string.IsNullOrEmpty(param))
            {
                return(Json(new { status = false, resCode = "0", msg = "Something went wrong with report parameters. Please re-generate report or contact support. Thank you." }, JsonRequestBehavior.AllowGet));
            }

            string[] values = User.Identity.Name.Split('|');

            ReportClass rptH = new ReportClass();


            rptH.FileName = Server.MapPath("~/CrystalReport/rptDailyReport.rpt");

            rptH.Load();

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();
            rptH.Dispose();
            rptH = null;

            Session["MonthlyRFCRptSession"] = stream;
            string pdfname = "daily-report" + DateTime.Now;

            return(Json(new { status = true, resCode = "1", msg = "Success", pdfName = pdfname }, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public Stream GetReportPDF(object report, Dictionary <string, object> items)
        {
            // ReportDocument rd = new ReportDocument();
            ReportClass reporte = (ReportClass)report;

            reporte.Load();
            foreach (var item in items)
            {
                if (item.Key.Split('.')?.ToList()?.Count() > 1)
                {
                    string subReport  = item.Key.Split('.')[0];
                    string dataSource = item.Key.Split('.')[1];
                    reporte.Subreports[subReport].Database.Tables[dataSource].SetDataSource(item.Value);
                }
                else
                {
                    reporte.Database.Tables[item.Key].SetDataSource(item.Value);
                }
            }
            //reporte.SetDataSource(items);

            Stream stream = reporte.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            reporte.Close();
            return(stream);
        }
Пример #6
0
        public ActionResult PurchasesMaster()
        {
            // var unitId = System.Web.HttpContext.Current.Session["ReportName"].ToString();    // Setting ReportName
            //        string strFromDate = System.Web.HttpContext.Current.Session["rptFromDate"].ToString();     // Setting FromDate
            //        string strToDate = System.Web.HttpContext.Current.Session["rptToDate"].ToString();         // Setting ToDate
            //        var rptSource = System.Web.HttpContext.Current.Session["rptSource"];

            //Rename Processed Batch
            // string newPath = AddSuffix(sourceFile, String.Format("({0})", parameters.IsProcessed));


            //FileInfo fi = new FileInfo(sourceFile);
            //if (fi.Exists)
            //{

            //    fi.MoveTo(newPath);
            //}

            SqlConnection con = new SqlConnection(Helpers.Helpers.DatabaseConnect);
            DataTable     dt  = new DataTable();

            try
            {
                con.Open();
                SqlCommand     cmd = new SqlCommand("SELECT AllocationName,ExpenseName,UnitName,VendorName,ActualAmount,Reference,CreatedOn,CurrencyAbbr,Discount FROM vw_PurchasesByCriteria ", con);
                SqlDataAdapter adp = new SqlDataAdapter(cmd);
                adp.Fill(dt);
            }
            catch (Exception ex)
            {
                ExceptionLogging.SendErrorToText(ex);
                ViewBag.ErrorMessage = Messages.GENERAL_ERROR;
                return(View());
                // ex.Message.ToString();
            }


            // string OutputFileName = BatchId + "_" + monthend + ".xlsx";

            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath(("~/Reports/") + "PurchasesByCriteria.rpt");

            rptH.Load();
            rptH.SetDataSource(dt);
            // string filePath = Server.MapPath("~/BatchOut/");
            // string destPath = Path.Combine(filePath, ToSafeFileName(OutputFileName));
            // if (formatId == parameters.Excel)

            // rptH.ExportToDisk(ExportFormatType.ExcelWorkbook, destPath);
            //  Stream stream = rptH.ExportToStream(ExportFormatType.ExcelWorkbook);
            //return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

            // else

            // rptH.ExportToDisk(ExportFormatType.PortableDocFormat, destPath);
            Stream stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #7
0
        public ActionResult Reporte5AS()
        {
            String        cnn = @"data source = TOSHIBA; initial catalog = BD_Colegio; persist security info = True; user id = sa; password = 12345;";
            SqlConnection con = new SqlConnection(cnn);

            DataTable dt = new DataTable();

            try
            {
                con.Open();
                SqlCommand     cmd = new SqlCommand("sp_matriculados", con);
                SqlDataAdapter adp = new SqlDataAdapter(cmd);
                adp.Fill(dt);
            }
            catch (Exception e)
            {
            }

            ReportClass rpth = new ReportClass();

            rpth.FileName = Server.MapPath("~/Reporte/Secundaria/Reporte5AS.rpt");
            rpth.Load();
            rpth.SetDataSource(dt);
            Stream stream = rpth.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #8
0
        public ActionResult OutWardReports(string fromdate, string todate, string Store, string Category)
        {
            System.Data.DataSet ds = mmsReports.GetOutwardData(fromdate, todate, Store, Category);
            if (ds != null)
            {
                System.Data.DataSet ds1  = posTransactions.companyname();
                string strcompanyname    = ds1.Tables[0].Rows[0]["vchcompanyname"].ToString();
                string strcompanyAddress = ds1.Tables[0].Rows[0]["address"].ToString();

                ReportClass rptH = new ReportClass();

                rptH.FileName = Server.MapPath("/Reports/OuwardItemStatement.rpt");

                rptH.Load();
                rptH.SetDataSource(ds.Tables[0]);


                rptH.SetParameterValue("CompanyName", strcompanyname);
                rptH.SetParameterValue("Address", strcompanyAddress);
                rptH.SetParameterValue("FromDate", fromdate);
                rptH.SetParameterValue("ToDate", todate);
                rptH.SetParameterValue("Store", Store);
                rptH.SetParameterValue("Category", Category);

                Stream stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);
                return(File(stream, "application/pdf"));
            }
            else
            {
                return(View("StockReport"));
            }
        }
Пример #9
0
        public ActionResult ProductIndentReports(string indent)
        {
            DataSet ds  = new DataSet();
            DataSet ds1 = new DataSet();

            try
            {
                ds  = mmsReports.GetProductIndentReport(indent);
                ds1 = posTransactions.companyname();
                string      strcompanyname    = ds1.Tables[0].Rows[0]["vchcompanyname"].ToString();
                string      strcompanyAddress = ds1.Tables[0].Rows[0]["address"].ToString();
                ReportClass rptH = new ReportClass();
                rptH.FileName = Server.MapPath("/Reports/ProductIndentReport.rpt");
                rptH.Load();
                rptH.SetDataSource(ds.Tables[0]);
                rptH.SetParameterValue("CompanyName", strcompanyname);
                rptH.SetParameterValue("Address", strcompanyAddress);
                Stream stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);
                return(File(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #10
0
        public ActionResult YearwiseReport(FormCollection FC, YearwiseModel objMW)
        {
            YearwiseModel objMWlist = new YearwiseModel();

            objMWlist.YearNameList = BindYear();

            if (objMW.YearID == "0")
            {
                ModelState.AddModelError("Message", "Please select Year");
            }
            else
            {
                objMWlist.YearID = objMW.YearID;

                DataSet ds = objIlReports.Get_YearwisePayment_details(objMW.YearID);
                ds.Tables[0].TableName = "DSYear";

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ReportClass rptH = new ReportClass();
                    rptH.FileName = Server.MapPath("~/Reports/YearwiseCollectionreport.rpt");
                    rptH.Load();
                    rptH.SetDataSource(ds.Tables[0]);
                    Response.Buffer = false;
                    Response.ClearContent();
                    Response.ClearHeaders();

                    Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                    stream.Seek(0, SeekOrigin.Begin);
                    return(File(stream, "application/pdf", "YearwiseMaintenanceReport.pdf"));
                }
            }

            return(View(objMWlist));
        }
Пример #11
0
        public ActionResult DescargarVentaProductos()
        {
            try
            {
                var rptH = new ReportClass();
                rptH.FileName = Server.MapPath("/Reportes/ReportesProductos/VentaProductos.rpt");
                rptH.Load();

                var            connInfo  = CrystalReportCnn.GetConnectionInfo();
                TableLogOnInfo logOnInfo = new TableLogOnInfo();
                Tables         tables;
                tables = rptH.Database.Tables;
                foreach (Table table in tables)
                {
                    logOnInfo = table.LogOnInfo;
                    logOnInfo.ConnectionInfo = connInfo;
                    table.ApplyLogOnInfo(logOnInfo);
                }

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                Stream stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);
                rptH.Dispose();
                rptH.Close();

                return(new FileStreamResult(stream, "application/pdf"));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #12
0
        public ActionResult ImprimirColaboradorQueryClasic(string COD_Colaborador)
        {
            String ConnStr = @"data source=.;initial catalog=IDCHECKDB;persist security info=True;user id=sa;password=12345";

            SqlConnection myConnection = new SqlConnection(ConnStr);
            DataTable     dt           = new DataTable();

            try
            {
                myConnection.Open();
                SqlCommand     cmd = new SqlCommand("SELECT COD_Colaborador, ApellidoPaterno, ApellidoMaterno, Nombres, Foto  FROM Colaboradores where COD_Colaborador =" + COD_Colaborador, myConnection);
                SqlDataAdapter adp = new SqlDataAdapter(cmd);
                adp.Fill(dt);
                myConnection.Close();
            }
            catch (Exception e)
            {
            }
            ReportClass rpth = new ReportClass();

            rpth.FileName = Server.MapPath("~/Reports/CrystalReportFotocheck.rpt");
            rpth.Load();
            rpth.SetDataSource(dt);
            Stream stream = rpth.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #13
0
        //
        // GET: /Report/
        public ActionResult AuditDriverList()
        {
            // database call

            var TANK_usp_rpt_AuditDrivers_spParams = new TANK_usp_rpt_AuditDrivers_spParams()
            {
                //TODO: re-factor it later from hard coded
                LocationID = 1,
                StartDT    = DateTime.Now.AddYears(-1),
                EndDT      = DateTime.Now
            };
            DataTable data = _utilityService.ExecStoredProcedureForDataTable("TANK_usp_rpt_AuditDrivers", TANK_usp_rpt_AuditDrivers_spParams);

            //# database call

            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("~/Reports/crDailyDriverActivity.rpt");

            rptH.Load();

            rptH.SetDataSource(data);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));

            // return View();
        }
Пример #14
0
        /// <summary>
        /// รายงานการเปลี่ยนยาง
        /// </summary>
        /// <returns></returns>
        public ActionResult TiresChanging()
        {
            List <TiresChanging> list = new List <TiresChanging>();

            list.Add(new TiresChanging()
            {
                CarRegis = "61-9747 กท", Date = DateTime.Now, Mile = 36520, Position = 2, PutOnBrand = "Bridgestone", PutOnSerial = "B4L2L5559", PutOnSize = "11R22.5/16PR157", TakeOffBrand = "Bridgestone", TakeOffSerial = "L01589349", TakeOffSize = "11R22.5/16PR157"
            });
            list.Add(new TiresChanging()
            {
                CarRegis = "81 - 6040", Date = DateTime.Now, Mile = 267017, Position = 5, PutOnBrand = "Bridgestone", PutOnSerial = "B4L2L5559", PutOnSize = "11R22.5/16PR157", TakeOffBrand = "Bridgestone", TakeOffSerial = "L01589349", TakeOffSize = "11R22.5/16PR157"
            });
            list.Add(new TiresChanging()
            {
                CarRegis = "50-3719", Date = DateTime.Now, Mile = 267017, Position = 10, PutOnBrand = "Bridgestone", PutOnSerial = "B4L2L5559", PutOnSize = "11R22.5/16PR157", TakeOffBrand = "Bridgestone", TakeOffSerial = "L01589349", TakeOffSize = "11R22.5/16PR157"
            });

            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/TiresChanging.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #15
0
        public async Task<ActionResult> UserStats(string _sDate, string _eDate)
        {
            //Declarations of variables
            DateTime _sdt = Convert.ToDateTime(_sDate);
            DateTime _edt = Convert.ToDateTime(_eDate).AddDays(1);
            List<userDTO> _list = new List<userDTO>();
            string _path = "";

            _path = "/CrystalReport/rptUserStats.rpt";
            //string sname = Session["LName"].ToString();

            //Database Query
            var sql =await (from a in db.TBL_WEBUSERS
                       where a.DATE_VERIFIED >= _sdt && a.DATE_VERIFIED <= _edt
                       select a).ToListAsync();

          
                foreach (var r in sql)
                {                   
                    userDTO tbl = new userDTO();
                    tbl._dateV = r.DATE_VERIFIED.ToString();
                    tbl.userName = r.USERNAME;
                    tbl.region = getRegioName(r.REGION);                   
                    _list.Add(tbl);
                }
            

            ReportClass rptH = new ReportClass();
            rptH.FileName = Server.MapPath(_path);
            rptH.Load();           
            rptH.SetDataSource(_list);
            rptH.SetParameterValue("Petsa", _sdt.ToShortDateString() + " - " + _edt.ToShortDateString());
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");
        }
        public ActionResult DescargarReporteAsignaciones(int?id)
        {
            try
            {
                //var asignaciones = ProyectoCN.ListarAsignaciones();

                var rptH = new ReportClass();
                rptH.FileName = Server.MapPath("/Reportes/AsignacionReport.rpt");
                rptH.Load();

                if (id == null)
                {
                    rptH.SetDataSource(ProyectoCN.ListarAsignaciones());
                }
                else
                {
                    rptH.SetDataSource(ProyectoCN.ListarAsignaciones(id.Value));
                }

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                //En PDF
                Stream stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);
                rptH.Dispose();
                rptH.Close();
                return(new FileStreamResult(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public ActionResult DescargarReporteProyectos()
        {
            try
            {
                var proyectos = ProyectoCN.ListarProyectos();

                var rptH = new ReportClass();
                rptH.FileName = Server.MapPath("/Reportes/ProyectosListas.rpt");
                rptH.Load();

                rptH.SetDataSource(proyectos);

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                //En PDF
                Stream stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);
                rptH.Dispose();
                rptH.Close();
                return(new FileStreamResult(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #18
0
        public Stream GetReportPDF(ReportClass report)
        {
            Stream stream = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            report.Close();

            return(stream);
        }
Пример #19
0
        public ActionResult GetBranchDetailsCR()
        {
            DataTable dt = new DataTable();
            dt = ReportsManager.GetBranchDetails(1);

            ReportClass rptH = new ReportClass();
            rptH.FileName = Server.MapPath("../Content/cr_BranchDetails.rpt");
            rptH.Load();
            rptH.SetDataSource(dt);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");
        }
Пример #20
0
        /// <summary>
        /// รายงานสรุปการเกิดอุบัติเหตุรถขนส่งประจำเดือน
        /// </summary>
        /// <returns></returns>
        public ActionResult MonthlyAccident()
        {
            List <MonthlyAccident> list = new List <MonthlyAccident>();
            ReportClass            rptH = new ReportClass(); //C:\inetpub\wwwroot\TMS\Views\Report

            rptH.FileName = Server.MapPath("~/Views/Report/MonthlyAccident.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #21
0
        /// <summary>
        /// รายงานสรุปการจ่ายค่าเที่ยวพนักงานขับรถประจำงวด
        /// </summary>
        /// <returns></returns>
        public ActionResult CarDriversPayPeriod()
        {
            List <CarDriversPayPeriod> list = new List <CarDriversPayPeriod>();
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/CarDriversPayPeriod.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #22
0
        public ActionResult Download(string reportname, ReportByProductBrandOption search)
        {
            ReportClass rptH = new ReportClass();
            rptH.FileName = ReportPath(reportname);
            var data = searchProduct(search).ToList();
            rptH.SetDataSource(data);
            rptH.SetParameterValue("datefrom", search.FromDate.ToReportFormat());
            rptH.SetParameterValue("dateto", search.ToDate.ToReportFormat());

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");
        }
Пример #23
0
        public ActionResult MonthlyTransporting()
        {
            List <MonthlyTransporting> list = new List <MonthlyTransporting>();
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/MonthlyTransporting.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #24
0
        public ActionResult RenewalReport(RenewalSearch obj, string actionType)
        {
            if (string.Equals(actionType, "Download"))
            {
                if (!string.IsNullOrEmpty(obj.Exactdate))
                {
                    obj.Fromdate = null;
                    obj.Todate   = null;
                }
                else if (!string.IsNullOrEmpty(obj.Fromdate) && !string.IsNullOrEmpty(obj.Todate))
                {
                    obj.Exactdate = "1990-01-01 00:00:00.000";
                }
                if (string.IsNullOrEmpty(obj.RenewalSearchID))
                {
                    ModelState.AddModelError("Error", "Please select By Exact Date or By Between Date !");
                }
                else if (string.IsNullOrEmpty(obj.Exactdate) && obj.RenewalSearchID == "1")
                {
                    ModelState.AddModelError("Error", "Please enter Exact date!");
                }
                else if (string.IsNullOrEmpty(obj.Fromdate) && obj.RenewalSearchID == "2")
                {
                    ModelState.AddModelError("Error", "Please enter From date!");
                }
                else if (string.IsNullOrEmpty(obj.Todate) && obj.RenewalSearchID == "2")
                {
                    ModelState.AddModelError("Error", "Please enter To date!");
                }
                else
                {
                    DataSet ds = objIRecepit.Get_RenewalReport(obj);
                    ds.Tables[0].TableName = "RecepitDataset";

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        ReportClass rptH = new ReportClass();
                        rptH.FileName = Server.MapPath("~/Reports/ExactDate.rpt");
                        rptH.Load();
                        rptH.SetDataSource(ds.Tables[0]);
                        Response.Buffer = false;
                        Response.ClearContent();
                        Response.ClearHeaders();

                        Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                        stream.Seek(0, SeekOrigin.Begin);
                        return(File(stream, "application/pdf", "RenewalReport.pdf"));
                    }
                }
            }

            return(View(obj));
        }
Пример #25
0
        public ActionResult ViewVariableProfitCost()
        {
            List <VariableProfitCost> list = new List <VariableProfitCost>();
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/VariableProfitCost.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            rptH.SetParameterValue("Date", "มิถุนายน 2559");
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #26
0
        /// <summary>
        /// รายงานการขนส่งประจำวัน
        /// </summary>
        /// <returns></returns>
        public ActionResult Transporting()
        {
            List <Transporting> list = new List <Models.Transporting>();
            //list.Add(new Models.Transporting() { BeginDate = DateTime.Now, Destination = "บ่อเต็ง/ลาว", Distance = 2350, Driver = "นายสมหวัง บรรจง", Head = "62-7340กท", Mobile = "087-079-0879", NumberOfDriver = 1, Source = "กม19", Tail = "78-2431กท", TankNO = "PXT03315004-9", WorkTime = 45 });

            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/Transporting.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #27
0
        /// <summary>
        /// รายงานการซ่อมบำรุง
        /// </summary>
        /// <returns></returns>
        public ActionResult Maintenance()
        {
            List <CKLINE.Models.Maintenance> list = new List <CKLINE.Models.Maintenance>();
            //list.Add(new Maintenance() { BeginDate = DateTime.Now, EndDate = DateTime.Now.AddDays(2), CarRegis = "บท-8340", Job = "พวงมาลัยไม่ตรง,ยางหลังปลิ", Garage = "สุภณัฐ" });
            //list.Add(new Maintenance() { BeginDate = DateTime.Now, EndDate = DateTime.Now.AddDays(2), CarRegis = "50-2162", Job = "เวลาขับรถขึ้นเขา ความร้อนจะขึ้นสูง ผิดปกติ", Garage = "ธนาศักดิ์" });
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("~/Views/Report/Maintenance.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #28
0
        //รถบรรทุก
        #region การเติมน้ำมัน
        /// <summary>
        /// รายงานการเติมแก๊ส
        /// </summary>
        /// <returns></returns>
        public ActionResult GasRefill()
        {
            List <GasRefill> list = new List <GasRefill>();
            //list.Add(new CKLINE.Models.GasRefill() { Bill = 1000, CarRegis = "61-9747 กท.", Date = DateTime.Now, EndMile = 141105, StartMile = 138826, Job = "ลานTCDกม.19-บ่อเตน-บ.แพรกซ์แอร์บางพลี-ลานTCDกม.19", Lite = 704, Total = 2278 });
            //list.Add(new CKLINE.Models.GasRefill() { Bill = 1000, CarRegis = "61-9747 กท.", Date = DateTime.Now, EndMile = 141105, StartMile = 138826, Job = "ลานTCDกม.19-บ่อเตน-บ.แพรกซ์แอร์บางพลี-ลานTCDกม.19", Lite = 704, Total = 2278 });
            ReportClass rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/GasRefill.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #29
0
        public ActionResult Print()
        { 
             ReportClass rptH = new ReportClass();
             rptH.FileName = Server.MapPath("~/Content/report/demo.rpt");
             List<dynamic> mock = new List<dynamic>();
                 for (int i=0;i<10;i++) 
                 {
                    mock.Add( new {Id = 1,Name="test"});
                 }

                 rptH.SetDataSource(mock);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        return File(stream, "application/pdf");  
        }
Пример #30
0
        public Stream GetReportPDF <TItemSource>(Object report, List <TItemSource> items)
        {
            // ReportDocument rd = new ReportDocument();
            ReportClass reporte = (ReportClass)report;

            reporte.Load();
            //reporte.Database.Tables[""].SetDataSource()
            reporte.SetDataSource(items);

            Stream stream = reporte.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            reporte.Close();
            return(stream);
        }
Пример #31
0
        public ActionResult Reporte(FormCollection form)
        {
            string pais = Request.Form["Pais"];

            if (pais == "number:0")
            {
                pais = "";
            }
            else if (pais == "number:1")
            {
                pais = "Australia";
            }
            else if (pais == "number:2")
            {
                pais = "Canada";
            }
            else if (pais == "number:3")
            {
                pais = "India";
            }


            try
            {
                string      filename = GenerateFileName("cotizacion");
                ReportClass rptH     = new ReportClass();
                rptH.FileName = Server.MapPath("~/Reportes/Reporte.rpt");

                rptH.Load();
                //logica del reporte

                rptH.SetDataSource(db.ToString().Select(p => new { idcotizacion = pais, pais = pais, ciudad = pais, curso = pais }));
                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();
                Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                stream.Seek(0, SeekOrigin.Begin);
                //  return File(stream, "application/pdf",  filename + ".pdf");
                return(File(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw;
            }

            finally
            {
            }
        }
Пример #32
0
        public ActionResult Download(string reportname, ReportByProductBrandOption search)
        {
            ReportClass rptH = new ReportClass();

            rptH.FileName = ReportPath(reportname);
            var data = searchProduct(search).ToList();

            rptH.SetDataSource(data);
            rptH.SetParameterValue("datefrom", search.FromDate.ToReportFormat());
            rptH.SetParameterValue("dateto", search.ToDate.ToReportFormat());

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
        public JsonResult InitializeHistoryReport(IenumerableReportResult model, string param)
        {
            if (string.IsNullOrEmpty(param))
            {
                return(Json(new { status = false, resCode = "0", msg = "Something went wrong with report parameters. Please re-generate report or contact support. Thank you." }, JsonRequestBehavior.AllowGet));
            }

            string[]       values     = User.Identity.Name.Split('|');
            string[]       paramValue = param.Split('|');
            ReportClass    rptH       = new ReportClass();
            dsTransHistory ds         = new dsTransHistory();

            try
            {
                DataTable dt = ListToDataTable.ToDataTable(model.HistoryReport);

                rptH.FileName = Server.MapPath("~/CrystalReport/rptTransHistory.rpt");
                rptH.Load();

                ds.Tables[0].Merge(dt);
                rptH.SetDataSource(ds);

                rptH.SetParameterValue("@date", paramValue[0].Trim().ToUpper());
                rptH.SetParameterValue("@printBy", paramValue[2].Trim());
                rptH.SetParameterValue("@runDate", paramValue[1].Trim().ToUpper());
                rptH.SetParameterValue("@TotalCredit", Convert.ToDecimal(paramValue[6].Trim()));
                rptH.SetParameterValue("@TotalDebit", Convert.ToDecimal(paramValue[4].Trim()));
                rptH.SetParameterValue("@EndingBalance", Convert.ToDecimal(paramValue[7].Trim()));
                rptH.SetParameterValue("@CreditCount", Convert.ToInt32(paramValue[5].Trim()));
                rptH.SetParameterValue("@DebitCount", Convert.ToInt32(paramValue[3].Trim()));
            }
            catch (Exception ex)
            {
                return(Json(new { status = false, resCode = "0", msg = ex.Message }, JsonRequestBehavior.AllowGet));
            }


            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();
            rptH.Dispose();
            rptH = null;

            Session["HistorySession"] = stream;
            string pdfname = "history-report" + DateTime.Now;

            return(Json(new { status = true, resCode = "1", msg = "Success", pdfName = pdfname }, JsonRequestBehavior.AllowGet));
        }
Пример #34
0
        public ActionResult TimeAttendanceReport()
        {
            Session["FMenu"] = "R4M";
            Session["Menu"]  = "R4T4";

            List <TimeAttendance> list = new List <TimeAttendance>();
            ReportClass           rptH = new ReportClass();

            rptH.FileName = Server.MapPath("/Views/Report/TimeAttendance.rpt");
            rptH.Load();
            rptH.SetDataSource(list);
            rptH.SetParameterValue("BeginDate", "มิถุนายน 2559");
            rptH.SetParameterValue("EndDate", "กรกฏาคม 2559");
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(stream, "application/pdf"));
        }
Пример #35
0
        public byte[] readRPT()
        {
            ReportClass rptH = new ReportClass();
            try
            {
                ParameterDiscreteValue par;
                rptH.FileName = file;
                rptH.Load();

                rptH.SetDataSource(listData["table"]);

                foreach (ReportDocument subreport in rptH.Subreports)
                {
                    if (listData.ContainsKey(subreport.Name.Trim().ToLower()))
                    {
                        subreport.SetDataSource(listData[subreport.Name.Trim().ToLower()]);
                    }
                }

                parameters = insencitiveParameter();
                foreach (ParameterField field in rptH.ParameterFields)
                {
                    if (parameters != null)
                    {
                        if (parameters.ContainsKey(field.Name.Trim().ToLower()))
                        {
                            par = new ParameterDiscreteValue();
                            par.Value = parameters[field.Name.Trim().ToLower()];
                            field.CurrentValues.Add(par);
                        }
                    }
                }

                System.IO.Stream stream = rptH.ExportToStream(this.type);
                byte[] buffer = new byte[stream.Length];
                stream.Read(buffer, 0, (int)stream.Length);

                return buffer;
            }
            finally
            {
                rptH.Close();
                rptH.Dispose();
            }
        }
Пример #36
0
 public ActionResult AssignValueinReport(int id)
 {
     DataTable dtbranchdetails = new DataTable();
     DataTable dtpatientvisit = new DataTable();
     using (HMSDBEntities context = new HMSDBEntities())
     {
         var branchdetails = context.sp_BranchDetails(1);
         var patientvisit = context.sp_GetReceipt(id);
         dtbranchdetails = ExtensionMethods.ConvertToDataTable(branchdetails);
         dtpatientvisit = ExtensionMethods.ConvertToDataTable(patientvisit);
         ReportClass rptH = new ReportClass();
         //rptH.FileName = Server.MapPath("~/Content/cr_RegReceipt.rpt");
         rptH.FileName = @"C:/Users/tanmay/Documents/GitHub/HMSApp/HospitalManagement/HospitalManagement/Content/cr_RegReceipt.rpt";
         rptH.Load();
         rptH.Subreports["cr_BranchDetails.rpt"].SetDataSource(dtbranchdetails);//datasource for subreport
         rptH.SetDataSource(dtpatientvisit);//Mainreport datasourcc
         Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
         return File(stream, "application/pdf");
     }
 }
 public ActionResult ReportView()
 {
     ReportClass rptH = new ReportClass();
     DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetManagerReportView, null);
     rptH.FileName = Server.MapPath("/Reports/ALLManagerrpt.rpt");
     rptH.Load();
     rptH.SetDataSource(dt);
     Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
     return File(stream, "application/pdf");
 }
        public ActionResult ReportViewExcel()
        {
            AttendanceEntity obj;

            ReportClass rptH = new ReportClass();
            ArrayList al = new ArrayList();
            rptH.FileName = Server.MapPath("/Reports/CrystalReport1.rpt");
            rptH.Load();

            List<AttendanceEntity> ItemList = (List<AttendanceEntity>)Session["opl"];

            foreach (AttendanceEntity dr in ItemList)
            {
                obj = new AttendanceEntity();

                obj.PDate = dr.PDate;
                obj.EMPID = dr.EMPID;
                obj.EName = dr.EName;
                obj.Designation = dr.Designation;
                obj.DeptName = dr.DeptName;
                obj.Intime = dr.Intime;
                obj.Outtime = dr.Outtime;
                obj.Status = dr.Status;
                al.Add(obj);
            }
            rptH.SetDataSource(al);
            MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.Excel);
            return File(stream, "application/octet-stream", "NorthTower.xls");
        }
        public ActionResult ALLManagerRPTEXCEL()
        {
            ALLManagerrptEntity obj;

            ReportClass rptH = new ReportClass();
            ArrayList al = new ArrayList();
            rptH.FileName = Server.MapPath("/Reports/ALLManagerrpt.rpt");
            rptH.Load();

            List<ManagerinfoEntity> ItemList = (List<ManagerinfoEntity>)Session["ALLMGR"];

            foreach (ManagerinfoEntity dr in ItemList)
            {
                obj = new ALLManagerrptEntity();

                obj.PDate = dr.PDate;
                obj.EMPID = dr.EMPID;
                obj.EName = dr.EName;
                obj.Designation = dr.Designation;
                obj.DeptName = dr.DeptName;
                obj.Intime = dr.Intime;
                obj.Outtime = dr.Outtime;
                obj.Status = dr.Status;
                al.Add(obj);
            }

            rptH.SetDataSource(al);
            MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.Excel);
            return File(stream, "application/octet-stream", "ManagerAttend.xls");
        }
        public ActionResult ManagerRPTEXCELall(string startDate = "", string endDate="")
        {
            ManagerinfoEntity _Model = new ManagerinfoEntity();
            _Model.StartDate = startDate;
            _Model.EndDate = endDate;
            ALLManagerrptEntity obj;

            ReportClass rptH = new ReportClass();
            ArrayList al = new ArrayList();
            rptH.FileName = Server.MapPath("/Reports/ALLManagerrpt.rpt");
            rptH.Load();

            DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetManagerRecord, _Model);
            List<ManagerinfoEntity> ItemList = null;
            ItemList = new List<ManagerinfoEntity>();

            foreach (DataRow dr in dt.Rows)
            {

                    ItemList.Add(new ManagerinfoEntity()
                    {
                        PDate = dr["PDate"].ToString(),
                        EMPID = dr["EMPID"].ToString(),
                        EName = dr["EName"].ToString(),
                        Designation = dr["Designation"].ToString(),
                        DeptName = dr["DeptName"].ToString(),
                        Intime = dr["Intime"].ToString(),
                        Outtime = dr["Outtime"].ToString(),
                        Status = dr["Status"].ToString(),
                    });

            }
            foreach (ManagerinfoEntity dr in ItemList)
            {
                obj = new ALLManagerrptEntity();

                obj.PDate = dr.PDate;
                obj.EMPID = dr.EMPID;
                obj.EName = dr.EName;
                obj.Designation = dr.Designation;
                obj.DeptName = dr.DeptName;
                obj.Intime = dr.Intime;
                obj.Outtime = dr.Outtime;
                obj.Status = dr.Status;
                al.Add(obj);
            }

            rptH.SetDataSource(al);
            MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.Excel);
            return File(stream, "application/octet-stream", "ManagerAttend.xls");
        }
Пример #41
0
        public ActionResult GenerateReport(string empresa,string entidade)
        {
            ClientesDataSet dt = imprimirPdf(empresa,entidade);
            
            ReportClass objReport = new ReportClass();
            objReport.FileName = Server.MapPath("/Content/Reports/ExtratoPendentes.rpt");
            objReport.Load();

            //objReport.SetDataSource(dt);
            
            objReport.SetDataSource(dt.Tables["Pendentes"]);
            objReport.Database.Tables["Pendentes"].SetDataSource(dt.Tables["Pendentes"]);
            objReport.Database.Tables["Clientes"].SetDataSource(dt.Tables["Clientes"]);

            objReport.Subreports["ContasBancarias"].SetDataSource(dt.Tables["Banco"]);

            objReport.OpenSubreport("Pendentes").SetDataSource(dt.Tables["Pendentes"]);
            objReport.DataDefinition.FormulaFields["NomeEmpresa"].Text = "'" + "Accsys" + "'";
            objReport.DataDefinition.FormulaFields["MoradaEmpresa"].Text = "'" + "Maputo" + "'";
            objReport.DataDefinition.FormulaFields["LocalidadeEmpresa"].Text = "'" + "Maputo" + "'";
            objReport.DataDefinition.FormulaFields["TelefoneEmpresa"].Text = "'+ " + "+258" + "'";
            objReport.DataDefinition.FormulaFields["NuitEmpresa"].Text = "' Nuit : " + "123456" + "'";
            objReport.DataDefinition.FormulaFields["EmailEmpresa"].Text = "'" + "*****@*****.**" + "'";
            //objReport.DataDefinition.FormulaFields["Ao_Cuidado_de"].Text = "' " + objectoContacto.Titulo + " " + objectoContacto.PrimeiroNome + " " + objectoContacto.UltimoNome + "'";
                
            
            Stream stream = objReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");
        }
Пример #42
0
        public async Task<ActionResult> PrintOR(string _orNo)
        {
            List<orDTO> _list = new List<orDTO>();
            string _path = "";
            _path = "/CrystalReport/rptOR.rpt";
            var sql = await (from tcol in db.T_COLLECTION from tbilld in db.T_BILLCHRGD
                             from tbillh in db.T_BILLCHRGH from mpai in db.M_PAIP
                             where tbilld.BCDSINO == tcol.COLREFNO &&
                             tbilld.COLORNUM == tcol.COLORNUM &&
                             tcol.COLORNUM == _orNo &&
                             tbilld.BCHCHRGNO == tbillh.BCHCHRGNO &&
                             tbillh.PAPIN == mpai.PAPIN
                             select new { T_COLLECTION = tcol, T_BILLCHRGD = tbilld, M_PAIP = mpai}).ToListAsync();                                                                                          
            foreach (var r in sql)
            {
                orDTO tbl = new orDTO();
                //tbl.colamt = r.T_COLLECTION.COLAMT.ToString();
                //tbl.basic_premium = r.T_BILLCHRGD.BASIC_PREMIUM.ToString();
                //tbl.doc_stamp = r.T_BILLCHRGD.DOC_STAMP.ToString();
                //tbl.comp_fee = r.T_BILLCHRGD.COMP_FEE.ToString();
                //tbl.cert_fee = r.T_BILLCHRGD.CERT_FEE.ToString();
                //tbl.tax_amtd = r.T_BILLCHRGD.TAX_AMT.ToString();
                //tbl.e_vat = r.T_BILLCHRGD.E_VAT.ToString();
                //tbl.lgt = r.T_BILLCHRGD.LGT.ToString();
                //tbl.coi = r.T_BILLCHRGD.COI.ToString();
                //tbl.colordte = r.T_COLLECTION.COLORDTE.ToString();
                //tbl.colpayor = r.T_COLLECTION.COLPAYOR.ToString();
                //tbl.colno = r.T_COLLECTION.COLNO.ToString();
                //tbl.clientcd = r.T_COLLECTION.CLIENTCD.ToString();
                //tbl.colpymtyp = r.T_COLLECTION.COLPYMTYP.ToString();
                //tbl.colornum = r.T_COLLECTION.COLORNUM.ToString();
                //tbl.usrid = r.T_COLLECTION.USRID.ToString();
                //tbl.with_tax = r.T_COLLECTION.WITH_TAX.ToString();
                //tbl.tax_amt = r.T_COLLECTION.TAX_AMT.ToString();
                //tbl.paddress = r.M_PAIP.PAADDRESS.ToString();
                //tbl.plateno = r.M_PAIP.PLATE_NO.ToString();
                //tbl.bcdesc = r.T_BILLCHRGD.BCDESC.ToString();
                //tbl.bcdsp = r.T_BILLCHRGD.BCDSP.ToString();
                //if (Session["UserType"].ToString() == "INTERNAL USER")
                //{
                //    tbl.cashier = Session["LName"].ToString();
                //}
                //else { tbl.cashier = ""; }

                //if (r.M_PAIP.BY_COMPNAME != "1")
                //{
                //    tbl.company = r.M_PAIP.PALNAME + ", " + r.M_PAIP.FIRST_NAME + " " + r.M_PAIP.MIDDLE_NAME;
                //}
                //else
                //{
                //    tbl.company = r.M_PAIP.COMPANY_NAME.ToString();
                //}
                //tbl.firstname = r.M_PAIP.FIRST_NAME.ToString();
                //tbl.middlename = r.M_PAIP.MIDDLE_NAME.ToString();
                //tbl.lastname = r.M_PAIP.PALNAME.ToString();
                //tbl.company = r.M_PAIP.COMPANY_NAME.ToString();

                tbl.papinNo = r.M_PAIP.PAPIN;
                tbl.assTin = r.M_PAIP.ASSURED_TIN;
                tbl.clientName = r.T_COLLECTION.COLPAYOR;
                tbl.clientAddress = r.M_PAIP.PAADDRESS;

                tbl.orDate = r.T_COLLECTION.COLORDTE.ToShortDateString();
                tbl.orNo = r.T_COLLECTION.COLORNUM;
                tbl.paymentType = r.T_COLLECTION.COLPYMTYP;

                tbl.basicPremium = Convert.ToDecimal(r.T_BILLCHRGD.BASIC_PREMIUM);
                tbl.eVat = Convert.ToDecimal(r.T_BILLCHRGD.E_VAT);
                tbl.otherCharges = Convert.ToDecimal(r.T_COLLECTION.COLAMT) +
                    Convert.ToDecimal(r.T_BILLCHRGD.DOC_STAMP) +
                    Convert.ToDecimal(r.T_BILLCHRGD.COMP_FEE) +
                    Convert.ToDecimal(r.T_BILLCHRGD.CERT_FEE) +
                    Convert.ToDecimal(r.T_BILLCHRGD.TAX_AMT) +
                    Convert.ToDecimal(r.T_BILLCHRGD.LGT) +
                    Convert.ToDecimal(r.T_COLLECTION.TAX_AMT) +
                    Convert.ToDecimal(r.T_BILLCHRGD.BCDSP);
                tbl.TotalAmount = tbl.basicPremium + tbl.eVat + tbl.otherCharges;
                tbl.cashierAgent = r.T_COLLECTION.USRID;
                _list.Add(tbl);
            }

            ReportClass rptH = new ReportClass();
            rptH.FileName = Server.MapPath(_path);
            rptH.Load();
            rptH.SetDataSource(_list);
            //rptH.SetParameterValue("Petsa", _sdt.ToShortDateString() + " - " + _edt.ToShortDateString());
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");

        }
        public ActionResult TimeSheetPrint(string name, DateTime startDate, DateTime endDate)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException(name);
            if (startDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("startDate");
            if (endDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("endDate");

            DataTable dataTable = GetDriverOperatorTimeSheetTable(name, startDate, endDate);
            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/Timesheet.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Driver / Operator Time Sheet";
            reportClass.Database.Tables["DriverOperatorTimeSheet"].SetDataSource(dataTable);
            reportClass.SetParameterValue("DriverOperatorNameParameter", name);
            reportClass.SetParameterValue("StartDateParameter", startDate.ToString("d"));
            reportClass.SetParameterValue("EndDateParameter", endDate.ToString("d"));

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }
        public ActionResult Appearldaycalrpt()
        {
            AppearldaycalrptEntity obj;
            ReportClass rptH = new ReportClass();
            ArrayList al = new ArrayList();
            rptH.FileName = Server.MapPath("/Reports/Appearldaycalrpt.rpt");
            rptH.Load();

            List<AppearldaycalEntity> ItemList = (List<AppearldaycalEntity>)Session["Appreal"];

            foreach (AppearldaycalEntity dr in ItemList)
            {
                obj = new AppearldaycalrptEntity();

                obj.EMPID = dr.EMPID;
                obj.ENAME = dr.ENAME;
                obj.SECTION = dr.SECTION;
                obj.JDate = dr.JDate;
                obj.Status = dr.Status;
                obj.TTDay = dr.TTDay;
                obj.Holiday = dr.Holiday;
                obj.Present = dr.Present;
                obj.Absent = dr.Absent;
                obj.CL = dr.CL;
                obj.SL = dr.SL;
                obj.ML = dr.ML;
                obj.EL = dr.EL;

                al.Add(obj);
            }

            rptH.SetDataSource(al);
            MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");
        }
        public ActionResult VehicleMachineRegisterPrint(DateTime startDate, DateTime endDate)
        {
            if (startDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("startDate");
            if (endDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("endDate");

            DataTable dataTable = GetVehicleMachineRegisterReportTable(startDate, endDate);
            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/VehicleMachineRegisterReport.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Vehicle Machine Register Report";
            reportClass.Database.Tables["VehicleMachineRegister"].SetDataSource(dataTable);
            reportClass.SetParameterValue("StartDateParameter", startDate.ToString("d"));
            reportClass.SetParameterValue("EndDateParameter", endDate.ToString("d"));

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }
        public ActionResult AppearlDeptrpt()
        {
            ApparelWiserptEntity obj;

             ReportClass rptH = new ReportClass();
             ArrayList al = new ArrayList();
             rptH.FileName = Server.MapPath("/Reports/AppearlDeptrpt.rpt");
             rptH.Load();

             List<ApprealInfoEntity> ItemList = (List<ApprealInfoEntity>)Session["APPDept"];

             foreach (ApprealInfoEntity dr in ItemList)
             {
                 obj = new ApparelWiserptEntity();

                 obj.PDate = dr.PDate;
                 obj.EMPID = dr.EMPID;
                 obj.EName = dr.EName;
                 obj.Designation = dr.Designation;
                 obj.DeptName = dr.DeptName;
                 obj.Intime = dr.Intime;
                 obj.Outtime = dr.Outtime;
                 obj.Status = dr.Status;
                 al.Add(obj);
             }

             rptH.SetDataSource(al);
             MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.PortableDocFormat);
             return File(stream, "application/pdf");
        }
        public ActionResult NorthtowerDeptrptExcel()
        {
            EmployeeWise obj;

             ReportClass rptH = new ReportClass();
             ArrayList al = new ArrayList();
             rptH.FileName = Server.MapPath("/Reports/NTDeptrpt.rpt");
             rptH.Load();

             List<EmployeewiseEntity> ItemList = (List<EmployeewiseEntity>)Session["NTDept"];

             foreach (EmployeewiseEntity dr in ItemList)
             {
                 obj = new EmployeeWise();

                 obj.PDate = dr.PDate;
                 obj.EMPID = dr.EMPID;
                 obj.EName = dr.EName;
                 obj.Designation = dr.Designation;
                 obj.DeptName = dr.DeptName;
                 obj.Intime = dr.Intime;
                 obj.Outtime = dr.Outtime;
                 obj.Status = dr.Status;
                 al.Add(obj);
             }

             rptH.SetDataSource(al);
             MemoryStream stream = (MemoryStream)rptH.ExportToStream(ExportFormatType.Excel);   //For Excel File
             return File(stream, "application/octet-stream", "NorthTower.xls");    //For Excel with File Name
        }
        public ActionResult NorthTowerrptall(string p1 = "", string p2 = "")
        {
            AttendanceEntity _Model = new AttendanceEntity();
            _Model.StartDate = p1;
            _Model.EndDate = p2;
            AttendanceEntity obj;

            //ReportClass rptH = new ReportClass();
            ReportClass rpt = new ReportClass();
            ArrayList al = new ArrayList();
            rpt.FileName = Server.MapPath("/Reports/CrystalReport1.rpt");
            rpt.Load();

            DataTable dt = (DataTable)ExecuteDB(ERPTask.AG_GetAttenInfoRecord, _Model);
            List<AttendanceEntity> ItemList = null;
            ItemList = new List<AttendanceEntity>();
               // List<NorthTowerdaycal> ItemList = (List<NorthTowerdaycal>)Session["NTR"];
               foreach (DataRow dr in dt.Rows)
               {
               ItemList.Add(new AttendanceEntity()
            {
                PDate = dr["PDate"].ToString(),
                EMPID = dr["EMPID"].ToString(),
                EName = dr["EName"].ToString(),
                Designation = dr["Designation"].ToString(),
                DeptName = dr["DeptName"].ToString(),
                Intime = dr["Intime"].ToString(),
                Outtime = dr["Outtime"].ToString(),
                Status = dr["Status"].ToString(),
            });
               }
               foreach (AttendanceEntity dr in ItemList)
               {
               obj = new AttendanceEntity();

               obj.PDate = dr.PDate;
               obj.EMPID = dr.EMPID;
               obj.EName = dr.EName;
               obj.Designation = dr.Designation;
               obj.DeptName = dr.DeptName;
               obj.Intime = dr.Intime;
               obj.Outtime = dr.Outtime;
               obj.Status = dr.Status;
               al.Add(obj);
               }
            rpt.SetDataSource(al);
            MemoryStream stream = (MemoryStream)rpt.ExportToStream(ExportFormatType.Excel);
            return File(stream, "application/octet-stream", "ManagerAttend.xls");
        }
        public ActionResult HireBillPrivatePrint(DateTime startDate, DateTime endDate, int vehicleNo)
        {
            if (startDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("startDate");
            if (endDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("endDate");
            if (vehicleNo == 0)
                throw new InvalidArgumentException("Vehicle No can not be 0", EngineExceptionErrorID.InvalidArgument);

            IVehicleService vehicleService = new VehicleService();
            var vehicle = vehicleService.GetVehicle(vehicleNo);
            DataTable dataTable = GetHireBillPrivateReportTable(startDate, endDate, vehicleNo, vehicle.IsVehicle);
            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/HireBillPrivateReport.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Hire Bill (Private) Report";
            reportClass.Database.Tables["HireBillPrivateReport"].SetDataSource(dataTable);
            reportClass.SetParameterValue("StartDateParameter", startDate.ToString("d"));
            reportClass.SetParameterValue("EndDateParameter", endDate.ToString("d"));
            reportClass.SetParameterValue("VehicleNumberParameter", vehicle.VehicleNumber);
            reportClass.SetParameterValue("OwnerNameParameter", vehicle.OwnerName);
            string measure = vehicle.IsVehicle ? " Rs/Km" : " Rs/Hr";
            reportClass.SetParameterValue("HireRateParameter", vehicle.HireRate.ConvertToDecimalString() + measure);

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }
Пример #50
0
        public async Task<ActionResult> StatsIncome(string _sDate, string _eDate)
        {
            DateTime _sdt = Convert.ToDateTime(_sDate);
            DateTime _edt = Convert.ToDateTime(_eDate).AddDays(1);
            List<TBChDDTO> _list = new List<TBChDDTO>();
            string _path = "";
            _path = "/CrystalReport/rptStatsIncome.rpt";
            var sql = await (from a in db.T_BILLCHRGD
                              where a.DATE_PRINTED >= _sdt && a.DATE_PRINTED <= _edt
                              select a).ToListAsync();
            foreach (var r in sql)
                {
                    TBChDDTO tbl = new TBChDDTO();
                    tbl._id = r.BILLD_ID.ToString();
                    tbl._total =Convert.ToDecimal(r.BCDPATCOVER);
                    tbl.region = getRegioName(r.REGION);
                    _list.Add(tbl);
                }

                ReportClass rptH = new ReportClass();
                rptH.FileName = Server.MapPath(_path);
                rptH.Load();
                rptH.SetDataSource(_list);
                rptH.SetParameterValue("Petsa", _sdt.ToShortDateString() + " - " + _edt.ToShortDateString());
                Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                return File(stream, "application/pdf");
                                 
        }
        public ActionResult HireBillPrint(DateTime startDate, DateTime endDate, int projectId, string projectName)
        {
            if (startDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("startDate");
            if (endDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("endDate");
            if (projectId == 0)
                throw new InvalidArgumentException("Project Id can not be 0", EngineExceptionErrorID.InvalidArgument);

            decimal totalAmount = decimal.Zero;
            DataTable dataTable = GetHireBillReportTable(startDate, endDate, projectId, out totalAmount);
            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/HireBillReport.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Hire Bill Report";
            reportClass.Database.Tables["HireBillReport"].SetDataSource(dataTable);
            reportClass.SetParameterValue("StartDateParameter", startDate.ToString("d"));
            reportClass.SetParameterValue("EndDateParameter", endDate.ToString("d"));
            reportClass.SetParameterValue("ProjectParameter", projectName);
            reportClass.SetParameterValue("TotalAmountParameter", totalAmount.ToString("C").Replace("$", string.Empty));

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }
        public ActionResult Print(int id)
        {
            IVehicleService vehicleServcie = new VehicleService();
            IProjectService projectService = new ProjectService();
            IPumpstationService pumpstationService = new PumpstationService();
            var pumpstations = pumpstationService.GetAllPumpstations();
            var projects = projectService.GetAllActiveProjects();
            var lubricants = vehicleServcie.GetAllLubricantTypes();
            var vehicles = vehicleServcie.GetAllVehicles();
            var chart = runningchartService.GetRunningChart(id);

            dsRunningchart ds = new dsRunningchart();
            DataTable runningchartTable = ds.Tables["Runningchart"].Clone();
            DataTable runningchartDetailsTable = ds.Tables["RunningchartDetails"].Clone();
            DataTable runningchartPumpstationsTable = ds.Tables["RunningchartPumpstation"].Clone();
            DataTable runningchartLubricantsTable = ds.Tables["RunningchartLubricant"].Clone();

            PopulateRunningchartTable(chart, runningchartTable, vehicles);
            PopulateRunningchartDetailsTable(chart.RunningchartDetails, runningchartDetailsTable, projects);
            PopulateRunningchartPumpstationTable(chart.RunningchartPumpstation, runningchartPumpstationsTable, pumpstations);
            PopulateRunningchartLubricantTable(chart.RunningchartLubricants, runningchartLubricantsTable, pumpstations, lubricants);

            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/Runningchart.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Running Chart";
            reportClass.Database.Tables["Runningchart"].SetDataSource(runningchartTable);
            reportClass.Database.Tables["RunningchartDetails"].SetDataSource(runningchartDetailsTable);
            reportClass.Database.Tables["RunningchartPumpstation"].SetDataSource(runningchartPumpstationsTable);
            reportClass.Database.Tables["RunningchartLubricant"].SetDataSource(runningchartLubricantsTable);

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }
Пример #53
0
        protected ActionResult RenderReport(string reportName, Action<ReportClass> reportCallback,ExportFormatType format)
        {
            ReportClass rptH = new ReportClass();
            rptH.FileName = Server.MapPath(string.Format("~/Content/report/{0}.rpt", reportName));
            reportCallback(rptH);

            Stream stream = rptH.ExportToStream(format);
            var contentype = "application/pdf";
            switch (format)
            { 
                case ExportFormatType.Excel:
                    contentype = "application/vnd.ms-excel";
                    break;
            }
            return File(stream, contentype);
        }
        public ActionResult WorkDonePrint(DateTime startDate, DateTime endDate, int vehicleNo)
        {
            if (startDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("startDate");
            if (endDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("endDate");
            if (vehicleNo == 0)
                throw new InvalidArgumentException("Vehicle No can not be 0", EngineExceptionErrorID.InvalidArgument);

            IVehicleService vehicleService = new VehicleService();
            var vehicle = vehicleService.GetVehicle(vehicleNo);
            var compCode = string.IsNullOrWhiteSpace(vehicle.CompanyCode) || string.Equals(vehicle.CompanyCode.ToLower(), "no") ? "N/A" : vehicle.CompanyCode;
            var measure = vehicle.IsVehicle ? " Km" : " Hrs";
            var totalWorkDone = decimal.Zero;
            var totalFuelUsed = decimal.Zero;

            DataTable dataTable = GetWorkDoneReportTable(startDate, endDate, vehicleNo, measure, out totalWorkDone, out totalFuelUsed);
            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/WorkDoneReport.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Work Done Report – Vehicle/Machine";
            reportClass.Database.Tables["WorkDoneReport"].SetDataSource(dataTable);
            reportClass.SetParameterValue("StartDate", startDate.ToString("d"));
            reportClass.SetParameterValue("EndDate", endDate.ToString("d"));
            reportClass.SetParameterValue("VehicleNo", vehicle.VehicleNumber);
            reportClass.SetParameterValue("CompanyCode", compCode);
            reportClass.SetParameterValue("TotalWorkDone", totalWorkDone.ToString("C").Replace("$", string.Empty) + " " + measure);
            reportClass.SetParameterValue("TotalFuelUsed", totalFuelUsed.ToString("C").Replace("$", string.Empty) + " L");
            reportClass.SetParameterValue("WorkDoneHeading", "Work Done (" + measure.Trim() + ")");

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }
Пример #55
0
        public ActionResult GetReceipt(int id)
        {
            DataSet ds = new DataSet();
            ds = ReportsManager.GetReceipt(id, 1);

            ReportClass rptH = new ReportClass();
            //rptH.FileName = Server.MapPath("../Content/cr_RegReceipt.rpt");
            rptH.FileName = @"C:/Users/tanmay/Documents/GitHub/HMSApp/HospitalManagement/HospitalManagement/Content/cr_RegReceipt.rpt";
            rptH.Load();
            //rptH.SetDataSource(ds.Tables["dtpatientvisit"]);
            rptH.SetDataSource(ds.Tables["Table1"]);
            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(stream, "application/pdf");
        }
        //public ActionResult GenerateReport(DateTime startDate, DateTime endDate)
        //{

        //    //SqlConnection con = new SqlConnection(/*conDB.conString*/"Data Source=USER-PC\\SQLEXPRESS;Initial Catalog=DB_AAJI;User ID=sa;Password=admin123;");

        //    //DataTable dt = new DataTable();
        //    //try
        //    //{
        //    //    con.Open();
        //    //    SqlCommand cmd = new SqlCommand("SELECT * FROM dbo.PurchaseRequestHeaders", con);
        //    //    SqlDataAdapter adp = new SqlDataAdapter(cmd);
        //    //    adp.Fill(dt);
        //    //}
        //    //catch (Exception ex)
        //    //{ 

        //    //}

        //    //ReportClass rptH = new ReportClass();
        //    //rptH.FileName = Server.MapPath("/Content/Reports/PurchaseRequestReport.rpt");
        //    //rptH.Load();
        //    ////rptH.SetDataSource(dt);
        //    //Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

        //    //ReportDocument rd = new ReportDocument();
        //    //rd.Load(Path.Combine(Server.MapPath("~/Content/Reports"), "ReportPurchaseRequest.rpt"));
        //    //rd.SetDataSource(dt);

        //    //try
        //    //{
        //    //    Stream streams = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        //    //    streams.Seek(0, SeekOrigin.Begin);
        //    //    //return File(streams, "application/pdf", "PurchaseRequestReport.pdf");
        //    //    return File(streams, "application/pdf", "ReportPurchaseRequest.pdf");   
        //    //}
        //    //catch(Exception exc)
        //    //{
        //    //    throw;
        //    //}

        //    string strConnection = conDB.conString;// System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
        //    using (SqlCommand cmd = new SqlCommand())
        //    {
        //        using (SqlDataAdapter da = new SqlDataAdapter())
        //        {
        //            ReportDocument rpt = new ReportDocument();
        //            rpt.Load(Path.Combine(Server.MapPath("~/Content/Reports"), "ReportPurchaseRequest.rpt"));
        //            DataSet ds = new DataSet();
        //            cmd.CommandText = "sp_reportPurchaseRequest";
        //            cmd.Connection = new SqlConnection(strConnection);
        //            cmd.CommandType = CommandType.StoredProcedure;
        //            cmd.Parameters.AddWithValue("@startDate", startDate);
        //            cmd.Parameters.AddWithValue("@endDate", endDate);
        //            da.SelectCommand = cmd;
        //            da.Fill(ds);
        //            rpt.SetParameterValue("@startDate", startDate);
        //            rpt.SetParameterValue("@endDate", endDate);
        //            //rpt.SetDataSource(ds);
        //            //rpt.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "test.pdf");

        //            foreach (IDataParameter param in cmd.Parameters)
        //            {
        //                if (param.Value == null) param.Value = DBNull.Value;
        //            }

        //            Stream streams = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        //            streams.Seek(0, SeekOrigin.Begin);
        //            return File(streams, "application/pdf", "ReportPurchaseRequest.pdf");   
        //        }
        //    }
        //}

        //[HttpPost]
        public ActionResult GenerateReport(DateTime startDate, DateTime endDate)
        {
            DataTable dtSalesReport = new DataTable();
 
            using (SqlConnection conn = new SqlConnection(conDB.conString))
            {
                SqlCommand cmd = new SqlCommand();
                SqlDataAdapter da = new SqlDataAdapter();
                 
 
                cmd.Connection = conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "sp_reportPurchaseRequest";
 
                conn.Open();
                da.SelectCommand = cmd;
                da.Fill(dtSalesReport);
 
            }

            //ReportDocument reportDocument = new ReportDocument();
            //reportDocument.Load(Path.Combine(Server.MapPath("~/Content/Reports"), "ReportPurchaseRequest.rpt"));
            //reportDocument.SetDataSource(dtSalesReport);

            ReportClass reportDocument = new ReportClass();
            reportDocument.FileName = Server.MapPath("/Content/Reports/PurchaseRequestReport.rpt");
            reportDocument.Load();

            Response.Buffer = false;
            Response.ClearContent();
            Response.ClearHeaders();

            try
            { 
                Stream fstream = reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                fstream.Seek(0, SeekOrigin.Begin);
                return File(fstream, "application/pdf");
            }
            catch(Exception exc)
            {
                string a = exc.Message;
                throw;
            }
 
        }
        public ActionResult FuelAndLubricantPrint(DateTime startDate, DateTime endDate, int pumpstationId, string pumpstationName)
        {
            if (startDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("startDate");
            if (endDate.Equals(DateTime.MinValue))
                throw new ArgumentNullException("endDate");
            if (pumpstationId == 0)
                throw new InvalidArgumentException("Pumpstation Id can not be 0", EngineExceptionErrorID.InvalidArgument);

            DataTable dataTable = GetFuelAndLubricantReportTable(startDate, endDate, pumpstationId);
            ReportClass reportClass = new ReportClass();
            reportClass.FileName = Server.MapPath("~/Reports/FuelAndLubricantReport.rpt");
            reportClass.Load();
            reportClass.SummaryInfo.ReportTitle = "Fuel & Lubricant Report";
            reportClass.Database.Tables["FuelAndLubricantReport"].SetDataSource(dataTable);
            reportClass.SetParameterValue("StartDateParameter", startDate.ToString("d"));
            reportClass.SetParameterValue("EndDateParameter", endDate.ToString("d"));
            reportClass.SetParameterValue("PumpstationParameter", pumpstationName);

            Stream compStream = reportClass.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            return File(compStream, "application/pdf");
        }