Re: wicket File downlaod

2007-11-26 Thread mbelarbi
opps, sorry what i meant to write was: File pdfFile = new File(test.pdf); But this doesn't really change much and the problem still remains that the file is empty (whether txt or pdf). mbelarbi wrote: Hi, I have some code that generates a pdf report file (using jasper reports). This

Re: wicket File downlaod

2007-11-26 Thread kent lai
The file really ought to reside in another location, but anyway... I think new File(test.pdf) would actually indicate a file named test.pdf, at the current working directory of the application server. Output the file's path with getCanoicalPath/getAbsolutePath (or something along that line)

Re: wicket File downlaod

2007-11-26 Thread Florian Sperber
Sometime ago this was answered on the list but i cannot find it right now :-) Maybe the following snippets will help you (it's wicket 1.2.6): WebResource export = new WebResource() { private static final long serialVersionUID = 1L; @Override public

Re: wicket File downlaod

2007-11-26 Thread mbelarbi
thanks Kent lai, a system print for the file's getCanoicalPath seemed to show that the file path i was passing in was incorrect. Now it's resolved. Thanks kent lai wrote: The file really ought to reside in another location, but anyway... I think new File(test.pdf) would actually indicate

Re: wicket File downlaod

2007-11-26 Thread German Morales
Hi, I have never used jasper reports, but a quick search shows me that you can also generate the file as a byte[] in memory: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperExportManager.html#exportReportToPdf(net.sf.jasperreports.engine.JasperPrint) Class

Re: wicket File downlaod

2007-11-26 Thread mbelarbi
Yes I agree, I will later move to providing these reports as streams on the fly instead of storing them, since there will be many many files generated so storage could be a problem in the long run. German Morales-2 wrote: Hi, I have never used jasper reports, but a quick search shows me