Hi Team,
We are developing a screen where user should be able to download data to Excel of multiple components in the page. The components can be charts, tables or anything. Ideally each of them will be having a json data in the angular model.
Now our requirement needs the following:
Looking forward to your help.
Thanks
Hello,
I have been looking into your question and my suggestion is to take a look at our Excel Library which gives you the opportunity to create separate worksheets, populate them with required data and format them per your requirement.More about it can be found in our documentation under the Excel Library section.
If you require any further assistance on the matter, please let me know.
Sincerely,Teodosia HristodorovaSoftware Developer
Hi Teodosia,
Thanks for your response.
Can you please give me a sample to add png image to the sheet. I didn't find any sample or demo in the Excel Library section.
I want our company logo to be added in mid of the First row.
Please let us know how to achieve this.
An approach I could suggest is to use WorksheetImage. In its constructor, you need to pass a base64 string of the required image. Afterward, you need to set its position and add it to the Worksheet shapes collection. For example:
const wb = new Workbook(WorkbookFormat.Excel2007); const imageSheet = wb.worksheets().add('Image'); const img = new WorksheetImage(this.imageBase64); img.topLeftCornerCell = imageSheet.rows(0).cells(0); img.topLeftCornerPosition = new Point(0, 0); img.bottomRightCornerCell = imageSheet.rows(2).cells(2); img.bottomRightCornerPosition = new Point(50, 50); img.setBoundsInTwips(imageSheet, img.getBoundsInTwips()); imageSheet.shapes().add(img); this.wb = wb;
Please test it on your side and let me know if I may be of any further assistance.
Thanks this worked.
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Teodosia HristodorovaSoftware Developer