Hello Christian,
Thanks for reply, I am getting error
"C:\Java\POIExample.java:4: package org.apache.poi.poifs.filesystem does
not exist"
I set my class path in System properties - User variables as :
CLASSPATH = c:\java\poi-2.5.1-final-20040804.jar
My Code is:-
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFRow;
/**
* A simple POI example of opening an Excel spreadsheet
* and writing its contents to the command line.
* @author Tony Sintes
*/
public class TestEdge {
public static void main( String [] args ) {
try {
InputStream input = POIExample.class.getResourceAsStream(
"c:/cv_test/cv_test.xls" );
POIFSFileSystem fs = new POIFSFileSystem( input );
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
// Iterate over each row in the sheet
Iterator rows = sheet.rowIterator();
while( rows.hasNext() ) {
HSSFRow row = (HSSFRow) rows.next();
System.out.println( "Row #" + row.getRowNum() );
// Iterate over each cell in the row and print out the
cell's content
Iterator cells = row.cellIterator();
while( cells.hasNext() ) {
HSSFCell cell = (HSSFCell) cells.next();
System.out.println( "Cell #" + cell.getCellNum() );
switch ( cell.getCellType() ) {
case HSSFCell.CELL_TYPE_NUMERIC:
System.out.println(
cell.getNumericCellValue() );
break;
case HSSFCell.CELL_TYPE_STRING:
System.out.println(
cell.getStringCellValue() );
break;
default:
System.out.println( "unsuported sell type"
);
break;
}
}
}
} catch ( IOException ex ) {
ex.printStackTrace();
}
}
}
Harkirat Guron
WiSpry, Inc.
20 Fairbanks
Irvine, CA 92618
-----Original Message-----
From: Christian Bongiorno [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 10:29 AM
To: POI Users List
Subject: Re: Classpath for POI jar files
What's your problem?
at a minimum you will need to do this;
java -classpath %CLASSPATH%;poi-2.5.1-final-20040804.jar MyJavaApp
Beyond that you will need to be considerably more specific. If the path
to any other classes you need has a space in it, you MUST quote the
entire classpath argument (the command shell with interpret it as
multiple arguments if you don't)
christian
Harkirat Guron wrote:
> Can any one help me regarding setting class path for POI jar files.
> I have downloaded the "poi-2.5.1-final-20040804.jar" file.
>
>
> Thanks
> Harkirat Guron
> WiSpry, Inc.
> 20 Fairbanks
> Irvine, CA 92618
>
> -----Original Message-----
> From: Stefan Shoeman [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 07, 2007 6:01 AM
> To: POI Users List
> Subject: Re: more than one Excel-sheet with charts
>
> Thanks for sharing your experience. Now I will try it with an
> up-to-date version, too.
>
> 2007/3/7, Theo Antonopoulos <[EMAIL PROTECTED]>:
>
>> Stefan,
>>
>> It is possible. I have done it by creating the chart in an excel
>> template and then I load that template using POI and just update the
>> data number in the cells.
>>
>> We are using POI3 alpha 1.
>>
>> Theo
>>
>> -----Original Message-----
>> From: Stefan Shoeman [mailto:[EMAIL PROTECTED]
>> Sent: 07 March 2007 13:48
>> To: [email protected]
>> Subject: more than one Excel-sheet with charts
>>
>> Hello *,
>>
>> is it possible (using HSSF 2.5), that I write some values into a
>> predefined Excel-template, which consists of two sheets: one with the
>> values, the second with a chart (pointing to the data of sheet #1)?
>>
>> Imho the old 1.X HSSF POI isn't able to do that.
>>
>> --
>> Regards,
>>
>> Stefan Shoeman
>>
>> ---------------------------------------------------------------------
>> 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/
>>
>>
>>
>>
>>
>>
>> This message has been scanned for viruses by BlackSpider MailControl
-
>>
> www.blackspider.com
>
>> ---------------------------------------------------------------------
>> 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/
>>
>>
>>
>
> ---------------------------------------------------------------------
> 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/
>
>
> ---------------------------------------------------------------------
> 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/
>
>
>
---------------------------------------------------------------------
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/
---------------------------------------------------------------------
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/