You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Erik Lundström <er...@solme.se> on 2009/08/21 10:34:00 UTC

Adding images to Excel sheet with existing Chart - is this possible?

Hello,

I'm struggling with a case where I have to write images to an Excel Workbook, when there are chart(s) present in the Excel template file.

(I have seen another message here on the mailing list labeled "Adding Image in Sheet while Diagram already exists in other does not work". I don't know if my problem is another form of the same problem; I couldn't manage to download the code from that author. I am sorry if I'm repeating the same question again, but I still haven't found a solution or workaround to my problem, whereas I think the other poster did).

Anyway, my case is this (download link to standalone example including images and Excel templates is below):

I have an Excel template, consisting of two sheets. There is one chart on Sheet0, and one on Sheet1.

There is data (numerical values, texts) being written to various cells on these two sheets. The num cells are the base for the charts.

On Sheet1, I want to write four images. This is where my problem surfaces. Using the intended Excel template, the image writing using POI screws up Sheet1 completely.


Using various versions of my initial Excel template (basically stripping it down), I came to the depressing conclusion that there is a Catch22 here: Charts must be present from scratch in the Excel template file (as by the given limitations in the POI HSSF+XSSF project), but writing images to a Workbook where there are charts just isn't possible. This conclusion was made when I removed the chart from Sheet1 (the sheet where I want to write images) - the images still don't appear.

But when starting out with a completely blank Excel file, and just adding a chart to Sheet0, I do manage to write images to Sheet1. Well, the "real" Excel template might of course have references and bindings that I'm not aware of - I am neither an Excel expert nor the author of that Excel file.

So it seems that charts can/might be present on OTHER sheets than the one where images are written? At least this is my humble suspicion after struggling with this for some time.

I would be very grateful if somebody here could clarify the image/chart problem! Can one make them co-exist, or must I use an external workaround (like having a macro reading the images afterwards to the Sheet).

I have been using POI 3.5 Beta6, and my "Excel viewer/template editor" was MS Excel 2007 (on Vista).

Source is here (standalone example, images and the various Excel templates I have tried):

http://uploading.com/files/HOJ1VIKT/POITest.zip.html


Thanks

Erik


Re: Adding images to Excel sheet with existing Chart - is this possible?

Posted by MSB <ma...@tiscali.co.uk>.
Hello Erik,

The cause of the problem in the other post that you refer to had something
to do with the sheet the author was trying to insert the images into; we
assumed some sort of interaction with either the chart or cells on the
second sheet. I do not know the exact details, but there was something about
that sheet that when there were charts in the same workbook meant that no
images could be added using POI.

The test is quite a simple one really. Use your existing template file, open
it with POI, insert a new sheet into the workbook and then try to add an
image or images to that new sheet. When we were working on the 'other'
problem, we were able to easilly add images to the new sheet but still not
to those that already existed in the workbook. The answer was to use POI to
build that troublesome sheet in the first place; I do not know if this will
be a possible solution to your problem however. Alternatively, try
disassembling the template workbook until you are at the point where an
image can be added and then use POI to build the missing features.

I cannot promise anyting at all but if I have the time, I will take a look
atthe attached files.

Yours

Mark B


Erik Lundström wrote:
> 
> Hello,
> 
> I'm struggling with a case where I have to write images to an Excel
> Workbook, when there are chart(s) present in the Excel template file.
> 
> (I have seen another message here on the mailing list labeled "Adding
> Image in Sheet while Diagram already exists in other does not work". I
> don't know if my problem is another form of the same problem; I couldn't
> manage to download the code from that author. I am sorry if I'm repeating
> the same question again, but I still haven't found a solution or
> workaround to my problem, whereas I think the other poster did).
> 
> Anyway, my case is this (download link to standalone example including
> images and Excel templates is below):
> 
> I have an Excel template, consisting of two sheets. There is one chart on
> Sheet0, and one on Sheet1.
> 
> There is data (numerical values, texts) being written to various cells on
> these two sheets. The num cells are the base for the charts.
> 
> On Sheet1, I want to write four images. This is where my problem surfaces.
> Using the intended Excel template, the image writing using POI screws up
> Sheet1 completely.
> 
> 
> Using various versions of my initial Excel template (basically stripping
> it down), I came to the depressing conclusion that there is a Catch22
> here: Charts must be present from scratch in the Excel template file (as
> by the given limitations in the POI HSSF+XSSF project), but writing images
> to a Workbook where there are charts just isn't possible. This conclusion
> was made when I removed the chart from Sheet1 (the sheet where I want to
> write images) - the images still don't appear.
> 
> But when starting out with a completely blank Excel file, and just adding
> a chart to Sheet0, I do manage to write images to Sheet1. Well, the "real"
> Excel template might of course have references and bindings that I'm not
> aware of - I am neither an Excel expert nor the author of that Excel file.
> 
> So it seems that charts can/might be present on OTHER sheets than the one
> where images are written? At least this is my humble suspicion after
> struggling with this for some time.
> 
> I would be very grateful if somebody here could clarify the image/chart
> problem! Can one make them co-exist, or must I use an external workaround
> (like having a macro reading the images afterwards to the Sheet).
> 
> I have been using POI 3.5 Beta6, and my "Excel viewer/template editor" was
> MS Excel 2007 (on Vista).
> 
> Source is here (standalone example, images and the various Excel templates
> I have tried):
> 
> http://uploading.com/files/HOJ1VIKT/POITest.zip.html
> 
> 
> Thanks
> 
> Erik
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25080874.html
Sent from the POI - User mailing list archive at Nabble.com.


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


SV: SV: Adding images to Excel sheet with existing Chart - is this possible?

Posted by Erik Lundström <er...@solme.se>.
Hi again,

My first tests with JExcelAPI were indeed successful.

