JanKallman / EPPlus

Create advanced Excel spreadsheets using .NET
3.75k stars 1.17k forks source link

Repaired Records: String properties from /xl/sharedStrings.xml part (Strings) #583

Open deamonguru opened 4 years ago

deamonguru commented 4 years ago

I use EPPLus to merge excel workbooks exported from SSRS. Merge works without any issue but I am getting this error while opening the file in excel. I don't run into this issue if I use Office InterOp to merge files. I tried merging the empty report files using just header in it and still getting the same error. I am attaching both files here, "SSRS_Exported_ToBeMerged" is the file i used to produce the other one using EPPlus.

After_EPPlus_Merge.xlsx SSRS_Exported_ToBeMerged.xlsx

deamonguru commented 4 years ago

Linking up my question on stackoverflow here. Excel open error goes away if I replace Rich Text with normal string. I loose custom formatting on cell though by doing this.

foreach (var cell in sheet.Cells) { if (cell.IsRichText) { var txt = cell.Text; cell.RichText.Clear(); cell.RichText.Add(txt); } }

https://stackoverflow.com/questions/58862773/repaired-records-string-properties-from-xl-sharedstrings-xml-part-strings