Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] How to add a logo/picture to the customized export functionality #14065

Closed
1 task done
mahammahmood opened this issue Aug 1, 2024 · 2 comments
Closed
1 task done
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: extend Logic customizability feature: Export support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@mahammahmood
Copy link

mahammahmood commented Aug 1, 2024

Latest version

  • I have tested the latest version

The problem in depth

In the DataGrid Premium, I want to customize the export functionality to include a logo in the first two rows

const exceljsPreProcess = ({ workbook, worksheet }: GridExceljsProcessInput) => { 
    workbook.creator = 'MUI-X team';
    workbook.created = new Date();  worksheet.mergeCells('A1:H2');   worksheet.addRow([]);  const imageId = workbook.addImage({
      filename: '.public/assets/logos/logo-fieldforce.png', // Update this path to your local image path
      extension: 'png',
    });
  worksheet.addImage(imageId, {
      tl: { col: 0, row: 0 }, // top-left corner of the image (0-based index)
      ext: { width: 300, height: 50 }, // width and height of the image in points
    });  };

This is the path of the image: './public/assets/logos/logo-fieldforce.png'.

Your environment

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: Data, Grid, Premium, GridToolbarExport, GridExceljsProcessInput
Order ID: 91010

@mahammahmood mahammahmood added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Aug 1, 2024
@github-actions github-actions bot added the support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ label Aug 1, 2024
@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! feature: Export customization: extend Logic customizability labels Aug 2, 2024
@michelengelen michelengelen changed the title I want to add a logo/picture to the customized export functionality [data grid] How to add a logo/picture to the customized export functionality Aug 2, 2024
@michelengelen
Copy link
Member

According to the docs from excelJs this should be possible: https://github.com/exceljs/exceljs?tab=readme-ov-file#add-image-to-workbook

But this is an external dependency and out of our control, so please refer to the official docs! Thanks!

@michelengelen michelengelen closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 2, 2024
Copy link

github-actions bot commented Aug 2, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@mahammahmood: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: extend Logic customizability feature: Export support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

2 participants