adding a PNG file to be displayed in exported Excel

1 Answer 58 Views
Excel Export
Toffer
Top achievements
Rank 1
Toffer asked on 10 Dec 2024, 11:29 PM
Hello...I'm trying to add a PNG file to my export excel document.  Here is the code I'm using to try and do it.  Is it possible to even do this?  Am I doing anything wrong in my code?  This is the click even to a button in my own react component that I use to wrap the kendo ExportExcel library.

exportToExcel = async () => {
    if (this.excelExportRef.current) {
        const workbook = this.excelExportRef.current.workbookOptions();

        if (this.props.pngImage) {
            workbook.sheets[0].images = [
                {
                    name: 'pngImage',
                    src: this.props.pngImage,
                    position: {
                        type: 'twoCellAnchor',
                        from: { row: this.props.tableData.length + 10, col: 4 },
                        to: { row: this.props.tableData.length + 60, col: 10 }
                    }
                }
            ];
        }
    }

    this.excelExportRef.current.save(workbook);
}

1 Answer, 1 is accepted

Sort by
0
Yanko
Telerik team
answered on 12 Dec 2024, 06:29 PM

Hello, Toffer,

The only option that I can suggest is to load the Kendo UI for jQuery suite and use their option for exporting to Excel with drawings, as currently, the KendoReact ExcelExport does not support such a feature.

You can refer to the Kendo UI for jQuery documentation and support team to assist you if you decide to go down this path:

I can also recommend submitting a feature request in our feedback portal for such a feature:

Regards,
Yanko
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.

Tags
Excel Export
Asked by
Toffer
Top achievements
Rank 1
Answers by
Yanko
Telerik team
Share this question
or