In this program we are going to find type of workbook using POI3.0 API Event.
Find Type of Work Book
In this program we are going to find type of workbook using POI3.0 API Event.The methods used in this example:
getSid():
This method is used to give the description copied from class.
public static final short sid:
The sid variable is used for the less than operator as hex .
The public class BOFRecord extends Record class. It is used for the beginning of a set of records that have a particular purpose or subject. Used in sheets and workbooks
getType():
This method is used to find type of object that is marked. This method returns short type of object.
The different types of: workbook are:
1.TYPE_WORKBOOK,
2. TYPE_VB_MODULE,
3.TYPE_WORKSHEET,
4.TYPE_CHART,
5.TYPE_EXCEL_4_MACRO,
6.TYPE_WORKSPACE_FILE
In this example we are finding the type of workbook and compare it BOFRecord .If compression returns true the print we are printing a String message .
The code of the program is given below:
import java.io.*;
|
The output of the program is given below:
C:\POI3.0\exmples\execl>javac TypeOfWorkBook.java C:\POI3.0\exmples\execl>java TypeOfWorkBook example.xls Encountered workbook STOP |