Issue with merged cell and an image imported to it.

Posted by: krishna.vajja on 1 October 2019, 12:10 am EST

  • Posted 1 October 2019, 12:10 am EST


    I have a query regarding the ImageCell.
    If I put an image cell in the merged cells of the spreadsheet and reopen the template I am losing
    the image.

    Image Specifications:

    Image Size has to be less than the size of the merged cell size.

    Case 1:
    Horizontal Alignment: Bottom
    Vertical Alignment: General

    Case 2:
    Horizantal Alignment: General
    Vertical Alignment : Right

    And the other query is After upgrading it to Spread v12.45.20191.0 the default Image Vertical Alignment has been changed from
    General to Bottom.
    Can you let us know the reason behind this?

    Note: I have used the following Save and open flags in our code.

    For excel save we used below flags:
    result = SaveExcel(fileName, ExcelSaveFlags.UseOOXMLFormat | ExcelSaveFlags.PreferTextOnExport | ExcelSaveFlags.ComboAsDataValidation);

    Same way for opening the excel we used,
    OpenExcel(FileName, FarPoint.Excel.ExcelOpenFlags.DocumentCaching | FarPoint.Excel.ExcelOpenFlags.DoNotRecalculateAfterLoad | FarPoint.Excel.ExcelOpenFlags.DataAndFormulasOnly);

    Attached is a screenshot for reference.

    Please suggest some fix for this.

  • Marked as Answer

    Replied 2 October 2019, 7:55 pm EST

    Hi Krishna,

    1. If the image size is smaller than the spanned area and the alignment is set to one side then it is expected (if the image is not scaled) that the image will be aligned to the specified side leaving some space on the other side.

    Also, the default alignment is still General. Please refer to the attached sample and see if I'm missing anything else.

    2. While opening the Excel file, you need to remove the enum "DataAndFormulasOnly". If you remove this enum, then the image is correctly loaded from the excel file.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels