private void remision(HttpContext context) { try { option = context.Request["opt"].ToString(); id = Convert.ToInt32(context.Request["id"]); switch (option) { case "getById": response = JsonConvert.SerializeObject(AlmacenCtrl.tarimaRemisionGetAllInfoById(id)); break; default: break; } } catch { throw; } }
private void printReport(string rpt) { string path = string.Empty; string pathImg = string.Empty; string virtualPath = string.Empty; string RptFileName = string.Empty; string TemplatePath = string.Empty; bool withDet = true; object obj; int id = 0; dsReport ds = new dsReport(); switch (rpt) { case "entradaAlm": obj = (Entrada)Session["SEntrada"]; if (obj == null) { id = Convert.ToInt32(Request["_key"].ToString()); withDet = Convert.ToBoolean(Request["_wdet"].ToString()); obj = EntradaCtrl.EntradaGetAllDataById(id); } RptFileName = ((Entrada)obj).Folio + ((Entrada)obj).Folio_indice + ".pdf"; path = HttpContext.Current.Server.MapPath("~/rpt/entradasAlm/") + RptFileName; //pathImg = HttpContext.Current.Server.MapPath("~/images/logo.jpg"); if (((Entrada)obj).IsActive) { TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/ealm.rpt"); } else { TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/ealmCan.rpt"); } string TemplatePathTarima = HttpContext.Current.Server.MapPath("~/rpt/TemplatePallet.pdf"); DocEntrada.getEntradaAlm(path, TemplatePath, TemplatePathTarima, (Entrada)obj, ds, withDet); //this.getRpt(path, TemplatePath, (Entrada)obj, ds); //ReportDocument reporte = new ReportDocument(); //reporte.Load(HttpContext.Current.Server.MapPath("~/report/Almacen/EntradaAlm.rpt")); //reporte.SetParameterValue("direccion_bodega", "Luisa 208, col. Nativitas, Benito Juárez. C.P. 03500. México, CDMX"); ////reporte.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "Test"); //reporte.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path); ////VisorCR.ReportSource = reporte; ShowPdf(path); break; case "remision": id = Convert.ToInt32(Request["_key"].ToString()); Tarima_almacen_remision o = AlmacenCtrl.tarimaRemisionGetAllInfoById(id); RptFileName = o.Folio + ".pdf"; path = HttpContext.Current.Server.MapPath("~/rpt/remisionAlm/") + RptFileName; TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/ralm.rpt"); ControlRptAlmacen.getRemision(path, TemplatePath, ds, o); ShowPdf(path); break; case "carga": id = Convert.ToInt32(Request["_key"].ToString()); Tarima_almacen_carga oTAC = AlmacenCtrl.CargaRpt(id); RptFileName = oTAC.Folio_orden_carga + ".pdf"; path = HttpContext.Current.Server.MapPath("~/rpt/cargaAlm/") + RptFileName; TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/Carga.rpt"); ControlRptAlmacen.getCarga(path, TemplatePath, ds, oTAC); ShowPdf(path); break; case "salidaAlm": id = Convert.ToInt32(Request["_key"].ToString()); obj = SalidaCtrl.SalidaGetAllDataById(id); RptFileName = ((Salida)obj).Folio + ((Salida)obj).Folio_indice + ".pdf"; path = HttpContext.Current.Server.MapPath("~/rpt/salidasAlm/") + RptFileName; AlmacenCtrl.CargaSetSalida(((Salida)obj)); //pathImg = HttpContext.Current.Server.MapPath("~/images/logo.jpg"); if (((Salida)obj).IsActive) { TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/salm.rpt"); } else { TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/salmCan.rpt"); } DocSalida.getSalidaAlm(path, TemplatePath, (Salida)obj, ds); ShowPdf(path); break; case "salidaAlmXls": id = Convert.ToInt32(Request["_key"].ToString()); obj = SalidaCtrl.SalidaGetAllDataById(id); RptFileName = ((Salida)obj).Folio + ((Salida)obj).Folio_indice + ".xls"; path = HttpContext.Current.Server.MapPath("~/rpt/salidasAlm/") + RptFileName; AlmacenCtrl.CargaSetSalida(((Salida)obj)); if (((Salida)obj).IsActive) { TemplatePath = HttpContext.Current.Server.MapPath("~/report/Almacen/salm.rpt"); DocSalida.getSalidaAlmXls(path, TemplatePath, (Salida)obj, ds); } ShowXls(path, RptFileName); break; } }