In this program we are going to select the excel sheet using java .You can create any number of sheets and you can set selected sheet .
The package we need to import is java.io.* ,org.apache.poi.hssf.usermodel.HSSFSheet,
java.util.* and org.apache.poi.hssf.usermodel. HSSFWorkbook.
You can create any number of sheets and give the name of the sheet. You can set
default selected sheet by using setSelected (Boolean value). The sheet which you
want to select setSelected(True) and pass false for rest others sheets.
You can pass cells and rows values into sheets. And also you can set it
selected.
In this example we have created six sheets and given its names and we setSelected(true) for "third sheet" and setSelected( flase) for
rest. The selected sheet will displayed as shown in output of program .
The code of the program is given below:
<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
|
The output of the program is given below:


If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Selecting Excel Sheet File
Post your Comment