question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to convert Excel file to Base64 which is generated using ClosedXML

See original GitHub issue

Read and complete the full issue template

Do not randomly delete sections. They are here for a reason.

Do you want to request a feature or report a bug?

  • Bug

Did you test against the latest CI build?

  • Yes

If you answered No, please test with the latest development build first.

Version of ClosedXML

0.95.3

What is the current behavior? We are creating an excel file using the ClosedXML. Then we are using that excel file to convert in the Base64. There is some issue in file Excel creation by ClosedXML. So that file is not properly converted into the Base64.

What is the expected behavior or new feature?

  • We need to encode & decode Excel file into the Base64 which is generated by the ClosedXML.

Is this a regression from the previous version?

Regressions get higher priority. Test against the latest build of the previous minor version. For example, if you experience a problem on v0.95.3, check whether it the problem occurred in v0.94.2 too.

Reproducibility

This is an important section. Read it carefully. Failure to do so will cause a ‘RTFM’ comment.

Without a code sample, it is unlikely that your issue will get attention. Don’t be lazy. Do the effort and assist the developers to reproduce your problem. Code samples should be minimal complete and verifiable. Sample spreadsheets should be attached whenever applicable. Remove sensitive information.

Code to reproduce problem:

using (XLWorkbook wb = new XLWorkbook())
                                {
                                    wb.Worksheets.Add(dt,"CategoryData");
                           
                                    //SAVE & UPLOAD FILE ON S3
                                    using (MemoryStream stream = new MemoryStream())
                                    {
                                        wb.SaveAs(stream,true);
                                        var IsSuccess = CommonFunction.tmpUploadBlogFileToS3(stream.ToArray(),Settings.TranslationExcelPath,FileName);                
                                    } 
                                } 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
vbjaycommented, Jul 30, 2020

Generate a good excel file that does work. Generate the bad one too. Save to disk instead.

Change file extension to .zip. Extract the files and do a diff on each file. Show the diffs.

Another thing you can do is open in excel and see if any warnings show. Save without doing anything in excel. Compare against the original bad file.

On Thu, Jul 30, 2020, 7:40 AM dharmingheewala notifications@github.com wrote:

I am also facing the same issue. Can anyone help regarding this?

Is this library issue? I have tried using other libraries like EPPlus and its working well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ClosedXML/ClosedXML/issues/1483#issuecomment-666314445, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3WDMPB7FN6PO54N4BR23DR6FL2NANCNFSM4PNP24HA .

0reactions
igiturcommented, Jul 30, 2020

That file is truncated, not the full binary. As I said, this is not a ClosedXML issue. Closing this issue. Please use StackOverflow for further support.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Encoding and Decoding excel file as Base64 string
I am saving an Excel file that I am using as a template for reports ... this file and decode the string and...
Read more >
how to read in excel file in convert row with image to Base64 ...
You can use ClosedXML for reading excel files. You can write a loop to iterate the rows and access each column of your...
Read more >
Edit excel file in backend and load on spreadsheet ...
I have a controller action where I can read an excel file, convert it to base64 send it to the front end, and...
Read more >
Downloading an Excel File from DotNet Lambda ...
Generate a simple Excel file in AWS Serverless API and try to return it to the client. Possible Solution. Some documentation on how...
Read more >
Add image in to excel table from base64
I am able to add all data from those columns into excel tables using Parse JSON & Excel Business connector. But I am...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found