473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How open a selected file using Java Servlet

Hi All,

I can able to create a excel file using POIFS plug-in from Jakarta, but i want open already created file from a selected location.

Here i am pasting my code to generate excel file.

esponse.setContentType("application/vnd.ms-excel");
PrintWriter out = response.getWriter();
String filepath="E:/share/PAR.xls";
response.setHeader("Content-Disposition", "attachment; filename="+filepath+";");
HSSFWorkbook wb = new HSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("E/share/ISO-PAR.xls");
wb.write(fileOut);
fileOut.close();
out.close();

Please anyone suggest me, how to open a file from selected location from browser.

Regards,
Selva
Mar 2 '07 #1
5 9354
r035198x
13,262 8TB
Hi All,

I can able to create a excel file using POIFS plug-in from Jakarta, but i want open already created file from a selected location.

Here i am pasting my code to generate excel file.

esponse.setContentType("application/vnd.ms-excel");
PrintWriter out = response.getWriter();
String filepath="E:/share/PAR.xls";
response.setHeader("Content-Disposition", "attachment; filename="+filepath+";");
HSSFWorkbook wb = new HSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("E/share/ISO-PAR.xls");
wb.write(fileOut);
fileOut.close();
out.close();

Please anyone suggest me, how to open a file from selected location from browser.

Regards,
Selva
Read this .
Mar 2 '07 #2
I can able open a file from selected location.I want edit ,but I can't due to file is opened at background .As default ,this opens a excel with empty file. If i am saving opened file, that is opened file from selected one.

Anyone help me out, how edit a opened file.

Regards,
Selva
Mar 3 '07 #3
hidash
7
Hi selvasa,
can u send ur code. then only i can give u a good solution for ur problem. i am doing the same. so syrely i will help you.


Regards
hidashkumar..
Mar 14 '08 #4
Hi can you give me the source code for oprning he excel sheet from Java code..., from a specified location.
Mar 27 '08 #5
r035198x
13,262 8TB
Hi can you give me the source code for oprning he excel sheet from Java code..., from a specified location.
We don't give out boiler plate source codes here.
See our posting guidelines
Mar 27 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
0
by: Phil Powell | last post by:
Ok, I installed ANT, I have c:\ant in my ANT_HOME environment variable, I have c:\ant\bin in my PATH environmental variable, I installed the JAR files for TCL and for Javascript (Rhino)... to no...
2
by: kaiwing18 | last post by:
Hi, I have a following jsp file called "showAsset.jsp" : <form action="showAsset.jsp" method="post"> <tr BGCOLOR=YELLOW> <td><input name="sort" type="submit" value="Asset_Number" > </td>...
1
by: rohitkec | last post by:
I am new to both java andb apache tomcat.i am presently using apache tomcat 4.1.31 & j2re-1_4_2_10.when i am running http://127.0.0.1:8080/admin/login.jsp or admin file i am getting the following...
3
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
0
rsrinivasan
by: rsrinivasan | last post by:
Hi All, When i run my JSP program, ihave the following exception. How i solve this problem? HTTP Status 500 - ...
1
by: sathyak83 | last post by:
i want to format the numbers using css for each country ie if country is france the format=0.0.0 if country is UK=00.00 i use the below code <LINK REL=stylesheet HREF="<%= new...
2
by: praveenkumarvpk | last post by:
Hi friends Please help me! Following is my servlet-code import java.util.Enumeration; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import...
3
by: vijaykumardahiya | last post by:
Hello To Every One, I want to know that when I upload the File like a image from html page Its not show on servlet page using appropriate logic. I read the FileUpload Home page.But I am still...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.