1) There is, but you are just not thinking of it that way.  All you need do
is call HSSFSheet.getRow(rownum) and see if it returns a null, but based on
#2 this doesn't really matter in you case.

2) I apparently misread or skipped over the actual exception.  As you
pointed out you are missing a method during run-time.  Since I don't know
how you are compiling or running your code, here are a few things I would
consider checking.
- Check to see if you have all of your JAR files in your classpath properly
both at compile time and at run-time?  Classpath load order can make a
difference in many cases.
- Some projects make a copy of the JARs file from the build area to a
run-time area.  If this is the case in your environment, is it possible that
the JAR is either not being copied properly or is becoming corrupt during
the copy?

3) You might also consider that examples and documentation rarely show you
how to do everything the right way.

Good luck,

- MJD

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 30, 2006 4:15 AM
To: POI Users List
Subject: RE: problem with createRow method

1) There no method to verify if a row exist.
2) a NoSuchMethodError  exception is a error which says that a method in 
class not exist, it's no a program error.
3) all example which can be find in docs show the same structure that I 
have.

But I find many same method into package.  It depend of the sud-package 
used.

Can anyone explain whar sub-package I must used ?

thanks 

        Stéphane



-----------------------------------
Stéphane PURNELLE                         [EMAIL PROTECTED]
Service Informatique       Corman S.A.           Tel : 00 32 087/342467

"Donahue, Michael" <[EMAIL PROTECTED]> a écrit sur 27/01/2006 
16:58:29 :

> Is it possible that the first row is automatically created for you when 
the
> worksheet is created?  This probably isn't you issue since you appear to 
be
> creating a new workbook, but one thing I've found is that you should 
always
> check to see if a row or cell already exists before you try to create 
it.
> 
> There is a method on the HSSFSheet to check how many rows it has 
associated
> with it, you might consider checking that.
> 
> Hope this helps.
> 
> - MJD
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Friday, January 27, 2006 9:10 AM
> To: POI Users List
> Subject: problem with createRow method 
> 
> Hi,
> 
> JRE 1.5
> 
> try { 
> HSSFWorkbook wb = new HSSFWorkbook();
> HSSFSheet sheet = wb.createSheet("stock");
> 
> ......
> 
> for(i = 0; i < nbligne ; i++)
>   {
>   HSSFRow row = sheet.createRow((short)i); 
>   for(j = 0; j < taille_array; j++)
>     {
>     array[i][j] = "&nbsp;";
>     row.createCell((short)j); 
>     }
>   }
> 
> ........
> When I exec the class, I have : 
> 
> java.lang.NoSuchMethodError: 
> 
org.apache.poi.hssf.usermodel.HSSFSheet.createRow(S)Lorg/apache/poi/hssf/use
> rmodel/HSSFRow;
> 
> What's happening ?
> 
> Version : poi-2.5.1-final-20040804.jar
> 
> thanks
> 
>         Stéphan
> 
> 
> -----------------------------------
> Stéphane PURNELLE                         [EMAIL PROTECTED]
> Service Informatique       Corman S.A.           Tel : 00 32 087/342467
> 
****************************************************************************


> This email may contain confidential material. 
> If you were not an intended recipient, 
> Please notify the sender and delete all copies. 
> We may monitor email to and from our network. 
> 
****************************************************************************
**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to