Declined
Last Updated: 04 Jun 2024 09:37 by ADMIN
Paul
Created on: 28 May 2024 17:09
Category: SpreadProcessing
Type: Bug Report
0
Importing/Exporting an Excel spreadsheet with an image in a cell loses the image in the exported file

I am using .net 7. I originally hit it with Telerik.UI.for.Wpf.70.Xaml.2023.3.1114. I updated to Telerik.UI.for.Wpf.70.Xaml.2024.1.423 to see if it was fixed but it still appears to happen.

I have attached a sample program which shows the behavior. Original.xlsm was created in Excel and has an image embedded in cell A1. Call ImportWorkbook with the path to the original file. Then export that workbook (unchanged) to the destination file.

Workbook workbook = ImportWorkbook( originalFileName );
ExportWorkbook( workbook, destinationFileName );
        private Workbook ImportWorkbook( string  fileName )
        {
            Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
            IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsm.XlsmFormatProvider();

            using( Stream input = new FileStream( fileName, FileMode.Open ) )
            {
                workbook = formatProvider.Import( input );
            }
            
            return workbook;
        }

        private void ExportWorkbook( Workbook workbook, string fileName )
        {
            Telerik.Windows.Documents.Spreadsheet.FormatProviders.IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsm.XlsmFormatProvider();

            using( Stream output = new FileStream( fileName, FileMode.Create ) )
            {
                formatProvider.Export( workbook, output );
            }
        }
The exported file is missing the image.
Attached Files:
1 comment
ADMIN
Yoan
Posted on: 04 Jun 2024 09:37

Hello Paul,

Thank you for the provided resources and description of the case.

After some investigation, it appears that the results you are experiencing are due to missing support by the SpreadProcessing library. Images in cells are not yet supported and are being omitted on import.

I allowed myself to log in a feature request about this in our Feedback Portal on your behalf - SpreadProcessing: Add support for images in cells. If you are interested you can cast your vote for it in order to impact its priority in our backlog and to subscribe to status changes to get notified of any future updates.

Please accept my apologies for the caused inconvenience. As a sign of appreciation for bringing this up to us, I have also updated your Telerik Points.

If you have any additional questions or feedback, feel free to contact us.

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.