Are  you creating a workbook from scratch or modiying a template ?

On Thu, Aug 2, 2012 at 3:21 PM, harshask <[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to