Opening CSV file in IE

Hi Guys,

I am trying to open a csv file in browser , i mean IN Excel Viewer but inside Browser, I have some strange Problem,

MY code to open a CSV file

<a href="reports/myfile.csv>" target="_blank" type="text/csv">Click to View </a>

this thing works fine , when i run this code in a simple html page and not from any server, but when i put this file on server (Jboss), it just shows the file on next page and not in Excel Viewer.

Any body has any Idea about this , i hope u guys have

Help me out!!!

Thanx in advance

[581 byte] By [singhGurpreeta] at [2007-10-3 3:00:41]
# 1
Why is this a Java programming question?
CeciNEstPasUnProgrammeura at 2007-7-14 20:50:17 > top of Java-index,Java Essentials,Java Programming...
# 2
Coj i am using Jsp, struts, hibernate, EJB, I am a pure Java GUy, and Java FOrums i guess is my second home(may be third, second is google)
singhGurpreeta at 2007-7-14 20:50:17 > top of Java-index,Java Essentials,Java Programming...
# 3

> Coj i am using Jsp, struts, hibernate, EJB,

The problem appears with Excel, IE and JBoss. I don't see any of the technologies you mentioned in your problem description.

> I am a pure Java GUy, and Java FOrums i guess is my

> second home(may be third, second is google)

So what? Do you never leave home to do something else?

CeciNEstPasUnProgrammeura at 2007-7-14 20:50:17 > top of Java-index,Java Essentials,Java Programming...
# 4
Ok FORUM GURUthanx for your help and comments
singhGurpreeta at 2007-7-14 20:50:17 > top of Java-index,Java Essentials,Java Programming...
# 5

Anyway, I don't understand this part of your problem description:

> it just shows the file on next page and not in Excel Viewer.

What's Excel Viewer? What's "next page"? And how is a file showing on it?

If it prints out the file's contents: make sure you serve it with the correct MIME type - that's how the browser determines what to do with a file it receives.

CeciNEstPasUnProgrammeura at 2007-7-14 20:50:17 > top of Java-index,Java Essentials,Java Programming...
# 6

next page - > <A target ="_blank" ..

this will take u to the new page

Excel viewer , Micrsoft Excel Application to see csv or XLS files

><a href="myfile.csv" target="_blank" type="text/csv">Click to View </a>

with this code where should i set MIME TYPE !!

i am setting content-type to CSV/TEXT (got that from my second home - > GOOGLE), But this is not working !!

singhGurpreeta at 2007-7-14 20:50:17 > top of Java-index,Java Essentials,Java Programming...
# 7
> i am setting content-type to CSV/TEXT (got that from> my second home - > GOOGLE), But this is not working !!Tryapplication/excel application/csv
CeciNEstPasUnProgrammeura at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 8
Dam not working
singhGurpreeta at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 9
Where are you setting the content type?
CeciNEstPasUnProgrammeura at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 10

here

<a href="myfile.csv" target="_blank" type="text/csv">Click to View </a>

<a href="myfile.csv" target="_blank" type="application/excel">Click to View </a>

this thing is also not working

<%response.setContentType("application/excel");%>

Message was edited by:

singhGurpreet

singhGurpreeta at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 11
Isn't the type set with the webserver? I know I had to register JNLPs with Tomcat.
CeciNEstPasUnProgrammeura at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 12
>>Isn't the type set with the webserver? I know I had to register JNLPs with Tomcat.Oopsy NO idea about this, so what i need to do on JBOSS
singhGurpreeta at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 13

> >>Isn't the type set with the webserver? I know I had

> to register JNLPs with Tomcat.

>

> Oopsy NO idea about this, so what i need to do on

> JBOSS

How am I supposed to know? Ask the JBoss people. But please come back here and post the solution when you found it.

CeciNEstPasUnProgrammeura at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 14
OK, i will do thatAny way thanx for ur help and time
singhGurpreeta at 2007-7-14 20:50:18 > top of Java-index,Java Essentials,Java Programming...
# 15
Finally got that working Put this thing into your web.xml<mime-mapping> <extension>csv</extension> <mime-type>text/csv</mime-type> </mime-mapping>It worked for me , hope it will works for other too!!
singhGurpreeta at 2007-7-21 10:04:37 > top of Java-index,Java Essentials,Java Programming...