Use the CPYFRMIMPF command to create a CSV file on the IFS. The open it with excel. You can also look into using the Apache POI APIs to create the sheet in excel directly from your program.
Check the archives for examples of how to do both of these.
You can also use ODBC to download directly from your AS400 to a spreadsheet… here is a step by step tutorial for <a href=”http://www.as400tutorials.com/as400-to-excel/”>downloading as400 to excel</a>
If you have Client Access installed on your system then you should have the ODBC driver to do this.
There are also lots of third party software packages that allow you to query into spreadsheets.