Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / add an image to a spreadsheet using the angular version

add an image to a spreadsheet using the angular version

New Discussion
Derick Lemos
Derick Lemos asked on Dec 21, 2021 3:14 PM

Please help me to add an image to a spreadsheet using the angular version.

I use the code below for the JQuery version, but I didn't find equivalence for angular.

Thanks.

addChart(sheet, id, lastRow) {

    let data = (document.querySelector('#' + id + ' canvas') as any).toDataURL()

    let imgHeight = 16

    let imgWidth = 8

    let startingRow = 1 + lastRow

    let endingRow = 1 + lastRow + imgHeight

    let startingCol = 'A'

    let endingCol = this.helpers.excel.posToAZ(imgWidth + 1)

    var imageShape = new ($ as any).ig.excel.WorksheetImage(data);

    imageShape.topLeftCornerCell(sheet.getCell(startingCol + startingRow));

    imageShape.bottomRightCornerCell(sheet.getCell(endingCol + endingRow));

    sheet.shapes().add(imageShape);

    return lastRow + imgHeight

  }

Sign In to post a reply

Replies

  • 0
    Michael DiFilippo
    Michael DiFilippo answered on Dec 21, 2021 2:42 PM

    Hello and thank you for contacting Infragistics. I've been testing out the spreadsheet and loading images and noticed a couple issues I need to discuss with the development team. Meanwhile I have a partial sample working zipped below. I created a private support ticket to follow up with you: C-00221413

    SpreadsheetImageSample.zip

    • 0
      ffortes ffortes
      ffortes ffortes answered on Dec 21, 2021 3:02 PM

      Thank you very much for the quick assistance.

    • 0
      Derick Lemos
      Derick Lemos answered on Dec 21, 2021 3:14 PM

      Thanks a lot for the help.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Derick Lemos
Favorites
0
Replies
3
Created On
Dec 21, 2021
Last Post
4 years, 3 months ago

Suggested Discussions

Tags

No tags

Created by

Created on

Dec 21, 2021 3:14 PM

Last activity on

Feb 16, 2026 9:16 PM