In this example we make header and footer and attaché
it with excel sheet.
The package we need to import is java.io.*,java.util.*,org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel. HSSFCellStyle, org.apache.poi.hssf.usermodel.HSSFCell,org.apache.poi.hssf.usermodel.HSSFRow,org.apache.hssf.util. Region
org.apache. poi.hssf.usermodel.HSSFFooter and
The org.apache. poi.hssf.usermodel.HSSFFooter class is used to create the header and footer. We create the object of header and footer and page it on sheet.
The method used in this example shift row
This method is used to gets the user model for the document footer.
his method is used to gets the user model for the document header.
This method is used to set string (e.g.Header and Footer) right.
This method returns the the page .
This method is used to return number of page.
In this example we are craeting the sheet and set the header and footer .The header and footer can display you on page at the time of taking print out.So we are not giving any output here. But you can download the code and check the output.
The code of the program is given below:
Posted on: February 25, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles