Hi,
I am trying to open excel file in server path web app folder to browser, But i get junk values printed on the web side.Kindly help me with code to resolve this problem i am using JSP and javascript to open the file.
-
Opening Excel file in Browser (8 messages)
- Posted by: Manikandan Kasirajan
- Posted on: May 11 2004 23:16 EDT
Threaded Messages (8)
- excel in browser by joseph yi on May 11 2004 23:32 EDT
- excel in browser by Manikandan Kasirajan on May 11 2004 23:46 EDT
-
excel in browser by Paul Strack on May 12 2004 11:52 EDT
-
excel in browser by eswar kumar on May 14 2004 09:12 EDT
- excel in browser by Vijay Pureti on June 29 2004 02:24 EDT
- excel in browser by Tekuri NageswaraRao on December 23 2004 11:12 EST
- excel in browser by sowjanya s on September 11 2012 09:25 EDT
-
excel in browser by eswar kumar on May 14 2004 09:12 EDT
-
excel in browser by Paul Strack on May 12 2004 11:52 EDT
- excel in browser by Manikandan Kasirajan on May 11 2004 23:46 EDT
- office by jamal lotfy on September 14 2012 14:58 EDT
-
excel in browser[ Go to top ]
- Posted by: joseph yi
- Posted on: May 11 2004 23:32 EDT
- in response to Manikandan Kasirajan
response.setContentType("application/vnd.ms-excel");
Try that before any writing any output. -
excel in browser[ Go to top ]
- Posted by: Manikandan Kasirajan
- Posted on: May 11 2004 23:46 EDT
- in response to joseph yi
a href="../board/upload/< %=rs.getString(11)% >" target="new", img src="../images/img_99840.gif" border="0" , /a
Is the code i am using in JSP to open the excel file from the web app folder to client browser.
As this new window is instance and it is not a source coded jsp page i can not include any setHeader.If there is a better way that i can deal from the above code kindly help me out with that. -
excel in browser[ Go to top ]
- Posted by: Paul Strack
- Posted on: May 12 2004 11:52 EDT
- in response to Manikandan Kasirajan
Try adding "application/vnd.ms-excel" as a MIME type for your server, associated with the ".xls" file extension.
You can do this using server-specific configuration, or by adding the MIME type to your web.xml configuration:
<mime-mapping>
<extension>xls</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping> -
excel in browser[ Go to top ]
- Posted by: eswar kumar
- Posted on: May 14 2004 09:12 EDT
- in response to Paul Strack
Use the following code u can open excel file .
File filepath=new File(file.xls);
resp.setContentType("application/vnd.ms-excel");
resp.setHeader("Content-Disposition","inline; filename=" + filepath);
A href='<%=filepath%>' target="_blank">
<image src="/UploadAppWeb/resources/images/download.gif" border="0" />
</A -
excel in browser[ Go to top ]
- Posted by: Vijay Pureti
- Posted on: June 29 2004 14:24 EDT
- in response to eswar kumar
This code works fine when you open the excel sheet from the diaolg box. But when you save it to the file and open it again from open,save dialog box the image is not showing up. However if you save it once you open it is showing up the image. Does anybody has any idea how to fix this. Here is the code that I have.
response.setContentType("application/vnd.ms-excel ");
fileName = sample + ".xls";
response.setHeader("Content-disposition",
"inline; filename=" + fileName );
a href='<%=fileName%>' target="_blank">
<img src="./mapRequestor.jsp?url=<%=URLEncoder.encode(mapURL.replaceTokens(tokens))%>" border="0" />
</a
Note: If I use "attachment" in place of "inline" the image is not showing up at all. -
excel in browser[ Go to top ]
- Posted by: Tekuri NageswaraRao
- Posted on: December 23 2004 23:12 EST
- in response to eswar kumar
Hi eswar Kumar
I use your code to open excel file,but not open excel I get only empty excel Please help me
Nagesh...
File filepath=new File(file.xls);
resp.setContentType("application/vnd.ms-excel");
resp.setHeader("Content-Disposition","inline; filename=" + filepath);
A href='<%=filepath%>' target="_blank">
<image src="/UploadAppWeb/resources/images/download.gif" border="0" />
</A -
excel in browser[ Go to top ]
- Posted by: sowjanya s
- Posted on: September 11 2012 09:25 EDT
- in response to Paul Strack
hi,
i have used in the same way in Web.xml, but its of no use.Could you plz suggest wt can be done.
-
office[ Go to top ]
- Posted by: jamal lotfy
- Posted on: September 14 2012 14:58 EDT
- in response to Manikandan Kasirajan
codes or office web site is better to provide such a service ??