You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Princess <he...@googlemail.com> on 2008/12/12 14:13:13 UTC

Problem in having a logo along with a Chart (HSSF)

int pictureIndex = wb.addPicture(data, HSSFPicture.PICTURE_TYPE_PNG);

            HSSFSheet sheet = wb.getSheetAt(1);
            HSSFPatriarch patriarch = sheet.createDrawingPatriarch();

            //all pictures use the same picture index, thus sharing the same
picture data
            HSSFPicture pic1 =  patriarch.createPicture(new
HSSFClientAnchor(0, 0, 10, 10,
                          (short)10, 0, (short)13, 3), pictureIndex);

The above code works when i have a worksheet with no graph/chart ..

But my requirement is a Excel file which will have data in sheet1 and a
Chart for the Data in Sheet2 along with a logo.

Now When using the aboce code snippet  i get a error message saying that the
Data would be lost and on opening the file
Sheet2  is totally erratic..Sheet1 is intact

I am using a Template for this

Problem in having a logo along with a Chart (HSSF)

Posted by Princess <he...@googlemail.com>.
An input on this...

int pictureIndex = wb.addPicture(data, HSSFPicture.PICTURE_TYPE_PNG);

            HSSFSheet sheet = wb.getSheetAt(1);
            HSSFPatriarch patriarch = sheet.createDrawingPatriarch();

            //all pictures use the same picture index, thus sharing the same
picture data
            HSSFPicture pic1 =  patriarch.createPicture(new
HSSFClientAnchor(0, 0, 10, 10,
                          (short)10, 0, (short)13, 3), pictureIndex);

The above code works when i have a worksheet with no graph/chart ..

But my requirement is a Excel file which will have data in sheet1 and a
Chart for the Data in Sheet2 along with a logo.

Now When using the aboce code snippet  i get a error message saying that the
Data would be lost and on opening the file
Sheet2  is totally erratic..Sheet1 is intact

I am using a Template for this



-- 
Hepzibah
**Hope can be ignited by a spark of encouragement *****