Win a copy of Head First Android this week in the Android forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Apache POI: Output of excel not as expected (Image missing)

 
Rancher
Posts: 1171
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a follow up question of this post, but since it's an different issue, I created a different thread.
I'm trying to generate an excel file from data in my program, in which I succeed, but the formatting is al wrong.
First of all the first cell of the first row should be a logo, it shows up as 0, which kinda makes me suspect the bite array was empty?
I use an url to fetch the picture, since I don't know where the user is going to install the program, I can't add it as an recource and then use that path.
Secondly everything I used a '\n' on is concatenaded to one line cause the cells don't expand automaticly.
So I have a two based question: What am I doing wrong with the logo and how do I make the cells expand automaticly?
This is the method I use to generate xlsx:

This part I'm using to get and write the image (it's part of the export method):

The used url result in:




This is how it looks:



This is +- how it's suposed to look:

 
Daniel Demesmaecker
Rancher
Posts: 1171
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Layout I managed to solve, rests only the logo that isn't being printed
 
Daniel Demesmaecker
Rancher
Posts: 1171
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also Managed to solve That One:



Looks mutch better dosn't it?
 
Daniel Demesmaecker
Rancher
Posts: 1171
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For everyone wondering what changes I maded...
For the Picture:
Turns out I forgot an important part of the code:

Which is actually responsible for drawing the picture to the workbook and setting an achor, containing a start column and row and an end column and row (so determines the size of the picture)
The last two lines posted alow me to resize the picture.

for the expanding of the columns:
I just added in my column forEach (the second forEach in the original posted code)

and finally the bold Lines:
I checked for the content of the field and created a style:

That's all!
Lol... A one man thread...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic