dcsimg
How can i download a file by a button click event(in jsp) by retaining my current webpage as if it is?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   manuel_u
Posted On:   Tuesday, September 12, 2006 08:20 AM

I need to download a report file by performing a button action ( the details to create and run the report is written in a java file.). i need to call this file from my jsp page and generate the file by retaining my current page. I'm new to jsp and dont kw much details. Could anyone help me to solve this? In my java file, i hv used response.setContentType("text/html"); response.setHeader("Content-Disposition", "attachment; filename=WebReport.html"); // these are used for report HTMLRenderOption options = new HTMLRenderOption(); options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML); options.setEmbeddable(true); options.setOutputStrea   More>>

I need to download a report file by performing a button action ( the details to create and run the report is written in a java file.). i need to call this file from my jsp page and generate the file by retaining my current page. I'm new to jsp and dont kw much details. Could anyone help me to solve this?


In my java file, i hv used

			

response.setContentType("text/html");
response.setHeader("Content-Disposition", "attachment; filename=WebReport.html");

// these are used for report
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
options.setEmbeddable(true);
options.setOutputStream(response.getOutputStream());
task.setRenderOption(options);




The problem is in my button click, itz using the response.... so i'm getting exception saying the outputstream is called twice.......Please help me to solve this

   <<Less
About | Sitemap | Contact