AutoFitRows();

Hi,
I have this issue with AutoFitRows() function. I used the AutoFitRows() to format the row but for some reason it’s formatting the row height to a large value like 400+. I am using the SheetToImageByPage() function to print out the data and most of the pages looked weird. Can you help me take a look to see if there is a bug in the AutoFitRows function. I’ve attached sample xls file. the original.xls is before using AutoFitRows() and Formatted.xls is saved after using AutoFitRows. Thank you for your help.

Hi,

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon.

Thank You & Best Regards,

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issue.

Thank You & Best Regards,

Thank you for fixing this issue quickly. I did noticed that with the same sample excel file that i provided early. There may be an error on the indexing. For example. I used the sheet2imagebypage() function to print out the sheets but first row was missing and row heading was off by one. If you take a look at rows before 478. You’ll see that it suppose to be row 477 and so on.

Hi,

Well, I have tested and it works fine. Actually for your worksheet named "Rollout", the print area is set to "A2:T171" (Open the file in MS Excel 2003 and click menu option File|PageSetup|Sheet tab), so, the first row is not set for printable area. The SheetToImage function would generates the sheet images as per your print preview settings. I think you may set your desired printable area in your code, see the following code:

Workbook workbook = new Workbook();

workbook.Open("f:\\test\\Original.xls");

Worksheet worksheet = workbook.Worksheets[1];

worksheet.AutoFitRows();

worksheet.PageSetup.PrintArea = "A1:T171";

string path = "e:/";

worksheet.SheetToImageByPage(path, System.Drawing.Imaging.ImageFormat.Emf);

workbook.Save("f:\\test\\outOriginal.xls");

Thank you.

Thank you Amjad. I should have checked the printarea. Sorry to waste your time.