You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by ex...@di-ve.com on 2004/04/05 07:55:35 UTC

Corruption problem with Excel

Hi all

I've just started experimenting with POI. I encountered a problem which I
didn't manage to find any help on it. I started with a simple code like
this which simply reads an excel file and writes it back into a new file
without modifying it (I think).

		try {
			iStream = new FileInputStream("Errors Analysis.xls");
			fs = new POIFSFileSystem(iStream);
			wb = new HSSFWorkbook(fs);
			oStream = new FileOutputStream("wb2.xls");
			wb.write(oStream);
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		} finally {
			if (iStream != null) {
				try {
					iStream.close();
				} catch (Exception e) {
					iStream = null;
				}
			}
			if (oStream != null) {
				try {
					oStream.close();
				} catch (Exception e) {
					oStream = null;
				}
			}
		}



With a simple excel file this works fine. But if in the excel file I have
a graph, or an image, or a pivot table, then the file gets corrupted and
looses all formatting. I read that POI is not able to format such objects
but it does support them.
Is this something wrong with POI or am I doing something wrong? I'm using
the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
2003 format excel file.

Thanks
Edward



_________________________________________________________________ 
 Send your loved ones Easter Eggs and Figolli this Easter. Shop online at http://shop.di-ve.com

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


RE: Corruption problem with Excel

Posted by ex...@di-ve.com.
Thanks Daniel

I tried POI 2.0 and it worked. Actually last week I tried looking for
older versions but they are quite hidden.

Regards
Edward

>>I'm using the latest API
>
> If you are using "POI 2.5 FINAL", I found that it has a serious major
> error
> when the .xls file contains any graphics.
>
> Refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=27933
>
> Maybe you could add to it your findings too. Thanks!
>
>
> Regards,
> Daniel
>
>
> -----Original Message-----
> From: exuereb@di-ve.com [mailto:exuereb@di-ve.com]
> Sent: Monday, 05 April, 2004 1:56 PM
> To: POI User List
> Subject: Corruption problem with Excel
>
>
> Hi all
>
> I've just started experimenting with POI. I encountered a problem which I
> didn't manage to find any help on it. I started with a simple code like
> this which simply reads an excel file and writes it back into a new file
> without modifying it (I think).
>
> 		try {
> 			iStream = new FileInputStream("Errors Analysis.xls");
> 			fs = new POIFSFileSystem(iStream);
> 			wb = new HSSFWorkbook(fs);
> 			oStream = new FileOutputStream("wb2.xls");
> 			wb.write(oStream);
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			System.exit(0);
> 		} finally {
> 			if (iStream != null) {
> 				try {
> 					iStream.close();
> 				} catch (Exception e) {
> 					iStream = null;
> 				}
> 			}
> 			if (oStream != null) {
> 				try {
> 					oStream.close();
> 				} catch (Exception e) {
> 					oStream = null;
> 				}
> 			}
> 		}
>
>
>
> With a simple excel file this works fine. But if in the excel file I have
> a graph, or an image, or a pivot table, then the file gets corrupted and
> looses all formatting. I read that POI is not able to format such objects
> but it does support them.
> Is this something wrong with POI or am I doing something wrong? I'm using
> the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
> 2003 format excel file.
>
> Thanks
> Edward
>
>
>
> _________________________________________________________________
>  Send your loved ones Easter Eggs and Figolli this Easter. Shop online at
> http://shop.di-ve.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>



_________________________________________________________________ 
 Send your loved ones Easter Eggs and Figolli this Easter. Shop online at http://shop.di-ve.com

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


nnedxhelp

Posted by rehman abdul <ar...@yahoo.com>.
hello there im new to POI dont know how to Instal

any one help


---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today

Re: Corruption problem with Excel

Posted by "Andrew C. Oliver" <ac...@apache.org>.
Its best to email me privately for commercial arrangements.  I'll reply to
you offline.
-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?

The views expressed in this email are those of the author and are almost
definitely not shared by the Apache Software Foundation, its board or its
general membership.  In fact they probably most definitively disagree with
everything espoused in the above email.

> From: "Daniel Joshua" <da...@gridnode.com>
> Reply-To: "POI Users List" <po...@jakarta.apache.org>
> Date: Tue, 6 Apr 2004 10:02:33 +0800
> To: "'POI Users List'" <po...@jakarta.apache.org>
> Subject: RE: Corruption problem with Excel
> 
>> Keep adding sample sheets onto the bug.
> 
> Nice idea...
> 
> By the way, just out of curiousity, how much do/will you charge for making
> those changes?
> 
> 
> Regards,
> Daniel
> 
> 
> -----Original Message-----
> From: Andrew C. Oliver [mailto:acoliver@apache.org]
> Sent: Tuesday, 06 April, 2004 1:56 AM
> To: POI Users List
> Subject: Re: Corruption problem with Excel
> 
> 
> Yes, for reading/modifying spreadsheets with graphics you need to use 2.0 or
> be prepared to file bug reports and help out with 2.5.  2.0 ignores
> graphics.  2.5 attempts to read/interpret them.  However, the graphics API
> added was MASSIVE.  Our client was primarily interested in *writing*
> spreadsheets and thus funded primarily that work.  I'm working on a quote
> for another client who wants more of a read centric system and that may
> stabilize it, but its going to take a lot of use cases from folks to get it
> perfect.  Keep adding sample sheets onto the bug.
> --
> Andrew C. Oliver
> http://www.superlinksoftware.com/poi.jsp
> Custom enhancements and Commercial Implementation for Jakarta POI
> 
> http://jakarta.apache.org/poi
> For Java and Excel, Got POI?
> 
> The views expressed in this email are those of the author and are almost
> definitely not shared by the Apache Software Foundation, its board or its
> general membership.  In fact they probably most definitively disagree with
> everything espoused in the above email.
> 
>> From: "Daniel Joshua" <da...@gridnode.com>
>> Reply-To: "POI Users List" <po...@jakarta.apache.org>
>> Date: Mon, 5 Apr 2004 15:06:49 +0800
>> To: "'POI Users List'" <po...@jakarta.apache.org>
>> Subject: RE: Corruption problem with Excel
>> 
>>> I'm using the latest API
>> 
>> If you are using "POI 2.5 FINAL", I found that it has a serious major
> error
>> when the .xls file contains any graphics.
>> 
>> Refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=27933
>> 
>> Maybe you could add to it your findings too. Thanks!
>> 
>> 
>> Regards,
>> Daniel
>> 
>> 
>> -----Original Message-----
>> From: exuereb@di-ve.com [mailto:exuereb@di-ve.com]
>> Sent: Monday, 05 April, 2004 1:56 PM
>> To: POI User List
>> Subject: Corruption problem with Excel
>> 
>> 
>> Hi all
>> 
>> I've just started experimenting with POI. I encountered a problem which I
>> didn't manage to find any help on it. I started with a simple code like
>> this which simply reads an excel file and writes it back into a new file
>> without modifying it (I think).
>> 
>> try {
>> iStream = new FileInputStream("Errors Analysis.xls");
>> fs = new POIFSFileSystem(iStream);
>> wb = new HSSFWorkbook(fs);
>> oStream = new FileOutputStream("wb2.xls");
>> wb.write(oStream);
>> } catch (Exception e) {
>> e.printStackTrace();
>> System.exit(0);
>> } finally {
>> if (iStream != null) {
>> try {
>> iStream.close();
>> } catch (Exception e) {
>> iStream = null;
>> }
>> }
>> if (oStream != null) {
>> try {
>> oStream.close();
>> } catch (Exception e) {
>> oStream = null;
>> }
>> }
>> }
>> 
>> 
>> 
>> With a simple excel file this works fine. But if in the excel file I have
>> a graph, or an image, or a pivot table, then the file gets corrupted and
>> looses all formatting. I read that POI is not able to format such objects
>> but it does support them.
>> Is this something wrong with POI or am I doing something wrong? I'm using
>> the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
>> 2003 format excel file.
>> 
>> Thanks
>> Edward
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


RE: Corruption problem with Excel

Posted by Daniel Joshua <da...@gridnode.com>.
>Keep adding sample sheets onto the bug.

Nice idea...

By the way, just out of curiousity, how much do/will you charge for making
those changes?


Regards,
Daniel


-----Original Message-----
From: Andrew C. Oliver [mailto:acoliver@apache.org]
Sent: Tuesday, 06 April, 2004 1:56 AM
To: POI Users List
Subject: Re: Corruption problem with Excel


Yes, for reading/modifying spreadsheets with graphics you need to use 2.0 or
be prepared to file bug reports and help out with 2.5.  2.0 ignores
graphics.  2.5 attempts to read/interpret them.  However, the graphics API
added was MASSIVE.  Our client was primarily interested in *writing*
spreadsheets and thus funded primarily that work.  I'm working on a quote
for another client who wants more of a read centric system and that may
stabilize it, but its going to take a lot of use cases from folks to get it
perfect.  Keep adding sample sheets onto the bug.
--
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?

The views expressed in this email are those of the author and are almost
definitely not shared by the Apache Software Foundation, its board or its
general membership.  In fact they probably most definitively disagree with
everything espoused in the above email.

> From: "Daniel Joshua" <da...@gridnode.com>
> Reply-To: "POI Users List" <po...@jakarta.apache.org>
> Date: Mon, 5 Apr 2004 15:06:49 +0800
> To: "'POI Users List'" <po...@jakarta.apache.org>
> Subject: RE: Corruption problem with Excel
>
>> I'm using the latest API
>
> If you are using "POI 2.5 FINAL", I found that it has a serious major
error
> when the .xls file contains any graphics.
>
> Refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=27933
>
> Maybe you could add to it your findings too. Thanks!
>
>
> Regards,
> Daniel
>
>
> -----Original Message-----
> From: exuereb@di-ve.com [mailto:exuereb@di-ve.com]
> Sent: Monday, 05 April, 2004 1:56 PM
> To: POI User List
> Subject: Corruption problem with Excel
>
>
> Hi all
>
> I've just started experimenting with POI. I encountered a problem which I
> didn't manage to find any help on it. I started with a simple code like
> this which simply reads an excel file and writes it back into a new file
> without modifying it (I think).
>
> try {
> iStream = new FileInputStream("Errors Analysis.xls");
> fs = new POIFSFileSystem(iStream);
> wb = new HSSFWorkbook(fs);
> oStream = new FileOutputStream("wb2.xls");
> wb.write(oStream);
> } catch (Exception e) {
> e.printStackTrace();
> System.exit(0);
> } finally {
> if (iStream != null) {
> try {
> iStream.close();
> } catch (Exception e) {
> iStream = null;
> }
> }
> if (oStream != null) {
> try {
> oStream.close();
> } catch (Exception e) {
> oStream = null;
> }
> }
> }
>
>
>
> With a simple excel file this works fine. But if in the excel file I have
> a graph, or an image, or a pivot table, then the file gets corrupted and
> looses all formatting. I read that POI is not able to format such objects
> but it does support them.
> Is this something wrong with POI or am I doing something wrong? I'm using
> the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
> 2003 format excel file.
>
> Thanks
> Edward


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Corruption problem with Excel

Posted by "Andrew C. Oliver" <ac...@apache.org>.
Yes, for reading/modifying spreadsheets with graphics you need to use 2.0 or
be prepared to file bug reports and help out with 2.5.  2.0 ignores
graphics.  2.5 attempts to read/interpret them.  However, the graphics API
added was MASSIVE.  Our client was primarily interested in *writing*
spreadsheets and thus funded primarily that work.  I'm working on a quote
for another client who wants more of a read centric system and that may
stabilize it, but its going to take a lot of use cases from folks to get it
perfect.  Keep adding sample sheets onto the bug.
-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?

The views expressed in this email are those of the author and are almost
definitely not shared by the Apache Software Foundation, its board or its
general membership.  In fact they probably most definitively disagree with
everything espoused in the above email.