I made a copy of my POITestClass, named JExcelTestClass, and simply converted all my POI-library calls to the JExcelAPI-equivalent (which really wasn't that tedious really). Writing my images to the desired area was simple enough, and the chart is indeed intact and functioning as intended in the resulting file.

Now, this being a POI mailing group, I absolutely do not want to give any negative criticism regarding this great project, but in solving this particular problem of mine, it seems that JExcelAPI might be the way to go at the moment. 

Yours 
Erik

-----Ursprungligt meddelande-----
Från: MSB [mailto:markbrdsly@tiscali.co.uk] 
Skickat: den 24 augusti 2009 10:09
Till: user@poi.apache.org
Ämne: Re: SV: Adding images to Excel sheet with existing Chart - is this possible?


Must admit that I used to use JExcelAPI myself before moving over to POI and
liked it a lot. There are things it does that POI does not and it takes a
slightly different approach to that adopted by POI. Must admit that I cannot
remember how well it works with images/charts as it is such a long time
since I used it and I never needed to manipulate images at that time.

You do have other options of course, and they have varying dgrees of
attractivness, success;

* Aspose have a commercial product that offers to manipulate Office files -
including Excel of course. I have never used it so canno0t speak to it's
capabilities and of course, you would have to pay for it.
* OpenOffice exposes an API that allows you to work with those files it has
filters for. Wjilst I have used it for simple tasks - search and replace for
example in Word documents - I have never built large, complex workbooks with
it and so, again, cannot really speak to it's suitability. There are other
issues with this aproach however indlucing speed of execution, the fact that
the connection to the OpenOffice application can be dropped so adding to the
complexity of your client code.
* OLE. In many ways this is the 'best' option as you are manipulating Excel
directly; therefore, anything you can do using Excel yourself can be
automated using OLE. However, this technique is limited in applicability to
stand alone PCs running Windows in my experience. Additionally, it is quite
slow and Microsoft themselves explicitly advise against adopting the
strategy for a number of reasons - chief amongst them being - IMO - an
inability to trap and handle errors (Excel simply pops open a dialog box and
waits for human intervention).

Good luck. Sorry I could not help but if I find anything out, I will post to
the list.

Yours

Mark B


Erik Lundström wrote:
> 
> Hi Mark,
> 
> Thanks for your effort! 
> 
> Yes, I will indeed post a follow-up question on the dev forum regarding
> this.
> 
> Another thing I was considering trying out is to have the chart on another
> sheet initially in the Excel template, i.e. writing all data and images to
> the sheet, and afterwards "moving" the chart to its correct position (from
> some irrelevant sheet to the correct one, where the images are). But I do
> not know if this is possible at all (I have zero experience regarding
> working with charts in Excel POI). I'll let you know if I get around to
> try this out.
> 
> In parallel, I will also investigate what the other Excel open source
> project I know of has to offer regarding this problem: JExcelAPI.
> 
> Best
> Erik
> 
> -----Ursprungligt meddelande-----
> Från: MSB [mailto:markbrdsly@tiscali.co.uk] 
> Skickat: den 23 augusti 2009 13:12
> Till: user@poi.apache.org
> Ämne: Re: Adding images to Excel sheet with existing Chart - is this
> possible?
> 
> 
> Had the chance to play around with some code this morning and I know why
> the
> images are missing when you try to add them to a sheet that contains a
> chart
> - the required records are simply not created. I also think that I know
> why;
> I think that the drawing records are parsed when the method is called and
> this both corrupts the chart data and the drawing aggregate records
> themselves.
> 
> This is only supposition on my part but I think it means that the API may
> not be able to handle inserting images into sheets that already contain
> charts or other complex drawing objects. However, I think you would be
> wise
> to post a follow-up question to the developers forum as I am not able to
> provide a definitive answer myself.
> 
> Yours
> 
> Mark B
> 
> 
> Erik Lundström wrote:
>> 
>> Hello,
>> 
>> I'm struggling with a case where I have to write images to an Excel
>> Workbook, when there are chart(s) present in the Excel template file.
>> 
>> (I have seen another message here on the mailing list labeled "Adding
>> Image in Sheet while Diagram already exists in other does not work". I
>> don't know if my problem is another form of the same problem; I couldn't
>> manage to download the code from that author. I am sorry if I'm repeating
>> the same question again, but I still haven't found a solution or
>> workaround to my problem, whereas I think the other poster did).
>> 
>> Anyway, my case is this (download link to standalone example including
>> images and Excel templates is below):
>> 
>> I have an Excel template, consisting of two sheets. There is one chart on
>> Sheet0, and one on Sheet1.
>> 
>> There is data (numerical values, texts) being written to various cells on
>> these two sheets. The num cells are the base for the charts.
>> 
>> On Sheet1, I want to write four images. This is where my problem
>> surfaces.
>> Using the intended Excel template, the image writing using POI screws up
>> Sheet1 completely.
>> 
>> 
>> Using various versions of my initial Excel template (basically stripping
>> it down), I came to the depressing conclusion that there is a Catch22
>> here: Charts must be present from scratch in the Excel template file (as
>> by the given limitations in the POI HSSF+XSSF project), but writing
>> images
>> to a Workbook where there are charts just isn't possible. This conclusion
>> was made when I removed the chart from Sheet1 (the sheet where I want to
>> write images) - the images still don't appear.
>> 
>> But when starting out with a completely blank Excel file, and just adding
>> a chart to Sheet0, I do manage to write images to Sheet1. Well, the
>> "real"
>> Excel template might of course have references and bindings that I'm not
>> aware of - I am neither an Excel expert nor the author of that Excel
>> file.
>> 
>> So it seems that charts can/might be present on OTHER sheets than the one
>> where images are written? At least this is my humble suspicion after
>> struggling with this for some time.
>> 
>> I would be very grateful if somebody here could clarify the image/chart
>> problem! Can one make them co-exist, or must I use an external workaround
>> (like having a macro reading the images afterwards to the Sheet).
>> 
>> I have been using POI 3.5 Beta6, and my "Excel viewer/template editor"
>> was
>> MS Excel 2007 (on Vista).
>> 
>> Source is here (standalone example, images and the various Excel
>> templates
>> I have tried):
>> 
>> http://uploading.com/files/HOJ1VIKT/POITest.zip.html
>> 
>> 
>> Thanks
>> 
>> Erik
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25102278.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25112101.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: SV: Adding images to Excel sheet with existing Chart - is this possible?

Posted by MSB <ma...@tiscali.co.uk>.
Must admit that I used to use JExcelAPI myself before moving over to POI and
liked it a lot. There are things it does that POI does not and it takes a
slightly different approach to that adopted by POI. Must admit that I cannot
remember how well it works with images/charts as it is such a long time
since I used it and I never needed to manipulate images at that time.

You do have other options of course, and they have varying dgrees of
attractivness, success;

* Aspose have a commercial product that offers to manipulate Office files -
including Excel of course. I have never used it so canno0t speak to it's
capabilities and of course, you would have to pay for it.
* OpenOffice exposes an API that allows you to work with those files it has
filters for. Wjilst I have used it for simple tasks - search and replace for
example in Word documents - I have never built large, complex workbooks with
it and so, again, cannot really speak to it's suitability. There are other
issues with this aproach however indlucing speed of execution, the fact that
the connection to the OpenOffice application can be dropped so adding to the
complexity of your client code.
* OLE. In many ways this is the 'best' option as you are manipulating Excel
directly; therefore, anything you can do using Excel yourself can be
automated using OLE. However, this technique is limited in applicability to
stand alone PCs running Windows in my experience. Additionally, it is quite
slow and Microsoft themselves explicitly advise against adopting the
strategy for a number of reasons - chief amongst them being - IMO - an
inability to trap and handle errors (Excel simply pops open a dialog box and
waits for human intervention).

Good luck. Sorry I could not help but if I find anything out, I will post to
the list.

Yours

Mark B


Erik Lundström wrote:
> 
> Hi Mark,
> 
> Thanks for your effort! 
> 
> Yes, I will indeed post a follow-up question on the dev forum regarding
> this.
> 
> Another thing I was considering trying out is to have the chart on another
> sheet initially in the Excel template, i.e. writing all data and images to
> the sheet, and afterwards "moving" the chart to its correct position (from
> some irrelevant sheet to the correct one, where the images are). But I do
> not know if this is possible at all (I have zero experience regarding
> working with charts in Excel POI). I'll let you know if I get around to
> try this out.
> 
> In parallel, I will also investigate what the other Excel open source
> project I know of has to offer regarding this problem: JExcelAPI.
> 
> Best
> Erik
> 
> -----Ursprungligt meddelande-----
> Från: MSB [mailto:markbrdsly@tiscali.co.uk] 
> Skickat: den 23 augusti 2009 13:12
> Till: user@poi.apache.org
> Ämne: Re: Adding images to Excel sheet with existing Chart - is this
> possible?
> 
> 
> Had the chance to play around with some code this morning and I know why
> the
> images are missing when you try to add them to a sheet that contains a
> chart
> - the required records are simply not created. I also think that I know
> why;
> I think that the drawing records are parsed when the method is called and
> this both corrupts the chart data and the drawing aggregate records
> themselves.
> 
> This is only supposition on my part but I think it means that the API may
> not be able to handle inserting images into sheets that already contain
> charts or other complex drawing objects. However, I think you would be
> wise
> to post a follow-up question to the developers forum as I am not able to
> provide a definitive answer myself.
> 
> Yours
> 
> Mark B
> 
> 
> Erik Lundström wrote:
>> 
>> Hello,
>> 
>> I'm struggling with a case where I have to write images to an Excel
>> Workbook, when there are chart(s) present in the Excel template file.
>> 
>> (I have seen another message here on the mailing list labeled "Adding
>> Image in Sheet while Diagram already exists in other does not work". I
>> don't know if my problem is another form of the same problem; I couldn't
>> manage to download the code from that author. I am sorry if I'm repeating
>> the same question again, but I still haven't found a solution or
>> workaround to my problem, whereas I think the other poster did).
>> 
>> Anyway, my case is this (download link to standalone example including
>> images and Excel templates is below):
>> 
>> I have an Excel template, consisting of two sheets. There is one chart on
>> Sheet0, and one on Sheet1.
>> 
>> There is data (numerical values, texts) being written to various cells on
>> these two sheets. The num cells are the base for the charts.
>> 
>> On Sheet1, I want to write four images. This is where my problem
>> surfaces.
>> Using the intended Excel template, the image writing using POI screws up
>> Sheet1 completely.
>> 
>> 
>> Using various versions of my initial Excel template (basically stripping
>> it down), I came to the depressing conclusion that there is a Catch22
>> here: Charts must be present from scratch in the Excel template file (as
>> by the given limitations in the POI HSSF+XSSF project), but writing
>> images
>> to a Workbook where there are charts just isn't possible. This conclusion
>> was made when I removed the chart from Sheet1 (the sheet where I want to
>> write images) - the images still don't appear.
>> 
>> But when starting out with a completely blank Excel file, and just adding
>> a chart to Sheet0, I do manage to write images to Sheet1. Well, the
>> "real"
>> Excel template might of course have references and bindings that I'm not
>> aware of - I am neither an Excel expert nor the author of that Excel
>> file.
>> 
>> So it seems that charts can/might be present on OTHER sheets than the one
>> where images are written? At least this is my humble suspicion after
>> struggling with this for some time.
>> 
>> I would be very grateful if somebody here could clarify the image/chart
>> problem! Can one make them co-exist, or must I use an external workaround
>> (like having a macro reading the images afterwards to the Sheet).
>> 
>> I have been using POI 3.5 Beta6, and my "Excel viewer/template editor"
>> was
>> MS Excel 2007 (on Vista).
>> 
>> Source is here (standalone example, images and the various Excel
>> templates
>> I have tried):
>> 
>> http://uploading.com/files/HOJ1VIKT/POITest.zip.html
>> 
>> 
>> Thanks
>> 
>> Erik
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25102278.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25112101.html
Sent from the POI - User mailing list archive at Nabble.com.


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


SV: Adding images to Excel sheet with existing Chart - is this possible?

Posted by Erik Lundström <er...@solme.se>.
Hi Mark,

Thanks for your effort! 

Yes, I will indeed post a follow-up question on the dev forum regarding this.

Another thing I was considering trying out is to have the chart on another sheet initially in the Excel template, i.e. writing all data and images to the sheet, and afterwards "moving" the chart to its correct position (from some irrelevant sheet to the correct one, where the images are). But I do not know if this is possible at all (I have zero experience regarding working with charts in Excel POI). I'll let you know if I get around to try this out.

In parallel, I will also investigate what the other Excel open source project I know of has to offer regarding this problem: JExcelAPI.

Best
Erik

-----Ursprungligt meddelande-----
Från: MSB [mailto:markbrdsly@tiscali.co.uk] 
Skickat: den 23 augusti 2009 13:12
Till: user@poi.apache.org
Ämne: Re: Adding images to Excel sheet with existing Chart - is this possible?


Had the chance to play around with some code this morning and I know why the
images are missing when you try to add them to a sheet that contains a chart
- the required records are simply not created. I also think that I know why;
I think that the drawing records are parsed when the method is called and
this both corrupts the chart data and the drawing aggregate records
themselves.

This is only supposition on my part but I think it means that the API may
not be able to handle inserting images into sheets that already contain
charts or other complex drawing objects. However, I think you would be wise
to post a follow-up question to the developers forum as I am not able to
provide a definitive answer myself.

Yours

Mark B


Erik Lundström wrote:
> 
> Hello,
> 
> I'm struggling with a case where I have to write images to an Excel
> Workbook, when there are chart(s) present in the Excel template file.
> 
> (I have seen another message here on the mailing list labeled "Adding
> Image in Sheet while Diagram already exists in other does not work". I
> don't know if my problem is another form of the same problem; I couldn't
> manage to download the code from that author. I am sorry if I'm repeating
> the same question again, but I still haven't found a solution or
> workaround to my problem, whereas I think the other poster did).
> 
> Anyway, my case is this (download link to standalone example including
> images and Excel templates is below):
> 
> I have an Excel template, consisting of two sheets. There is one chart on
> Sheet0, and one on Sheet1.
> 
> There is data (numerical values, texts) being written to various cells on
> these two sheets. The num cells are the base for the charts.
> 
> On Sheet1, I want to write four images. This is where my problem surfaces.
> Using the intended Excel template, the image writing using POI screws up
> Sheet1 completely.
> 
> 
> Using various versions of my initial Excel template (basically stripping
> it down), I came to the depressing conclusion that there is a Catch22
> here: Charts must be present from scratch in the Excel template file (as
> by the given limitations in the POI HSSF+XSSF project), but writing images
> to a Workbook where there are charts just isn't possible. This conclusion
> was made when I removed the chart from Sheet1 (the sheet where I want to
> write images) - the images still don't appear.
> 
> But when starting out with a completely blank Excel file, and just adding
> a chart to Sheet0, I do manage to write images to Sheet1. Well, the "real"
> Excel template might of course have references and bindings that I'm not
> aware of - I am neither an Excel expert nor the author of that Excel file.
> 
> So it seems that charts can/might be present on OTHER sheets than the one
> where images are written? At least this is my humble suspicion after
> struggling with this for some time.
> 
> I would be very grateful if somebody here could clarify the image/chart
> problem! Can one make them co-exist, or must I use an external workaround
> (like having a macro reading the images afterwards to the Sheet).
> 
> I have been using POI 3.5 Beta6, and my "Excel viewer/template editor" was
> MS Excel 2007 (on Vista).
> 
> Source is here (standalone example, images and the various Excel templates
> I have tried):
> 
> http://uploading.com/files/HOJ1VIKT/POITest.zip.html
> 
> 
> Thanks
> 
> Erik
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25102278.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: Adding images to Excel sheet with existing Chart - is this possible?

Posted by MSB <ma...@tiscali.co.uk>.
Had the chance to play around with some code this morning and I know why the
images are missing when you try to add them to a sheet that contains a chart
- the required records are simply not created. I also think that I know why;
I think that the drawing records are parsed when the method is called and
this both corrupts the chart data and the drawing aggregate records
themselves.

This is only supposition on my part but I think it means that the API may
not be able to handle inserting images into sheets that already contain
charts or other complex drawing objects. However, I think you would be wise
to post a follow-up question to the developers forum as I am not able to
provide a definitive answer myself.

Yours

Mark B


Erik Lundström wrote:
> 
> Hello,
> 
> I'm struggling with a case where I have to write images to an Excel
> Workbook, when there are chart(s) present in the Excel template file.
> 
> (I have seen another message here on the mailing list labeled "Adding
> Image in Sheet while Diagram already exists in other does not work". I
> don't know if my problem is another form of the same problem; I couldn't
> manage to download the code from that author. I am sorry if I'm repeating
> the same question again, but I still haven't found a solution or
> workaround to my problem, whereas I think the other poster did).
> 
> Anyway, my case is this (download link to standalone example including
> images and Excel templates is below):
> 
> I have an Excel template, consisting of two sheets. There is one chart on
> Sheet0, and one on Sheet1.
> 
> There is data (numerical values, texts) being written to various cells on
> these two sheets. The num cells are the base for the charts.
> 
> On Sheet1, I want to write four images. This is where my problem surfaces.
> Using the intended Excel template, the image writing using POI screws up
> Sheet1 completely.
> 
> 
> Using various versions of my initial Excel template (basically stripping
> it down), I came to the depressing conclusion that there is a Catch22
> here: Charts must be present from scratch in the Excel template file (as
> by the given limitations in the POI HSSF+XSSF project), but writing images
> to a Workbook where there are charts just isn't possible. This conclusion
> was made when I removed the chart from Sheet1 (the sheet where I want to
> write images) - the images still don't appear.
> 
> But when starting out with a completely blank Excel file, and just adding
> a chart to Sheet0, I do manage to write images to Sheet1. Well, the "real"
> Excel template might of course have references and bindings that I'm not
> aware of - I am neither an Excel expert nor the author of that Excel file.
> 
> So it seems that charts can/might be present on OTHER sheets than the one
> where images are written? At least this is my humble suspicion after
> struggling with this for some time.
> 
> I would be very grateful if somebody here could clarify the image/chart
> problem! Can one make them co-exist, or must I use an external workaround
> (like having a macro reading the images afterwards to the Sheet).
> 
> I have been using POI 3.5 Beta6, and my "Excel viewer/template editor" was
> MS Excel 2007 (on Vista).
> 
> Source is here (standalone example, images and the various Excel templates
> I have tried):
> 
> http://uploading.com/files/HOJ1VIKT/POITest.zip.html
> 
> 
> Thanks
> 
> Erik
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-images-to-Excel-sheet-with-existing-Chart---is-this-possible--tp25076212p25102278.html
Sent from the POI - User mailing list archive at Nabble.com.


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