Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6022177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:49:16+00:00 2026-05-23T03:49:16+00:00

I am adding an image to the worksheet through some code like this: //

  • 0

I am adding an image to the worksheet through some code like this:

// Create the drawing patriarch.  This is the top level container for all shapes.
Drawing drawing = sheet.createDrawingPatriarch();

//add a picture shape
//ClientAnchor anchor = this.creationHelper.createClientAnchor();
ClientAnchor anchor = new HSSFClientAnchor((short)0, (short)0, (short)0, (short)0, (short)0, (short)0, (short)2, (short)5)

// 0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells. 
anchor.setAnchorType(2)

HSSFPicture pict = drawing.createPicture(anchor, this.images.get("logo"));
pict.resize() ;

However just after the images are added, I resize the columns – which seems to mess things up. It resizes the images – which is not what I want.

//psuedo code
public void autoSizeColumns() {
    def cols = (StartColumn..this.cMax)
    cols.each { i ->
        sheet.autoSizeColumn i
    }   
}

BrandedWorksheet v; 
v.autoSizeColumns()

If I don’t perform the autoSizeColumns() the image is the proper size.

Is there any way to have both?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:49:17+00:00Added an answer on May 23, 2026 at 3:49 am

    This is crazy and doesn’t make much sense, but allocating the proper amount of spacing and rows seems to be the key. I added enough rows so that the image could be bound internally to the rows – and all seems good.

    Moral of the story: keep working and messing about and it may eventually work. You will get really frustrated, and there won’t be a ton of help out there – because those of us who have properly sized an image don’t really understand why.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Excel addin that displays some structures on the worksheet. Users can
Am having a hard time in adding image along with a text in a
in will_paginate, i am using custom pagination. Here, i am adding image for pagelinks
I have a drawing area, and an 'png' image I want to load that
Suppose, I have this paragraph: <p>this is a paragraph containing link to an image
I'd like to have the contents of my table to scroll around on top
I have image and txt file of same size say 200 KB. Now i
How to add Image in different different HSSFCell object in poi ? I have
I want to add an image to a UIButton, and also want to scale
I'm looking for a guide or sample code for writing Mac OS X Finder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.