> From: "Daniel Joshua" <da...@gridnode.com>
> Reply-To: "POI Users List" <po...@jakarta.apache.org>
> Date: Mon, 5 Apr 2004 15:06:49 +0800
> To: "'POI Users List'" <po...@jakarta.apache.org>
> Subject: RE: Corruption problem with Excel
> 
>> I'm using the latest API
> 
> If you are using "POI 2.5 FINAL", I found that it has a serious major error
> when the .xls file contains any graphics.
> 
> Refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=27933
> 
> Maybe you could add to it your findings too. Thanks!
> 
> 
> Regards,
> Daniel
> 
> 
> -----Original Message-----
> From: exuereb@di-ve.com [mailto:exuereb@di-ve.com]
> Sent: Monday, 05 April, 2004 1:56 PM
> To: POI User List
> Subject: Corruption problem with Excel
> 
> 
> Hi all
> 
> I've just started experimenting with POI. I encountered a problem which I
> didn't manage to find any help on it. I started with a simple code like
> this which simply reads an excel file and writes it back into a new file
> without modifying it (I think).
> 
> try {
> iStream = new FileInputStream("Errors Analysis.xls");
> fs = new POIFSFileSystem(iStream);
> wb = new HSSFWorkbook(fs);
> oStream = new FileOutputStream("wb2.xls");
> wb.write(oStream);
> } catch (Exception e) {
> e.printStackTrace();
> System.exit(0);
> } finally {
> if (iStream != null) {
> try {
> iStream.close();
> } catch (Exception e) {
> iStream = null;
> }
> }
> if (oStream != null) {
> try {
> oStream.close();
> } catch (Exception e) {
> oStream = null;
> }
> }
> }
> 
> 
> 
> With a simple excel file this works fine. But if in the excel file I have
> a graph, or an image, or a pivot table, then the file gets corrupted and
> looses all formatting. I read that POI is not able to format such objects
> but it does support them.
> Is this something wrong with POI or am I doing something wrong? I'm using
> the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
> 2003 format excel file.
> 
> Thanks
> Edward
> 
> 
> 
> _________________________________________________________________
> Send your loved ones Easter Eggs and Figolli this Easter. Shop online at
> http://shop.di-ve.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


RE: Corruption problem with Excel

Posted by Daniel Joshua <da...@gridnode.com>.
>I'm using the latest API

If you are using "POI 2.5 FINAL", I found that it has a serious major error
when the .xls file contains any graphics.

Refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=27933

Maybe you could add to it your findings too. Thanks!


Regards,
Daniel


-----Original Message-----
From: exuereb@di-ve.com [mailto:exuereb@di-ve.com]
Sent: Monday, 05 April, 2004 1:56 PM
To: POI User List
Subject: Corruption problem with Excel


Hi all

I've just started experimenting with POI. I encountered a problem which I
didn't manage to find any help on it. I started with a simple code like
this which simply reads an excel file and writes it back into a new file
without modifying it (I think).

		try {
			iStream = new FileInputStream("Errors Analysis.xls");
			fs = new POIFSFileSystem(iStream);
			wb = new HSSFWorkbook(fs);
			oStream = new FileOutputStream("wb2.xls");
			wb.write(oStream);
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		} finally {
			if (iStream != null) {
				try {
					iStream.close();
				} catch (Exception e) {
					iStream = null;
				}
			}
			if (oStream != null) {
				try {
					oStream.close();
				} catch (Exception e) {
					oStream = null;
				}
			}
		}



With a simple excel file this works fine. But if in the excel file I have
a graph, or an image, or a pivot table, then the file gets corrupted and
looses all formatting. I read that POI is not able to format such objects
but it does support them.
Is this something wrong with POI or am I doing something wrong? I'm using
the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
2003 format excel file.

Thanks
Edward



_________________________________________________________________
 Send your loved ones Easter Eggs and Figolli this Easter. Shop online at
http://shop.di-ve.com

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


nnedxhelp

Posted by rehman abdul <ar...@yahoo.com>.

exuereb@di-ve.com wrote:Hi all

I've just started experimenting with POI. I encountered a problem which I
didn't manage to find any help on it. I started with a simple code like
this which simply reads an excel file and writes it back into a new file
without modifying it (I think).

try {
iStream = new FileInputStream("Errors Analysis.xls");
fs = new POIFSFileSystem(iStream);
wb = new HSSFWorkbook(fs);
oStream = new FileOutputStream("wb2.xls");
wb.write(oStream);
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
} finally {
if (iStream != null) {
try {
iStream.close();
} catch (Exception e) {
iStream = null;
}
}
if (oStream != null) {
try {
oStream.close();
} catch (Exception e) {
oStream = null;
}
}
}



With a simple excel file this works fine. But if in the excel file I have
a graph, or an image, or a pivot table, then the file gets corrupted and
looses all formatting. I read that POI is not able to format such objects
but it does support them.
Is this something wrong with POI or am I doing something wrong? I'm using
the latest API, Windows XP and JDK 1.3.1. I tried working on a 2002 and
2003 format excel file.

Thanks
Edward



_________________________________________________________________ 
Send your loved ones Easter Eggs and Figolli this Easter. Shop online at http://shop.di-ve.com

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org



---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today