poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: Problem while inserting image multiple times in a worksheet
Date Thu, 02 Aug 2012 12:03:45 GMT
Are  you creating a workbook from scratch or modiying a template ?


On Thu, Aug 2, 2012 at 3:21 PM, harshask <hsk.1988@gmail.com> wrote:
> Hi,
>
> i used the below code to display image in my excel worksheet.
>
> try {
>             HSSFClientAnchor anchor =
>                 new HSSFClientAnchor(0, 0, 255, 255, (short)colNo, rowNo,
>                                      (short)++colNo, rowNo);
>             int index = wb.addPicture(bytes,
> HSSFWorkbook.PICTURE_TYPE_JPEG);
>             HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
>             patriarch.createPicture(anchor, index);
>             anchor.setAnchorType(2);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>
> Image is displayed only once, in the place where its executed last.
>
> I read in a blog that, HSSFPatriarch patriarch =
> sheet.createDrawingPatriarch(); removes all the existing shapes in the work
> sheet. How can i display the same image many times in a single worksheet?
>
> Thank you,
> Harsha
>
>
>
>
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/Problem-while-inserting-image-multiple-times-in-a-worksheet-tp5710588.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
>

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


Mime
View raw message