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
Why is this a Java programming question?
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)
> 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?
Ok FORUM GURUthanx for your help and comments
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.
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 !!
> i am setting content-type to CSV/TEXT (got that from> my second home - > GOOGLE), But this is not working !!Tryapplication/excel application/csv
Where are you setting the content type?
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
Isn't the type set with the webserver? I know I had to register JNLPs with Tomcat.
>>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
> >>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.
OK, i will do thatAny way thanx for ur help and time
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!!