问题
Saving Excel file that contains (even an empty) pivot table results in "Null Reference Exception" without any helpful message.
The image that shows the exception message is here below.
回答1:
If you create pivot tables with EPPlus, make sure all your columns have headers (naming of the column as first row). Missing headers result in "null reference exception" when trying to save the file, even though all the rest of the application is perfectly functioning. What a devil.
来源:https://stackoverflow.com/questions/34766781/epplus-saving-file-throws-null-reference-exception