Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default html exported to excel when save as, defaults to web page

When I export html code in the .jsp to excel, and I open the .xls file, and
try to Save As, the file type automatically defaults to webpage file. I want
it to default to .xls file.

I have tried a number of methods. I have tried exporting from the .jsp with
no code at all(basically it opens a empty .xls file). This tried to save the
..xls file as a text delimited. When I added only the <html</html tags, it
returned to trying to save as webpage. I suspect that there must be some
tag(or at least some identification flag) that sets the Save As filetype
accordingly, but I cannot find where or what it is.

Thank you.

- Jay -
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default html exported to excel when save as, defaults to web page

What headers are you adding to the jsp response ?
Try something like:

Response.AddHeader "Content-Disposition", "inline; filename=weberport1.xls"
Response.ContentType = "application/vnd.ms-excel"

(above is ASP syntax)

Tim

"jayahn" wrote in message
...
When I export html code in the .jsp to excel, and I open the .xls file,
and
try to Save As, the file type automatically defaults to webpage file. I
want
it to default to .xls file.

I have tried a number of methods. I have tried exporting from the .jsp
with
no code at all(basically it opens a empty .xls file). This tried to save
the
.xls file as a text delimited. When I added only the <html</html tags,
it
returned to trying to save as webpage. I suspect that there must be some
tag(or at least some identification flag) that sets the Save As filetype
accordingly, but I cannot find where or what it is.

Thank you.

- Jay -



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default html exported to excel when save as, defaults to web page

Yea, the headers that you have noted had already been added, except it's not
"inline;", its "attachment;". Sorry, I should have mentioned that. I've tried
"inline;" and not only does it default to Save As Web Page, it does not have
the option of saving as an .xls file.

- Jay -

"Tim Williams" wrote:

What headers are you adding to the jsp response ?
Try something like:

Response.AddHeader "Content-Disposition", "inline; filename=weberport1.xls"
Response.ContentType = "application/vnd.ms-excel"

(above is ASP syntax)

Tim

"jayahn" wrote in message
...
When I export html code in the .jsp to excel, and I open the .xls file,
and
try to Save As, the file type automatically defaults to webpage file. I
want
it to default to .xls file.

I have tried a number of methods. I have tried exporting from the .jsp
with
no code at all(basically it opens a empty .xls file). This tried to save
the
.xls file as a text delimited. When I added only the <html</html tags,
it
returned to trying to save as webpage. I suspect that there must be some
tag(or at least some identification flag) that sets the Save As filetype
accordingly, but I cannot find where or what it is.

Thank you.

- Jay -




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default html exported to excel when save as, defaults to web page

Does the XL file open directly in Excel, or is it hosted in IE ?

Tim


On Jan 9, 6:44*am, jayahn wrote:
Yea, the headers that you have noted had already been added, except it's not
"inline;", its "attachment;". Sorry, I should have mentioned that. I've tried
"inline;" and not only does it default to Save As Web Page, it does not have
the option of saving as an .xls file.

- Jay -



"Tim Williams" wrote:
What headers are you adding to the jsp response ?
Try something like:


Response.AddHeader "Content-Disposition", "inline; filename=weberport1..xls"
Response.ContentType = "application/vnd.ms-excel"


(above is ASP syntax)


Tim


"jayahn" wrote in message
...
When I export html code in the .jsp to excel, and I open the .xls file,
and
try to Save As, the file type automatically defaults to webpage file. I
want
it to default to .xls file.


I have tried a number of methods. I have tried exporting from the .jsp
with
no code at all(basically it opens a empty .xls file). This tried to save
the
.xls file as a text delimited. When I added only the <html</html tags,
it
returned to trying to save as webpage. I suspect that there must be some
tag(or at least some identification flag) that sets the Save As filetype
accordingly, but I cannot find where or what it is.


Thank you.


- Jay -- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default html exported to excel when save as, defaults to web page

When I have the header:

Response.AddHeader "Content-Disposition", "attachment;
filename=weberport1..xls"

It directs the file to be opened in Excel, which is what I want. But it
still defaults to Save As Web Page. (If is "inline" instead of "attachment",
it will open in IE.)

- Jay -



" wrote:

Does the XL file open directly in Excel, or is it hosted in IE ?

Tim


On Jan 9, 6:44 am, jayahn wrote:
Yea, the headers that you have noted had already been added, except it's not
"inline;", its "attachment;". Sorry, I should have mentioned that. I've tried
"inline;" and not only does it default to Save As Web Page, it does not have
the option of saving as an .xls file.

- Jay -



"Tim Williams" wrote:
What headers are you adding to the jsp response ?
Try something like:


Response.AddHeader "Content-Disposition", "inline; filename=weberport1..xls"
Response.ContentType = "application/vnd.ms-excel"


(above is ASP syntax)


Tim


"jayahn" wrote in message
...
When I export html code in the .jsp to excel, and I open the .xls file,
and
try to Save As, the file type automatically defaults to webpage file. I
want
it to default to .xls file.


I have tried a number of methods. I have tried exporting from the .jsp
with
no code at all(basically it opens a empty .xls file). This tried to save
the
.xls file as a text delimited. When I added only the <html</html tags,
it
returned to trying to save as webpage. I suspect that there must be some
tag(or at least some identification flag) that sets the Save As filetype
accordingly, but I cannot find where or what it is.


Thank you.


- Jay -- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save Excel book as Html Page Using Macro bj[_3_] Excel Programming 0 February 9th 06 10:57 PM
How do I save excel as HTML (but not as a full web page)? dls New Users to Excel 2 August 18th 05 12:07 AM
Using freezed panes in excel, how do I save the page as HTML? Jaffa„˘ Excel Discussion (Misc queries) 1 January 21st 05 09:25 AM
Filename has Url in file-save dialog when saving exported Excel do GJones Excel Programming 0 September 1st 04 08:17 PM
Save multiple sheets in a single html page Frank Kabel Excel Programming 0 May 21st 04 10:50 PM


All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"