Problem with SetColumnWidthPixel()

We have recently upgraded from Aspose v4.3 to v6.0.1 and are encountering an error that we did not previously receive. We are attempting to call Cells.SetColumnWidthPixel(5, 2400). While the documentation on-line here does not indicate a limit to the number of pixels one can set with this function, it appears that Aspose.Cells subsequently makes an internal call to SetColumnWidth() function and is attempting to pass a width parameter that is outside the 0-255 range for that function's parameter.

How is the SetColumnWidth() width parameter determined based on a call to SetColumnWidthPixel()? Since 255 is the limit for the SetColumnWidth() function's width parameter, what is the effective limit of the SetColumnWidthPixel() function's width parameter?

I see a similar issue with identical stack track was reported here with SSRS through .NET:

http://www.aspose.com/community/forums/1/158003/an-error-occurred-while-exporting-the-report/showthread.aspx#v

Thank you,

Mark Sheehan

Hi,


Well, we follow MS Excel standards and depends upon the limitation that MS Excel does put forth. In MS Excel how could you do that. You may have a column with a maximum value i.e 1790 (in pixel), you cannot have more than that value for a column. So, consequently you can set Cells.SetColumnWidthPixel(5, 1790) → 1790 refers to 255 in points. You may check this in MS Excel.

Sample code:

Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[“Sheet1”];

Cells cells = ws.Cells;
cells.SetColumnWidthPixel(0, 1790); //This works. i.e. 1790 pixels = 255 points
// cells.SetColumnWidthPixel(0, 1791); //This will not work. --You can check.
wb.Save(“e:\test2\columnwidthset.xlsx”);

If you could set more than that, create a template file in Ms Excel and post it here, we will check it soon.


Also, check the document for reference:
http://stackoverflow.com/questions/139655/how-to-convert-pixels-to-points-px-to-pt-in-net-c

Thank you.