public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Movimiento_Entre_Fechas rpt = new Movimiento_Entre_Fechas(); rpt.Site = this.Site; return(rpt); }
public ActionResult Movimiento_Entre_Fechas() { var Encargado = Usuario(); var EncargadoName = db.tbUsuario.Where(x => x.usu_Id == Encargado).Select(i => new { i.usu_Nombres, i.usu_Apellidos }).FirstOrDefault(); ReportDocument rd = new ReportDocument(); Stream stream = null; ERP_GMEDINA.Reports.Movimiento_Entre_Fechas inv = new ERP_GMEDINA.Reports.Movimiento_Entre_Fechas(); ERP_GMEDINA.Dataset.Reportes SalidaDST = new ERP_GMEDINA.Dataset.Reportes(); var SalidaTableAdapter = new UDV_Inv_Movimiento_Entre_FechasTableAdapter(); try { SalidaTableAdapter.Fill(SalidaDST.UDV_Inv_Movimiento_Entre_Fechas); inv.SetDataSource(SalidaDST); inv.SetParameterValue("Usuario", EncargadoName.usu_Nombres + " " + EncargadoName.usu_Apellidos); stream = inv.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); inv.Close(); inv.Dispose(); string fileName = "Movimiento_Entre_Fechas.pdf"; Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName); return(File(stream, "application/pdf")); } catch (Exception Ex) { Ex.Message.ToString(); throw; } }