Sorry to look like a complete plank John. Of course you saw the error at
compile time, you said so in your message!! In my defence, I was fielding
questions that were being shouted at me at the same time as typing my
response.

Anyway, I still cannot think why you would see this error. As far as I am
aware, the method is declared in the Worbook interface and defined in the
concrete HSSF and XSSF classes that implement it. Have a try with 'my' code
to see what happens and check the libraries you are adding to your
classpath. Sorry to say that I cannot test against the version of the API
you are using as my downlaods skip from beta1 to beta 6 and then on to 7.

Yours

Mark B


John Musbach-3 wrote:
> 
> I'm trying to create a ArrayList<String> containing my sheet names, but
> have run
> into a issue in that the Sheet getSheetName() method
> (http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Sheet.html#getSheetName())
> doesn't seem to exist per the javadocs. I'm using the 3.5 beta5 binaries,
> the
> following code seems like it should compile but it doesn't. What am I
> doing
> wrong? Thanks!
> 
> CODE
> ----
> import javax.swing.*;
> import java.awt.*;
> import org.apache.poi.*;
> import org.apache.poi.hssf.model.*;
> import org.apache.poi.ss.usermodel.*;
> import java.io.*;
> import java.util.*;
> public class GMotionCharts
> {
>       private org.apache.poi.ss.usermodel.Workbook wb=null;
>       public boolean openXLS(String fName,JLabel jStatus)
>       {
>               //This method is OK and need not be investigated so the code 
> body has been removed
>       }
>       public ArrayList<String> getCities()
>       {
>               ArrayList<String> cities=new ArrayList<String>();
>               int numSheets=wb.getNumberOfSheets();
>               for(int i=0;i<numSheets;i++)
>               {
>                       org.apache.poi.ss.usermodel.Sheet s=wb.getSheetAt(i);
>                       cities.add(s.getSheetName());
>                       //<-- This line has the error "The method
> getSheetName() is undefined for the
> type Sheet", even though I've specifically typed the Sheet variable to
> that
> which the javadocs indicates the method exists } } }
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Bug--tp24063371p24068468.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to