Excel sheet in read only mode

Excel sheet in read only mode

View Answers

September 8, 2009 at 5:03 PM

Hi Friend,

Try the following code:

<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFWorkbook"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFCell"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFRow"%>
<%@ page import="java.io.*" %>
<%try{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet(" sheet");
HSSFRow row = sheet.createRow((short)0);
HSSFCell cell = row.createCell((short)0);
cell.setCellValue(1);
row.createCell((short)1).setCellValue("A");
row.createCell((short)2).setCellValue("Delhi");
row.createCell((short)3).setCellValue("aroseindia.net");

FileOutputStream fileOut = new FileOutputStream("c:\\data1.xls");
wb.write(fileOut);
fileOut.close();
Runtime rt = Runtime.getRuntime();
rt.exec("cmd.exe /C start C:\\data1.xls");
}catch ( Exception ex ){
}
%>

Hope that the above code will be helpful for you.
Thanks









Related Tutorials/Questions & Answers:
Excel sheet in read only mode - WebSevices
Excel sheet in read only mode  If am opening an excel sheet(through web application) to edit any information,Its opening in read-only mode... sheet,It has both read and write permission. How can i make the excel sheet
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
Advertisements
Read a particular column in excel sheet - JSP-Servlet
Read a particular column in excel sheet  hi sir i want to a read a excel sheet ,in that i have to take a particular column that contains a mailIds ,use that column to send a mail to all so how to do this sir give me some code
Read a particular column in excel sheet - JSP-Servlet
Read a particular column in excel sheet  hi sir i used ur code,but where i have to put that index value ,i am calling the following methods for sending a mail please help me if any changes.Following is my code for calling methods
Read code from excel sheet and upload into database using JSP
Read code from excel sheet and upload into database using JSP  I want to upload data to database from an excel worksheet using jsp ...Please help
how to read values from excel sheet and compare with database using jsp
how to read values from excel sheet and compare with database using jsp  hi sir i am arun how to read values from excel sheet and compare with database using jsp coding i.e, if i have 6(assetid,assetname,serialno,cubical
How to read every cell of an excel sheet using Apache POI and insert those data into a DB?
How to read every cell of an excel sheet using Apache POI and insert those data into a DB?   i have an excel sheet, whose data in each cell has... the rows of an excel sheet. Need the source code
reading excel sheet in java
reading excel sheet in java  can anyone tell me a proper java code to read excel sheet using poi   Here is a java code that reads an excel file using POI api and display the data on the console. import java.io.
Need to Remove Duplicate Records from Excel Sheet
and to save only unique empnum with rating in another excel sheet... Duplicate Records from Excel Sheet. I have one excel sheet having two fields (EmpNum, Rating) have to save in another excel sheet with unique empnum of latest
insert excel sheet into mysql as a table
insert excel sheet into mysql as a table  sir, i want to import an excel sheet into mysql5.0 database as in the table format using tomcat 6.0 by jsp
update excel sheet using jsp::
update excel sheet using jsp::   Hi Sir,... I have a excel sheet for employee details "i retrieve particular datas from given excel sheet and display it into another excel sheet using jsp
Excel sheet image reading issue
Excel sheet image reading issue   Hello every one.I?m trying to read images from an excel sheet using OleDbDataReader. My excel file has 6...=" + excelFileName + ";Extended Properties='Excel 8.0;HDR = YES;'"); conn.Open
how to display data in excel sheet?
how to display data in excel sheet?  According to the user Id,some... the button and to display the data in excel sheet... there will be a button called excel download,and if we click the button data
jsp with excel sheet data uploading into database
jsp with excel sheet data uploading into database  how to upload data in excel sheet with jsp into oracle 10g database
Create Excel Sheet Using JSP
create excel sheet using jsp       In this example we create excel sheet and insert values into table of the excel sheet . In this example we use page directive
excel sheet reading and using that data - JSP-Servlet
excel sheet reading and using that data  i have to do a read a excel sheet file of a employee record and then i have to use a employee details to send mail to those employees how to do in jsp sir please help me sir.. Thanks
extract data from excel sheet to mysql
extract data from excel sheet to mysql  sir, i want to extract data from excel sheet and save the data in mysql5.0 database in the form of table
browse and submit the excel sheet into mysql as a table
browse and submit the excel sheet into mysql as a table  sir, i want to browse and after clicking a submit button, the data in the excel sheet should be stored in the mysql5.0 as a table
How to get data from Excel sheet - Struts
How to get data from Excel sheet  Hi, I have an excel sheet with some data(including characters and numbers). Now i want read the data from excel sheet and display in console first then later insert this data into database
exporting data to excel sheet - JDBC
= wb.createSheet("Excel Sheet"); try{ Connection con = null...exporting data to excel sheet  Sir i have already send request about... query in java swing program,i want to print the result about the query in excel
JSP/Servlet to read and update Excel
JSP/Servlet to read and update Excel  Hi Team, My requirement... all the column values which is related to my input(name) from Excel(.xls). but the output(column values) should be in editable mode, because the user have
Selecting Excel Sheet File
selecting excel sheet file       In this program we are going to select the excel sheet... sheet .  The package we need to import is java.io.* 
read excel data from jsp - JSP-Servlet
read excel data from jsp  Hi how to read excel file from jsp? Excel file is created manually entered data having many sheets? and read the entire...)excel.jsp: Read And Edit Excel File  continue
How to set background of an excel sheet using POI - Java Magazine
How to set background of an excel sheet using POI  Hi, i am trying to format the excel using java. How to set the background color of an excel sheet( complete sheet which includes all cells). i am using poi2.5.1. Thanks
export data to excel sheet - JSP-Servlet
export data to excel sheet  Hi.. how to export data to excel sheet from jsp? and how to update the excel sheet from jsp? and how to get the data from excel sheet? and how to make calculations in excel sheet like total avg
Export data in excel sheet in java in struts - Struts
Export data in excel sheet in java in struts  Hello, All how can i export data in excel file i java  Hi friend, For solving the problem visit to : http://www.roseindia.net/jsp/excelfile.shtml Thanks
Export data to Excel Sheet in STRUTS 1.3
Export data to Excel Sheet in STRUTS 1.3  hi. how can i export content present on the jsp to excel sheet on button click..... and challenging part is i have to merge few rows and columns for a particular field(Value
Reading the Date and time values from excel sheet
Reading the Date and time values from excel sheet  hi guys , iam trying to read excel sheet data using apache poi api .my problem is i cant read the date(dd/mm/yy) and time(hh:mm:ss) values concurrently from two different cells
how to import excel sheet into mysql database and save it as a table in database
how to import excel sheet into mysql database and save it as a table in database  sir, i want to import an excel sheet into a MySQL database and after importing it i want to store the excel sheet as a table in database
Find Name of Excel Sheet
Find Name of Excel Sheet       In this program we are going to find the name of an excel sheet using POI3.0 API Event. The advantage of event API  is that you can
To read a excel with chart - Java Beginners
To read a excel with chart   Hi, I need to read the data in an excel which is in chart format using java. when I directly change the extention of excel file to CSV i am not getting the data in the chart.Please help me
How to export data from html to excel sheet by using java
How to export data from html to excel sheet by using java   How to export data from html to excel sheet by using java
How to export data from jsp to excel sheet by using java
How to export data from jsp to excel sheet by using java   How to export data from jsp to excel sheet by using java
Set Zoom Magnification of Excel Sheet
Set  Zoom Magnification of Excel Sheet In this section, you will learn how to set the zoom magnification of a Excel workbook's sheet. Zoom... : EXAMPLE In the below code, an Excel(.xlsx) workbook's sheet's
Inserting Image In Excel Sheet Using JSP
Inserting Image In Excel Sheet Using JSP       In this example, we create excel sheet... can use third party APIs to create the excel sheet, which you can learn in our
Reading And Writing Excel File
words, we can say that it is used to read the excel file. After reading the excel... We can read any file and write it into other excel file by this way. You can add.... This means you can read excel file and modify it according to your need. To run
Insert Image into Excel Sheet
Insert Image into Excel Sheet In this section, you will learn how to insert image into excel sheet using Apache POI. In the given below example, am image is insert into excel sheet at row 1 and at column 1. you can specify the top
Printing data into Excel sheet - Java Beginners
Printing data into Excel sheet  Hi all i am writing one application where there is need to bring the data into "Excel Sheet" with proper format.My... database then showing it(data) to in "Excel Sheet" is it possible to do ? if yes
export data from database to excel sheet - JDBC
execute a query then result will be display in MS-EXCEL sheet. please give me... HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Excel Sheet"); HSSFRow rowhead...export data from database to excel sheet  I am facing a problem about
Problem in executing macro enabled excel sheet using java
Problem in executing macro enabled excel sheet using java  Hi, I have written a java code which will read a excel sheet with macro enabled. then it will write data into sheet1 and sheet2 and it will execute a VB script
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java    How to export data from html file to excel sheet by using java
How to Get The Data from Excel sheet into out jsp page???
How to Get The Data from Excel sheet into out jsp page???  How to Get The Data from excel sheet to out jsp page in webApp
Convert the excel sheet data into oracle table through java or jsp
Convert the excel sheet data into oracle table through java or jsp  Hi Friends, Let me help this issue i am phasing Convert the excel sheet data into oracle table through java or jsp
Java Program to insert a row in the same sheet of excel file
Java Program to insert a row in the same sheet of excel file  Java program to insert a row in the same sheet of excel file using poi package in java
Making a Collection Read-Only
Making a Collection Read-Only       This section describes you how to make a collection read-only... for making it read-only. By default, list is not read-only. If the list is read-only
Create Bar Graph from reading excel sheet in Java
Create Bar Graph from reading excel sheet in Java  I'm New to Java and I have to create a java program where I have to read data from multiple excel sheets say 4 sheets and sheet represents browsers (like FF, IE8, IE9 , chrome
Find Type of Excel Sheet
Find Type of Excel Sheet       In this program we are going to find type of an excel sheet...;java FindNameOfSheet example.xls New sheet named: Sheet1 New sheet named
Create Excel Sheet Using JSP
create excel sheet using jsp   ... into excel sheet using java .You can create any number of cells and rows...;wb.createSheet("new sheet");  HSSFRow row = 
How to Create New Excel Sheet Using JSP
How to create new excel sheet using jsp  ... a new  excel sheet using java .You can create any number of  new excel sheets in a excel file.  To create a excel sheet we can use third party APIs
Uploading Excel sheet record in JSP to insert data in MySql
Uploading Excel sheet record in JSP to insert data in MySql  Need Help how to upload Excel (.xls) file and insert data in Mysql using JSP it wil be wonder for me if any help me

Ads