473,466 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

org.apache.poi.hssf eclipse compiler tells cannot reslove symbol?how can i solve this

15 New Member
org.apache.poi.hssf (eclipse compiler) tells cannot resolve symbol?how can i solve this problem?
Sep 1 '10 #1
2 3920
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Can we see your code?

Regards
Dheeraj Joshi
Sep 1 '10 #2
leninbecse
15 New Member
here i am attached my code where i am import file to indicate an error.....
package readexcel;
Expand|Select|Wrap|Line Numbers
  1. import java.io.FileInputStream;
  2. import java.util.Iterator;
  3. import java.util.Vector;
  4.  
  5. import org.apache.poi.hssf.usermodel.HSSFCell;
  6. import org.apache.poi.hssf.usermodel.HSSFRow;
  7. import org.apache.poi.hssf.usermodel.HSSFSheet;
  8. import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  9. import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  10. public class ReadExcelFile {
  11.  
  12.         public static void main(String[] args) {
  13.  
  14.                 String fileName = "C:\\excelFile.xls";
  15.                 Vector dataHolder = ReadCSV(fileName);
  16.                 printCellDataToConsole(dataHolder);
  17.         }
  18.  
  19.         public static Vector ReadCSV(String fileName) {
  20.                 Vector cellVectorHolder = new Vector();
  21.  
  22.                 try {
  23.                         FileInputStream myInput = new FileInputStream(fileName);
  24.  
  25.                         POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);
  26.  
  27.                         HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);
  28.  
  29.                         HSSFSheet mySheet = myWorkBook.getSheetAt(0);
  30.  
  31.                         Iterator rowIter = mySheet.rowIterator();
  32.  
  33.                         while (rowIter.hasNext()) {
  34.                                 HSSFRow myRow = (HSSFRow) rowIter.next();
  35.                                 Iterator cellIter = myRow.cellIterator();
  36.                                 Vector cellStoreVector = new Vector();
  37.                                 while (cellIter.hasNext()) {
  38.                                         HSSFCell myCell = (HSSFCell) cellIter.next();
  39.                                         cellStoreVector.addElement(myCell);
  40.                                 }
  41.                                 cellVectorHolder.addElement(cellStoreVector);
  42.                         }
  43.                 } catch (Exception e) {
  44.                         e.printStackTrace();
  45.                 }
  46.                 return cellVectorHolder;
  47.         }
  48.  
  49.         private static void printCellDataToConsole(Vector dataHolder) {
  50.  
  51.                 for (int i = 0; i < dataHolder.size(); i++) {
  52.                         Vector cellStoreVector = (Vector) dataHolder.elementAt(i);
  53.                         for (int j = 0; j < cellStoreVector.size(); j++) {
  54.                                 HSSFCell myCell = (HSSFCell) cellStoreVector.elementAt(j);
  55.                                 String stringCellValue = myCell.toString();
  56.                                 System.out.print(stringCellValue + "\t");
  57.                         }
  58.                         System.out.println();
  59.                 }
  60.         }
  61. }
Sep 2 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tony Johansson | last post by:
Hello! I get compile error when compiling using the command javac from the command terminal window(CMD). I have just two classes which are called HelloWorld.java and Slask.java. I have both...
1
by: vsp15584 | last post by:
Hii..i use the coding as below :- import java.applet.applet; import java.awt.*; import com.sun.j3d.utils.applet.mainframe; import com.sun.j3d.utils.universe.*; import...
1
by: Shiva48 | last post by:
Thanks to Gannon11 and ro351988- Moderator. I give below the complete Java file and pls help me to rectify the errors. package com.wrox.proj2ee.ch10.app; import java.io.*; import...
3
by: toish | last post by:
I have a program, aaa.java which creates an instance of another class(bbb.java). both java files are in a package entitled 'diss' bbb.java compiles sucessfully aaa.java throws a cannot resolve...
1
by: jank | last post by:
hi, I wrote sending mass email program in java. If i try to compile using ant compiler, i am getting this error. c:\mail\src\com\mail\action\SendMail.java:125: cannot find symbol ...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
10
by: CodeNoob | last post by:
please help been working on a project got it down to 5 errors from 100 now i have no idea what to do. Errors: init: deps-jar: Created dir: C:\Users\Tommy\Desktop\build\classes Compiling 306...
3
by: Sindhu Rani | last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do??? C:\s\source>javac -d ..\classes devtestdrive.java devtestdrive.java:5: cannot resolve symbol...
2
suzee_q00
by: suzee_q00 | last post by:
Compiler seems to be hanging up on "new" but I know it isn't but I can't seem to figure out what it is that it doesn't like. Been chasing my tail for the last couple of days. Any help would be...
4
by: LadiPrather | last post by:
These error say there is not symbols, I have changed them some many times till I am lost. Please someone help. JOptionPane.showMessageDialog(null,"Oringinal Balance = $" + recieveAmount + ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.