You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Yegor Kozlov <ye...@dinom.ru> on 2007/10/15 13:57:52 UTC

Re[2]: Export an image as PNG to a particular cell in Excel using POI.

http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java

Yegor

> Hi Prachi,

> Could you share the fragment of your code where you put the image into the
> .XLS file?

> I have to do the same with template files. I wanna change keys by images in
> specific cells of the file, but I didn't find how to do it yet.

> For me, doesn't matter if I will loose an original image, because I won't
> have any image into the cell. Actually, I have to create another one file
> with the image (in the new file) instead of the key (that existed in the
> original file).

> Thanks in advance!

> Luiz

> On 10/12/07, prachi.narkar@contractor.thomson.com <
> prachi.narkar@contractor.thomson.com> wrote:
>>
>> Thanks for your prompt reply!
>> Yes, the positioning can be achieved, but then as the documentation says,
>> that any existing image would be erased with the new image.
>>
>> What I need is that corrsponding to every record (row) in the Excel sheet,
>> I would need an image to be exported.
>> But with the limitation that it would erase an existing image, wouldnt the
>> existing images exported be erased?
>> Say I export an image for record 1 and for record 2 the previous image
>> would be erased and new image added?
>>
>> -Prachi
>>
>> ________________________________
>>
>> From: Nick Burch [mailto:nick@torchbox.com]
>> Sent: Fri 12/10/2007 11:29
>> To: POI Users List
>> Subject: Re: Export an image as PNG to a particular cell in Excel using
>> POI.
>>
>>
>>
>> On Fri, 12 Oct 2007, prachi.narkar@contractor.thomson.com wrote:
>> > I would like to know if we can export an image as PNG to a particular
>> > cell in Excel using POI.
>>
>> I don't think you can actually put an image as the real contents of a cell
>> (it's just not something the excel format supports). I think all you can
>> do is add in an image, then position/size it to occupy the whole cell.
>>
>> Nick
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>


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


Re: Re[2]: Export an image as PNG to a particular cell in Excel using POI.

Posted by Luiz Antonio Falaguasta Barbosa <lu...@gwe.com.br>.
Thanks Yegor!

On 10/15/07, Yegor Kozlov <ye...@dinom.ru> wrote:
>
>
> http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java
>
> Yegor
>
> > Hi Prachi,
>
> > Could you share the fragment of your code where you put the image into
> the
> > .XLS file?
>
> > I have to do the same with template files. I wanna change keys by images
> in
> > specific cells of the file, but I didn't find how to do it yet.
>
> > For me, doesn't matter if I will loose an original image, because I
> won't
> > have any image into the cell. Actually, I have to create another one
> file
> > with the image (in the new file) instead of the key (that existed in the
> > original file).
>
> > Thanks in advance!
>
> > Luiz
>
> > On 10/12/07, prachi.narkar@contractor.thomson.com <
> > prachi.narkar@contractor.thomson.com> wrote:
> >>
> >> Thanks for your prompt reply!
> >> Yes, the positioning can be achieved, but then as the documentation
> says,
> >> that any existing image would be erased with the new image.
> >>
> >> What I need is that corrsponding to every record (row) in the Excel
> sheet,
> >> I would need an image to be exported.
> >> But with the limitation that it would erase an existing image, wouldnt
> the
> >> existing images exported be erased?
> >> Say I export an image for record 1 and for record 2 the previous image
> >> would be erased and new image added?
> >>
> >> -Prachi
> >>
> >> ________________________________
> >>
> >> From: Nick Burch [mailto:nick@torchbox.com]
> >> Sent: Fri 12/10/2007 11:29
> >> To: POI Users List
> >> Subject: Re: Export an image as PNG to a particular cell in Excel using
> >> POI.
> >>
> >>
> >>
> >> On Fri, 12 Oct 2007, prachi.narkar@contractor.thomson.com wrote:
> >> > I would like to know if we can export an image as PNG to a particular
> >> > cell in Excel using POI.
> >>
> >> I don't think you can actually put an image as the real contents of a
> cell
> >> (it's just not something the excel format supports). I think all you
> can
> >> do is add in an image, then position/size it to occupy the whole cell.
> >>
> >> Nick
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> >> For additional commands, e-mail: user-help@poi.apache.org
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> >> For additional commands, e-mail: user-help@poi.apache.org
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Re[2]: Export an image as PNG to a particular cell in Excel using POI.

Posted by Luiz Antonio Falaguasta Barbosa <lu...@gwe.com.br>.
Hi people,

I ran the example bellow and it is pretty fine!

Is it possible do the same with .DOC and .PPT files?

Thanks in advance!

Luiz

On 10/15/07, Yegor Kozlov <ye...@dinom.ru> wrote:
>
>
> http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java
>
> Yegor
>
> > Hi Prachi,
>
> > Could you share the fragment of your code where you put the image into
> the
> > .XLS file?
>
> > I have to do the same with template files. I wanna change keys by images
> in
> > specific cells of the file, but I didn't find how to do it yet.
>
> > For me, doesn't matter if I will loose an original image, because I
> won't
> > have any image into the cell. Actually, I have to create another one
> file
> > with the image (in the new file) instead of the key (that existed in the
> > original file).
>
> > Thanks in advance!
>
> > Luiz
>
> > On 10/12/07, prachi.narkar@contractor.thomson.com <
> > prachi.narkar@contractor.thomson.com> wrote:
> >>
> >> Thanks for your prompt reply!
> >> Yes, the positioning can be achieved, but then as the documentation
> says,
> >> that any existing image would be erased with the new image.
> >>
> >> What I need is that corrsponding to every record (row) in the Excel
> sheet,
> >> I would need an image to be exported.
> >> But with the limitation that it would erase an existing image, wouldnt
> the
> >> existing images exported be erased?
> >> Say I export an image for record 1 and for record 2 the previous image
> >> would be erased and new image added?
> >>
> >> -Prachi
> >>
> >> ________________________________
> >>
> >> From: Nick Burch [mailto:nick@torchbox.com]
> >> Sent: Fri 12/10/2007 11:29
> >> To: POI Users List
> >> Subject: Re: Export an image as PNG to a particular cell in Excel using
> >> POI.
> >>
> >>
> >>
> >> On Fri, 12 Oct 2007, prachi.narkar@contractor.thomson.com wrote:
> >> > I would like to know if we can export an image as PNG to a particular
> >> > cell in Excel using POI.
> >>
> >> I don't think you can actually put an image as the real contents of a
> cell
> >> (it's just not something the excel format supports). I think all you
> can
> >> do is add in an image, then position/size it to occupy the whole cell.
> >>
> >> Nick
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> >> For additional commands, e-mail: user-help@poi.apache.org
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> >> For additional commands, e-mail: user-help@poi.apache.org
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>