HP3000-L Archives

May 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Wonsil <[log in to unmask]>
Reply To:
Date:
Mon, 6 May 2002 12:05:37 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (68 lines)
Check adds:
> Seriously, this naming covention for a product they are
> releasing has to be
> one of the most childish acts I have seen in a long time.

No doubt but not uncommon in the open source community.  This is an Apache
project after all, so I am not concerned too much by the name.  Other more
professional product names really make one wonder:  A contraceptive named
after the Army who hid in a wooden-horse to sneak in and then attack.  Or
you must think twice about the reliability of an adult diaper named depends.
Depends on what?

Anyway, this is an example from JavaWorld magazine that shows how to open
and print out an Excel spreadsheet:

/**
* A simple POI example of opening an Excel spreadsheet
* and writing its contents to the command line.
* @author  Tony Sintes
*/
public class POIExample {

    public static void main( String [] args ) {
        try {
            InputStream input = POIExample.class.getResourceAsStream(
"qa.xls" );
            POIFSFileSystem fs = new POIFSFileSystem( input );
            HSSFWorkbook wb = new HSSFWorkbook(fs);
            HSSFSheet sheet = wb.getSheetAt(0);

// Iterate over each row in the sheet
            Iterator rows = sheet.rowIterator();
            for( HSSFRow row = (HSSFRow) rows.next(); rows.hasNext(); row =
(HSSFRow) rows.next() ) {
                System.out.println( "Row #" + row.getRowNum() );

    // Iterate over each cell in the row and print out the cell's content
                Iterator cells = row.cellIterator();
                for( HSSFCell cell = (HSSFCell) cells.next();
cells.hasNext(); cell = (HSSFCell) cells.next() ) {

                    System.out.println( "Cell #" + cell.getCellNum() );
                    switch ( cell.getCellType() ) {
                        case HSSFCell.CELL_TYPE_NUMERIC:
                            System.out.println(
cell.getNumericCellValue() );
                            break;
                        case HSSFCell.CELL_TYPE_STRING:
                            System.out.println( cell.getStringCellValue() );
                            break;
                        default:
                            System.out.println( "unsuported sell type" );
                            break;
                    }
                }

            }

        } catch ( IOException ex ) {
            ex.printStackTrace();
        }
    }

}

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2