Hi,
We have recently upgraded Aspose.Cells from 20.2.4.0 to 24.12.0.0. Our application uses Aspose.cells to extract the image from excel files (uploaded by clients) and display in the reports.
After the upgrade we are facing multiple issues in our production after this. We see that in production, the images are broken like table content gets compressed/cropped, charts getting cropped. (refer attached images). But when we test these issues in our ‘Dev environment’ we are not able to replicate them even though the ‘entire application code base’ is in sync.
After spending some time, we found that ‘MS Office Version’ being installed in ‘Production Server’ and ‘Development Server’ are different as mentioned below. Slight difference in the build numbers.
In Production
Microsoft Excel 2016 (16.0.5483.1000) MSO (16.0.5483.1000) 32 bit in production
Dev VM
Microsoft Excel 2016 (16.0.5469.1000) MSO (16.0.5465.1000) 32 bit in production
So we have some questions to help our analysis,
-
Is this difference in version, affect the ‘image output extracted from excel file’ using Aspose.Cells., Is this the reason we are not able to replicate these issues in our ‘Dev Environment’?
-
We are assuming that ‘Aspose.cells’ is a standalone library and doesn’t depend on/requires MS Office? Is our assumption correct?
-
‘Does the version used to create the source excel file’ on different machines/MS Office version affect the ‘image output extracted from excel file’ using Aspose.Cells. ? If yes, how and why?
For ex: Customer X is using ‘MS Office 2013’, Customer Y is using ‘MS Office 365’, they both create the same excel file in their respective machines and upload it our ‘production server’ , Production server has been installed with ‘MS Office 2016’. So, considering this scenario, what are all the factors that might affect the Aspose.cells output. -
Could you also please explain if any other factors that might affect the ‘image output extracted from excel file’ using Aspose.Cells ?
FYI, below are the configurations we set during our image extraction code base.
private static void ApplyWorkSheetSettings(Worksheet sourceWorksheet)
{
sourceWorksheet.PageSetup.LeftMargin =
sourceWorksheet.PageSetup.RightMargin =
sourceWorksheet.PageSetup.TopMargin =
sourceWorksheet.PageSetup.BottomMargin = 0;
// Resets column's width to fit as per cell values.
sourceWorksheet.AutoFitColumns(GetAutoFitterOptions());
}
public static ImageOrPrintOptions GetImageOrPrintOptionsSettings(Worksheet sourceWorksheet)
{
ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();
imageOrPrintOptions.OnePagePerSheet = true;
// Always use Png as its file size is 8 times lesser than of Jpeg.
imageOrPrintOptions.ImageType = ImageType.Png;
imageOrPrintOptions.HorizontalResolution = 200;
imageOrPrintOptions.VerticalResolution = 200;
AutoFitterOptions autoFitterOptions = GetAutoFitterOptions();
sourceWorksheet.AutoFitColumns(autoFitterOptions);
sourceWorksheet.AutoFitRows(autoFitterOptions);
return imageOrPrintOptions;
}
private static AutoFitterOptions GetAutoFitterOptions()
{
return new AutoFitterOptions()
{
AutoFitMergedCellsType = AutoFitMergedCellsType.EachLine,
AutoFitWrappedTextType = AutoFitWrappedTextType.Default,
DefaultEditLanguage = DefaultEditLanguage.Auto,
FormatStrategy = CellValueFormatStrategy.DisplayStyle,
ForRendering = true,
IgnoreHidden = true
};
}
Thanks,
Prathap
Attachments:
chart issues screenshot.png (104.2 KB)
table issue screenshot.png (85.8 KB)