I see numerous questions on forum about how to read and write an excel file from Java. So, I have decided
to present java code to create an excel file and display it in EP6 portal using AbstractPortalComponent.
I am going to use HSSF’s apis to create an excel file. HSSF is part of open source POI project.
These apis can also be used to read microsoft excel file from java. For more information about POI check out the site http://jakarta.apache.org
- You can download the following jars from http://jakarta.apache.org.
- servlet.jar, poi-2.5.1-final-20040804.jar, poi-contrib-2.5.1-final-20040804.jar, poi-scratchpad-2.5.1-final-20040804.jar
Steps to create PAR component
- Create an AbstractPortalComponent using Eclipse or Netweaver Studio. Add the above jars to PORTAL-INF->lib folder.
- Add the following lines to doContent method.
- Deploy it in portal and run it. You should get the following output.