Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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

Posts: 1
Hibernate Spring Java
  • 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

Ranch Hand
Posts: 32
  • 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.

Posts: 66190
  • 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.
These are the worst of times and these are the best of times. And this is the best tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!