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

Export image to custom template #604

Open
leandrobattochio opened this issue May 22, 2024 · 1 comment
Open

Export image to custom template #604

leandrobattochio opened this issue May 22, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@leandrobattochio
Copy link

So I have a custom template but I can't add images. All the rows are being added fine but when it's supposed to have an image, the cell shows only "System.Byte[]".

How can I add an image using SaveAsByTemplateAsync ?

@piotr-nawrot-golba-music

@leandrobattochio

Thank you for bringing up this issue. I've encountered a similar problem when using the library. Specifically, when setting

var c = new OpenXmlConfiguration
{
    EnableConvertByteArray = true
};

to insert the images to the template, I encountered an exception in the UpdateDimensionAndGetRowsInfo method.

After investigating this issue, I suspect that there might be a limitation in the current library's ability to handle byte arrays in the templates.
As a temporary workaround, I've used the ClosedXML library to insert my images into the templates first, and then I've used MiniExcel to insert the rest of the values. This approach might not be ideal, but it may serve to unblock your progress until this issue is addressed by the library authors.
It would be a great feature enhancement if the library could support the inclusion of images from byte arrays inside templates directly. Looking forward to this enhancement.

@shps951023 shps951023 added the help wanted Extra attention is needed label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants