Hi,
You forgot to attach Read.java
rgds,
--- Balaji Muniraja <[EMAIL PROTECTED]> wrote:
>
> Rahul,
> With this i am sending the Java Code and the
> Excel File which i wanted to upload. Please help me
> out when you are free.
>
> Try from your side also. the following is also
> one of the Error which i get.
>
> Sheet 1
> ROW 1
> Cells 3
> CELL col=0 VALUE=NUMERIC value=37990
> java.lang.NullPointerException
> at Read.run(Read.java:99)
> at Read.main(Read.java:165)
>
> Invariant of the Format of the columns, i
> should be able to be read , that's all what i
> wanted.
>
> (See attached file: Read.java)(See attached
> file: Read.xls)
>
> Thanks for all your efforts.
>
> Regards,
> Balaji.M,
> Institutional Client Group(IT),
> Deutsche Bank [/], London,
> Office : +44(0)20754 55426
>
>
>
>
>
>
> [EMAIL PROTECTED]
>
>
>
> om To:
> Balaji Muniraja/DMGGM/DMG UK/[EMAIL PROTECTED] UK
>
>
> cc:
> [EMAIL PROTECTED],
> [EMAIL PROTECTED]
>
> 04/15/2004 04:46
> Subject: RE:Re: Reading excel files (was
> RE:RE:Different dates Formats and Decimals)
>
> PM
>
>
>
> Please respond to
>
>
>
> "POI Users List"
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Which version of POI are you using? I used the 2.5
> release.
> If you can send me a sample sheet I can check it
> out. There doesn't seem to be anything in the code
> that should throw an NPE.
>
> -Rahul
>
>
>
> --- ORIGINAL MESSAGE ---
> From:[EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject:Re: Reading excel files (was RE:RE:Different
> dates Formats and Decimals)
> Date: 04/15/2004 06:23:36 AM
>
> Rahul,
> Thanks for sending the code. Went through it.
> I am also doing the same as you. But in my Excel
> Sheet the data is as follows.
>
>
|----------+------------+----------+--------+---------+------+----------+-----+--------+--------+--------------+-----+----------+------|
> |TRADE_DATE|SETTLE_DATE |MAT_DATE |PAR_AMT
>
|AE_NUMBER|CREDIT|COMMISSION|PRICE|CURRENCY|ACCT_NUM|TRADE_ACCT_NUM|CUSIP|TRADE_TYPE|SOURCE|
>
|----------+------------+----------+--------+---------+------+----------+-----+--------+--------+--------------+-----+----------+------|
> |14-04-2004| 14-04-2004|14-04-2004| 1000|BALAJI
> | 0| 1000| 10|EUR |ABCD |TRADE
> |XYZ | |EE |
>
|----------+------------+----------+--------+---------+------+----------+-----+--------+--------+--------------+-----+----------+------|
> |14-04-2004| 14-04-2004|14-04-2004| 1000|BALAJI
> | 0| 1000| 10|EUR |ABCD |TRADE
> |XYZ | |EE |
>
|----------+------------+----------+--------+---------+------+----------+-----+--------+--------+--------------+-----+----------+------|
>
>
>
> The Trade Type column is of General Type. When
> i try to find the no of columns in the Second Rows
> using the function getLastCellNum() , it throws a
> null pointer exception and comes out of the Program.
> Initially i was using the
> getPhysicalNumberOfCells(); function.That also was
> returning the same error. The work around is change
> the General Type to Text then it works fine. Any
> clue about this. When you find time , please
> checkout the link, it says there is a bug in the
> function
>
>
>
http://www.mail-archive.com/[EMAIL PROTECTED]/msg03882.html
>
>
> My Code snippet is as follows.
>
> for (int k = 0; k <
> wb.getNumberOfSheets(); k++)
> {
> System.out.println("Sheet
> " + k);
> HSSFSheet sheet =
> wb.getSheetAt(k);
>
> int rows =
> sheet.getPhysicalNumberOfRows();
> for (int r = 1; r <
> rows; r++)
> {
> HSSFRow row =
> sheet.getRow(r);
> //int cells =
> row.getPhysicalNumberOfCells();
> int cells =
> row.getLastCellNum();
>
> System.out.println("ROW " + row.getRowNum());
>
> System.out.println("Cells " + cells);
>
> for (int c = 0; c <
> 13; c++)
> {
> HSSFCell cell =
> row.getCell((short) c);
> String value =
> null;
> switch
> (cell.getCellType())
> {
> case
> HSSFCell.CELL_TYPE_FORMULA :
> value =
> "FORMULA ";
> break;
> case
> HSSFCell.CELL_TYPE_STRING :
> value = "STRING
> value=" + cell.getStringCellValue();
> break;
> case
> HSSFCell.CELL_TYPE_NUMERIC :
> value =
> "NUMERIC value=" + cell.getNumericCellValue();
> break;
>
> } //cell
>
> System.out.println("CELL col="+ cell.getCellNum()+ "
> VALUE=" + value);
>
>
> pstmt.setDate(1,new
> java.sql.Date(row.getCell((short)
> 0).getDateCellValue().getTime())); //trade_date
>
>
> pstmt.setDate(2,new
> java.sql.Date(row.getCell((short)
> 1).getDateCellValue().getTime())); //settle_date
>
> pstmt.setDate(3,new
> java.sql.Date(row.getCell((short)
> 2).getDateCellValue().getTime())); //mat_date
>
>
=== message truncated ===
> ATTACHMENT part 2 application/msexcel name=Read.xls
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]