• Post Reply Bookmark Topic Watch Topic
  • New Topic

apache POI 3.9 autoSizeColumn() streching other existing images in the excelSheet  RSS feed

 
manas pati
Greenhorn
Posts: 1
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am having an image and some text below the image in an excel sheet . I am applying POI autoSizeColumn() method to auto resize the column . for this the image is also getting stretch.
I am using XSSFClientAnchor to create the image in excel and have set the anchorType to MOVE_DONT_RESIZE. here i am posting the sample code . I am searching for a way to resize the
column without streching the image any help is appreciated

 
Mark Beardsley
Ranch Hand
Posts: 32
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that this problem has something to do with the anchor you are using, but I cannot be certaib. The best way to check for problems is to create two test versions of your workbook, one using POI and the other directly with Excel. As you may know, the .xlsx file format is actually a container format, it holds various xml files zipped together. As a result, you can easilly open the files with an archive tools - PKUnzip, WinRAR, etc - and simply compare the files to see where POI is failing you. Remember to keep the workbooks as small as possible.

Furthermore, are you aware that there is a user list for POI? You can post questions there and they will be seen by a more focussed user body and possibly answered more speedily. You might be asked to post an example of the failing code and workbook. Completing the first step above will give you both.

 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have changed the colour tags to code tags, and you can see how much better it looks. I had to break the long lines; I think they are still a bit long, however.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!