This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Not outputting column headers when data is empty #42
Comments
I am having similar problem with it. When there is no data, it just gives generic names to columns. Such as Column1, Column2 etc. Is there a work around? |
For now I am using this approach:
Not the perfect way, but should work fine in this case. |
My workaround was similar (except I add an empty row to the data rather than modify the output sheet) - I did it this way because I didn't want to interfere with any kind of header formatting (not sure if your way would or not).
|
I used the workaround as well -- but I simplified it to append an empty row to the existing datatable instead of instantiating and returning a new one:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Just wanted to know if a particular scenario is supported: the query returns no data but you still want to output the column headers in the sheet. I have confirmed my DataTable contains the necessary column metadata but the sheet that is produced is entirely empty (with no column headers).
I am using code similar to :worksheet.Cells["A1"].LoadFromDataTable(data, true); (where the "data" is my datatable).
Thank you.
The text was updated successfully, but these errors were encountered: