protected void Page_Load(object sender, EventArgs e) { ClGestion = new Cl_Gestion_Registro(); ClUtilitarios = new Cl_Utilitarios(); DataSet ds = new DataSet(); ds = ClGestion.ImpresionAdmisionExpediente(Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["gestion"].ToString()), true)), Convert.ToInt32(ClUtilitarios.Decrypt(HttpUtility.UrlDecode(Request.QueryString["subcategoria"].ToString()), true))); Reporte.PrintOptions.PaperOrientation = PaperOrientation.Portrait; Reporte.SetDataSource(ds); string NomReporte = NomReporte = Guid.NewGuid().ToString() + ".pdf"; string url = Server.MapPath(".") + @"\" + DirRep + NomReporte; DiskFileDestinationOptions options2 = new DiskFileDestinationOptions { DiskFileName = url }; ExportOptions exportOptions = Reporte.ExportOptions; exportOptions.ExportDestinationType = ExportDestinationType.DiskFile; exportOptions.ExportFormatType = ExportFormatType.PortableDocFormat; exportOptions.ExportDestinationOptions = options2; Reporte.Export(); url = DirApp + DirRepLong + NomReporte; base.Response.Redirect(url); }