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]