In this program we are going to create a sheet then create
out line for rows and columns. Finally we expand the row outline.
The package we need to import is java.io.*,java.util.* ,org.apache.poi.hssf.usermodel.HSSFSheet, and org.apache.poi.hssf.usermodel. HSSFWorkbook.
The method used in this example shift row
grouprow( startIndex, endIndex):
This is used to create outline for rows startIndex and endIndex shows the starting point and end points for the outline.
This is used to create outline for column.
setRowGroupCollapsed(int row, boolean collapse)
This method is used to collapse the row with it value.
You can create the out line for both rows and columns. The out line is shown in output between + and - linked with state line .Then at last we expand the row by using the method setRowGroupCollapsed(int row, boolean collapse). The row value is the number of rows to be expands.
The code of the program is given below:
The output of the program is given below:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: February 25, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles