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.

Column names are not CASE-SENSITIVE when it should be? 'The header row contains more than one field name 'x'.

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
  • Feature
  • Question

Did you test against the latest CI build?

  • [X ] Yes
  • No

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

Version of ClosedXML

e.g. 0.95.4

What is the current behavior? Colum with: ‘Geheel getal’ and ‘geheel getal’ gives a conflict: “The header row contains more than one field name ‘Geheel getal’.” Both entries should be working as unique columns, it should be ‘case-sensitive’. Am I missing something? STACKTRACE: at ClosedXML.Excel.XLTable.RescanFieldNames() at ClosedXML.Excel.XLTable.get_FieldNames() at ClosedXML.Excel.XLWorkbook.<>c__DisplayClass348_0.<GenerateSharedStringTablePartContent>b__2(IXLTable t) at ClosedXML.Excel.EnumerableExtensions.ForEach[T](IEnumerable1 source, Action1 action) at ClosedXML.Excel.XLWorkbook.<>c__DisplayClass348_0.<GenerateSharedStringTablePartContent>b__0(IXLWorksheet w) at ClosedXML.Excel.EnumerableExtensions.ForEach[T](IEnumerable1 source, Action1 action) at ClosedXML.Excel.XLWorkbook.GenerateSharedStringTablePartContent(SharedStringTablePart sharedStringTablePart, SaveContext context) at ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document, SaveOptions options) at ClosedXML.Excel.XLWorkbook.CreatePackage(Stream stream, Boolean newStream, SpreadsheetDocumentType spreadsheetDocumentType, SaveOptions options) at ClosedXML.Excel.XLWorkbook.SaveAs(Stream stream, SaveOptions options) at ClosedXML.Excel.XLWorkbook.SaveAs(Stream stream, Boolean validate, Boolean evaluateFormulae) at ClosedXML.Excel.XLWorkbook.SaveAs(Stream stream) at VMA_Server.Application.Services.ExcelService.CreateManagingFile[T](IEnumerable`1 list, String sheetName) in D:\Development\VMA\VMA-Server\VMA-Server\VMA-Server.Application\Services\ExcelService.cs:line 31

What is the expected behavior or new feature?

‘Geheel getal’ and ‘geheel getal’ should be working fine. They have to be used case-sensitive instead of ignore cases

Is this a regression from the previous version?

Didnt work for 0.95.3 aswell.

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:

 public class ExcelService : IExcelService
    {
        public byte[] CreateManagingFile<T>(string sheetName) where T : IManagingExcel {
            try
            {
              using var workbook = new XLWorkbook();
                var worksheet = workbook.Worksheets.Add(sheetName);
                worksheet.Cell(1, 1).Value = "Geheel getal";
                worksheet.Cell(1, 2).Value = "geheel getal";
                var firstCell = worksheet.FirstCellUsed();
                var lastCell = worksheet.LastCellUsed();
                worksheet.Range(firstCell.Address, lastCell.Address).CreateTable();
                worksheet.Columns().AdjustToContents();
                using var stream = new MemoryStream();
                workbook.SaveAs(stream);
                return stream.ToArray();
            }catch(Exception e)
            {
                return null;
            }
        }
    }
  • Spreadsheet is not generated, because of the error. On workbook.SaveAs the error gets thrown

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
igiturcommented, Feb 1, 2021

Yes, then I suggest you create unique column names.

0reactions
IndyVCcommented, Feb 1, 2021

If seems like it does not work in Excel either… I guess it is impossible to be using case-sensitive data in Excel. What would u suggest? Appending something behind the values?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The header row contains more than one field name - Help
Hi everyone, I have some problems about this known issue but is a different cause. I tried to uncheck the option “Add header”...
Read more >
Are column and table name case sensitive in MySQL?
Field (column) names are case-insensitive regardless. EDIT: we're talking about the operating system on the MySQL server machine, not client.
Read more >
Solved: PowerApps Error : The header row contains more tha...
Currently I am trying to create a button "SubmitForm(Form2)". It reads: The header row contains more than one field name "_PowerAppsID_". I am...
Read more >
Ignoring Case Sensitivity in Power Query - YouTube
In this video I share a few tips and tricks to ignore case sensitivity in Power Query. Enjoy! ===== ONLINE COURSES ===== ✔️...
Read more >
Case sensitive column names?
Is there an Idea for this? Easily one of the most frustrating things I've dealt with in Tableau. Column names should not be...
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