SetColumnWidth/SetRowHeight


#1

I am working with a Designer Sheet that has an image located over cell A1.

I am now filling rows/columns starting from cell B3 and determine row heights
column widths on the fly while I’m still working with Aspose.Excel 1.5 rather than
calling AutoFit methods.

Having filled the cells and determined the heights/widths, I go through the cells
(again starting at B3) and call SetColumnWidth/SetRowHeight where applicable.

However, the image over A1 is stretched even though "Don’t move or size with cells"
has been activated.

When I size column A to be as wide as the image is, the image will not be stretched
when I call SetColumn width on column B.

I think that this behavior is not correct and should be changed to obey the image
properties in order not to have it resized.

Any help would be highly appreciated.

Regards

Kai Iske


#2

One thing: The correct version I’m compiling against ist 1.5.7.0.
I do not seem to be able to download other hotfixes for the 1.5 branch as all the
links within the forum point to the current 1.6.1.0 hotfix that kills all my foreground colors.

Any help would be highly appreciated.

Thanks

Kai


#3

Dear Kai,

Thanks for your consideration.

Your idea is right. If the row height or column width is adjuested, the image should not stretched if the correct option is selected.

But it’s difficult to re-calculate location of image if row height or column width is adjuested, and I have other urgent works on hand, so I cannot fix this problem in a short time.

I suggest a work-around which is proposed by another user:

1. Do not insert the image in designer file in the rows/columns if you want to change the heights/widths.

2. In your code, you first set the heights/widths

3. Then insert images through API

I will fix this problem laterly.


#4

Laurence,

generally this is a workaround, but I prefer having all my templates and images within my resources and not as loose files coming with my installation. As the Add() method of the Pictures Collection does not support adding an image through either supplying an Image derived class or by supplying a Stream, this is no option for me either.

Regards

Kai


#5

Laurence,

if there was a way to add a Picture instance to the Picture Collection, I could remove all pictures from my designer template, resize columns/widths and add the Picture instances back to the sheet.

Regards

Kai


#6

Dear Kai,


Currently Aspose.Excel can only import image from a file.


#7

Dear Kai,

I will try to fix this problem before the end of this month.