1

I know how to get RowHeight

using(var xls2003Stream = new MemoryStream(xlsBytes)) 
{
    using(var reader = ExcelReaderFactory.CreateReader(xls2003Stream))
    {
        var height = reader.RowHeight;
        ...
    }
}

but the question is - can I get the column width using the ExcelDataReader library?

AakashM
  • 62,551
  • 17
  • 151
  • 186
Mr-Cas
  • 11
  • 2
  • 1
    ExcelDataReader is [meant to read Excel data, not formatting](https://github.com/ExcelDataReader/ExcelDataReader#formatting). The *reader* doesn't know about rows or heights, it knows how to read the next row and get column values from that row. What are you trying to do? If you care about formatting you probably need a different library, like EPPlus – Panagiotis Kanavos Nov 08 '18 at 14:36
  • Yes i've got concept of that library, but for me it looks a bit weird that they created property RowHeight and no ColumnWidth. Anyway, it would be great if you will suggest me library which can read Excel2003 format with .NET Core support. I didn't found one. – Mr-Cas Nov 08 '18 at 17:11
  • `xls` was abandoned 12 years ago. The format used by Excel is `xlsx`, a zip package containing XML files. The only *reliable* way to handle the obsolete format is to install Excel. That's impossible for servers or third-party applications, which is part of the reason it was abanadoned. Google Sheets doesn't support `xls` except for paid subscriptions for example. – Panagiotis Kanavos Nov 08 '18 at 17:19
  • Yes its correct that this file structure is old. But you are not right about possibility to parse it. There is open documentation about xls file structure (https://interoperability.blob.core.windows.net/files/MS-XLS/%5BMS-XLS%5D.pdf). And current library i talk about in this topic can do the job, but it seems they didn't implement ColumnWidth property. AakashM right, i opened issue on GitHub. – Mr-Cas Nov 08 '18 at 17:48
  • And only *paid* libraries provide good enough results, none of them as good as Excel itself. Just because the format is known doesn't mean a library can handel pivot tables, features stored as blobs, embedded objects. The contents of those fields depend on each version of Excel itself. – Panagiotis Kanavos Nov 08 '18 at 17:54

2 Answers2

0

Based on the fact that searching the library's repo for the word width doesn't show up anything useful, I'm going to say no it's not currently possible. But then, from the issue you opened, you knew that right? :)

AakashM
  • 62,551
  • 17
  • 151
  • 186
0

Issue opened on GitHub as they just didn't implement this property. https://github.com/ExcelDataReader/ExcelDataReader/issues/365

Mr-Cas
  • 11
  • 2