We know this, and that’s
why we are changing the content type of the response, so it is able to open a
file with a local acrobat reader. This approach has served us in the past when
we were all servlets and EJBs. We have thoughts around using getURL(), but how
do we get the response to write to a new window? De: You cannot load
.pdf files into the flash player, I think you will have to open a new
window or load it into an iFrame on top of your application à Philippe
Maegerman From:
Hi all, We have developed a Flex app which is in production
now. However, we have a new requirement, which asks for the ability to download
PDF files. These files are reports that are generated dynamically. I have
successfully set up the report generation, and am using this piece of code in
my Delegate (since we are using the cairngorm microarchitecture) to make it
work: public void printDetalleLineaBancaria(String ticket,
Integer idDetalleLiquidacion, String status) throws FileNotFoundException,
IOException {
HttpServletResponse response = Gateway.getHttpResponse();
response.setContentType("application/pdf");
response.setHeader("Content-Disposition",
"attachment;filename=\"MyReport.pdf" + "\""); byte[] b =
generateJasperReport("MyReport");
response.setContentLength(b.length); int offset
= 0; int
numRead = 0; while
(offset < b.length && (numRead = fis.read(b, offset, b.length -
offset)) >= 0) {
offset += numRead; }
fis.close();
response.getOutputStream().write(b); } I am associating this method to a button, gong
through all the cairngorm components. However, I am not getting any results.
The browser's status bar indicates it is loading something, then it stops and
freezes with "Transferring Data from localhost.". Is this the right way to do it? Is the result of my
stream going through the Flash gateway? What is the best way to satisfy this
requirement? Help, please! J. Jesús Ramos Cardona +52 (55) 51 74 22 22 ext. 1250 Ixe Grupo Financiero Este
correo electrónico y sus anexos pueden contener información CONFIDENCIAL para
uso exclusivo de su destinatario. Si ha recibido este correo por error, por
favor, notifíquelo al remitente y bórrelo de su sistema. Muchas gracias. Las
opiniones expresadas en este correo son las de su autor y no son necesariamente
compartidas o apoyadas por la compañía. Ixe Grupo Financiero no asume aquí
obligaciones ni se responsabiliza del contenido de este correo, a menos que
dicha información sea confirmada por escrito por un representante autorizado.
No se garantiza que la transmisión de este correo sea segura o libre de
errores, podría haber sido viciada, perdida, destruida, haber llegado tarde, de
forma incompleta o contener VIRUS. ------------------------------------------------------------------ This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited. We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus. |
RE: [flexcoders] About downloading files in Flex
Jesus Salvador Ramos Cardona Mon, 22 Aug 2005 08:29:19 -0700
- [flexcoders] About downloading files in Flex Jesus Salvador Ramos Cardona
- RE: [flexcoders] About downloading files... Philippe Maegerman
- RE: [flexcoders] About downloading files... Jesus Salvador Ramos Cardona
- RE: [flexcoders] About downloading files... Dirk Eismann
- RE: [flexcoders] About downloading files... Jesus Salvador Ramos Cardona
- RE: [flexcoders] About downloading files... Dirk Eismann