Win a copy of Java by Comparison (eBook) this week in the Java in General forum!

amitava guha

Greenhorn
+ Follow
since Jul 30, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by amitava guha

Hi
Thanks for reply,
Well a PDF file would have been a better choice, but we started with assumption of giving a simple html print only.
The page X Of Y can be resolved by setting [&p Of &P] in the print setup. But still we need to give a header which is a number generated in the code.

Any solution?
This is for a web application. I am using JSP pages with Struts framework in J2EE.
Hi,

I am trying to create an application print page. The content of the application is dynamic, for example you can add multiple addresses or personal details. So the page lengths are not static. I need to place a header with application number and footer with page number in page x of y format. How can I place the header and footer dynamically?

Any help will be appreciated.

Regards,
Amit
Hi

After setting the header as

response.setHeader("Content-Disposition","attachment; filename="+reportEntity.getReportName());

I am getting a popup saying download file which has option to Open/Save/Cancel. If I save the file then it get saved with the report name [reportEntity.getReportName()] but if I click Open then it is opening in IE and then if I try to do save as, it shows "Copy of Reports.do" as file name.

Is there any way this can be resolved?

Regards,
Amit.

Thanks for your reply.
Although I am setting the header that you have given

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename=\"spreadsheet.xls\"");

Still I am getting the file name as "Copy of SAOReport.do" when trying to save it. The below address is showing in the IE address bar.

http://127.0.0.1:9080/ServicePlatformWeb/SAOReport.do

Is there a solution for this?
Hi
I am using apache POI to generate reports in excel format which will be displayed in Internet Explorer window.
I am creating the excel file in a folder and reading that from my action page and displaying it in IE using response.setContentType("application/vnd.ms-excel");

Because of this every time I generate a report the name of the file is shown as Report.do for all reports. How can I set the file name?

Any help will be appreciated.
Thanks
Amit