You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/11/20 15:54:10 UTC

DO NOT REPLY [Bug 46250] New: Workbook cloneSheet()

https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

           Summary: Workbook cloneSheet()
           Product: POI
           Version: 3.2-FINAL
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: hc69@gmx.net


Created an attachment (id=22906)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22906)
Excel with cloned sheet and image error

The Methode cloneSheet of the HSSFWorkbook-Object is not working well. If there
are images in the original Sheet, the cloned Sheet has not a copy of this
image. 
There is a placeholder for this image place (red cross: The
picture cannot be displayedÂ…) but nothing else.


Example: 
HSSFWorkbook wb = new
HSSFWorkbook(this.getClass().getClassLoader().getResourceAsStream("myfile.xls"));
wb.cloneSheet(0);


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.7                         |3.8-dev

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matt.koch@turntree.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from matt.koch@turntree.com 2011-08-16 15:13:16 UTC ---
I apologize but this bug is still fixed in the beta4 release candidate
(20110822) it was still broken in 3.7 which was accidentally in my class path.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250





--- Comment #1 from Josh Micich <jo...@gildedtree.com>  2008-11-26 15:30:19 PST ---
The bug is pretty easy to reproduce.  It seems like the solution may involve
updating of some drawing IDs in the newly cloned records.

Another bug which may need to get fixed here is that BiffViewer crashes when
the embedded image is bigger than one BIFF record.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO

--- Comment #10 from Yegor Kozlov <ye...@dinom.ru> 2011-08-16 07:28:24 UTC ---

(In reply to comment #9)
> poi-3.8-beta4-20110722 was working but the feature is broken once again somehow
> in the new release candidate today poi-bin-3.8-beta4-20110822.
> 

Under what circumstances?  Cloning sheets with images is working fine to me,
I've just checked against the attached file and a new file created in MS Office
2010. 

If you are able top reproduce the bug, please attach the input file and Java
code that we can use for testing.

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|VERIFIED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #9 from matt.koch@turntree.com 2011-08-16 02:08:57 UTC ---
poi-3.8-beta4-20110722 was working but the feature is broken once again somehow
in the new release candidate today poi-bin-3.8-beta4-20110822.

Hopefully this fix can get integrated into the final 3.8 beta 4

Thanks
Matt

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.2-FINAL                   |3.7
         OS/Version|Windows XP                  |Windows Server 2003

--- Comment #4 from matt.koch@turntree.com 2011-07-15 15:33:12 UTC ---
This bug still exists in 3.7 and 3.8b - when you clone a sheet that has an
image in it, it will copy it once. If you clone the sheet again or clone the
cloned sheet the image does not appear and instead the X with error message
previously reported by many does appear.

Would be great if this could be fixed for the 3.8 release if anyone knows what
is going on here!

Thanks
Matt

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Yegor Kozlov <ye...@dinom.ru> 2011-07-19 12:22:26 UTC ---
Should be fixed in r1148295

Please try with the
latest build from trunk. Daily builds can be downloaded from here:
http://encore.torchbox.com/poi-cvs-build/

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #8 from matt.koch@turntree.com 2011-07-22 15:25:42 UTC ---
I just tested with nightly jar from poi-3.8-beta4-20110722.jar

and IT IS WORKING - woo hoo!  Thank you so much for the fix.  I am sure others
will be happy as i see posts in various places about this issue.  I just did
175 clones of a master template worksheet and the image is in every one!!!

Thanks
Matt

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


[Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
            Version|3.8-dev                     |3.9-dev
         Resolution|FIXED                       |---

--- Comment #12 from matt.koch@turntree.com ---
Clonesheet is currently working with 3.8 final with an image in the original
sheet being cloned.  When i installed the 3.9 build from 09/07/2012 (and one
about a month ago) I am now getting an error when calling the cloneSheet
function...

we use coldfusion and here is the stacktrace:

java.lang.NullPointerException at
org.apache.poi.hssf.usermodel.HSSFTextbox.cloneShape(HSSFTextbox.java:234) at
org.apache.poi.hssf.usermodel.HSSFPatriarch.createPatriarch(HSSFPatriarch.java:88)
at org.apache.poi.hssf.usermodel.HSSFSheet.cloneSheet(HSSFSheet.java:132) at
org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet(HSSFWorkbook.java:682) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
coldfusion.runtime.StructBean.invoke(StructBean.java:508) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393) at 


Thanks
Matt

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

--- Comment #3 from niko-kris@hotmail.fr 2011-06-07 15:38:41 UTC ---
Did you find a solution to this problem?
We encounter the same issue since we migrated our environements on Excel 2007
(before we were on Excel 2003).
On the original sheet, the image shows up correctly but on the cloned sheets
there is a red cross instead.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Yegor Kozlov <ye...@dinom.ru> 2011-07-20 15:37:22 UTC ---
I committed the fix today and you've tried the yesterday's build. Try tomorrow
or checkout from svn and build yourself.

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250





--- Comment #2 from Mark Thompson <ma...@adaptiveplanning.com>  2008-12-30 12:23:05 PST ---
I'm looking at the source code in 3.5, and notice a cut-n-paste error which
might be generating this issue (both of thse issues?):

In DrawingRecord.java, at the bottom, in the clone() function, the block:
        if (contd != null) {
                System.arraycopy(contd, 0, rec.contd, 0, contd.length);
                rec.contd = new byte[ contd.length ];
        }
should be:
        if (contd != null) {
                rec.contd = new byte[ contd.length ];
                System.arraycopy(contd, 0, rec.contd, 0, contd.length);
        }

The former would cause null pointer exceptions and broken drawing references in
cloned workbooks/sheets, wouldn't it?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


[Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

--- Comment #13 from Evgeniy Berlog <su...@gmail.com> ---
Hi,

Can you please produce a unit test that shows the problem and source xls file
you try to clone(if you use existing one)?

Regards, Evgeniy

(In reply to comment #12)
> Clonesheet is currently working with 3.8 final with an image in the original
> sheet being cloned.  When i installed the 3.9 build from 09/07/2012 (and one
> about a month ago) I am now getting an error when calling the cloneSheet
> function...
> 
> we use coldfusion and here is the stacktrace:
> 
> java.lang.NullPointerException at
> org.apache.poi.hssf.usermodel.HSSFTextbox.cloneShape(HSSFTextbox.java:234)
> at
> org.apache.poi.hssf.usermodel.HSSFPatriarch.createPatriarch(HSSFPatriarch.
> java:88) at
> org.apache.poi.hssf.usermodel.HSSFSheet.cloneSheet(HSSFSheet.java:132) at
> org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet(HSSFWorkbook.java:682)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
> java:25) at java.lang.reflect.Method.invoke(Method.java:597) at
> coldfusion.runtime.StructBean.invoke(StructBean.java:508) at
> coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393) at 
> 
> 
> Thanks
> Matt

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

Evgeniy Berlog <su...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #14 from Evgeniy Berlog <su...@gmail.com> ---
This problem should be fixed in trunk.

Please try with a nightly build - see download links on http://poi.apache.org/
or build yourself from SVN trunk, see http://poi.apache.org/subversion.html

Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

Michael <ob...@phystech.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |obidin@phystech.edu

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46250] Workbook cloneSheet()

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46250

matt.koch@turntree.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #6 from matt.koch@turntree.com 2011-07-20 15:20:48 UTC ---
I just pulled poi-3.8-beta4-20110719.jar and reinitiated my classes and tried
again and the first two cloned sheets have the original image in it, the next
sheets have the error still.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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