No estoy seguro de cómo redactar esta pregunta ... ¡así que las ediciones son bienvenidas! De todos modos ... aquí va.¿Cómo se establece el nombre del archivo al transmitir un PDF en un navegador?
Actualmente, uso Crystal Reports para generar Pdfs y simplemente transmitir la salida al usuario. Mi código es el siguiente:
System.IO.MemoryStream stream = new System.IO.MemoryStream();
stream = (System.IO.MemoryStream)this.Report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
this.Response.Clear();
this.Response.Buffer = true;
this.Response.ContentType = "application/pdf";
this.Response.BinaryWrite(stream.ToArray());
this.Response.End();
Después de ejecutar este código se transmite el PDF a la apertura del navegador hasta Acrobat Reader. ¡Funciona genial!
Mi problema es cuando el usuario intenta guardar el archivo por defecto al nombre del archivo real ... en este caso se predetermina a CrystalReportPage.pdf. ¿Hay alguna manera de configurar esto? ¿Si es así, cómo?
Cualquier ayuda sería apreciada.