Forums Register Login

****** help needed! on JSP page directives

+Pie Number of slices to send: Send
JSP: How cani conditionally invoke the page content type
my project involves, a report page having 'Save as Excel' and 'Save as HTML' and print hyperlinks when print is clicked a print dialog box is opened thro' window.print() method
in the same manner, when i click on 'Save as Excel' or 'HTML' a dialog box should open and ask for Savin in .xls or .html this happens when i include the page content type at the starting of JSP, but as soon as the page loads the dialog box appears, even if given on some condition.
Is there any other way of invoking the dialog box for Excel or HTML when clicked on hyperlink, in the same JSP.
Please reply ASAP.
thanx in advance,
sowmya
+Pie Number of slices to send: Send
I suspect you are going to have to go to a servlet instead of JSP to generate the Excel content. JSP are really designed for making HTML pages - servlets let you control the response content type and content length.
Bill
[ December 04, 2002: Message edited by: William Brogden ]
[ December 04, 2002: Message edited by: William Brogden ]
+Pie Number of slices to send: Send
HI Bill,
Thank you, It was of great help to me...
thanx again,
but, when i did that in servlet,
response.setContentType and response.setHeader..
The dialog box appears when clicked on 'Save as Excel' hyperlink. but when i try to save the contents of the page, it isnot saved , instead a blank excel sheet appears!
Could you please tel me What can I do abt this?
thanx again,
sowmya
+Pie Number of slices to send: Send
you can find working example and info in the one of the best books ever:
http://csajsp-chapters.corewebprogramming.com/CSAJSP-Chapter11.pdf
enjoy.
+Pie Number of slices to send: Send
Thanx Asher and William,
The problem is solved
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 922 times.
Similar Threads
Save a JSP page as Word document
how to download or view the "Excel FILE "i n IE browser
Problem in closing the browser
Web report to Excel attachment in email
Export to Excel Dialog Box Always Pops Up
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:52:30.