-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Null Reference Exception in XSSFSheet.CopySheetImages if there are charts in the original sheet. #287
Milestone
Comments
I Have the same issue, the different has two-part.
|
@tylkotroszke I can reproduce your issue. Although I resolve the issue by checking null, the chart still cannot be copied. (the charts elements are ignored by the logic). Here is the output file generated by latest NPOI. |
So generally speaking NPOI cannot copy charts right? @tonyqus |
No, NPOI cannot copy charts so far. |
This was referenced May 6, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I have problem when trying to copy sheets from one excel file to another. The goal is to merge many excel files in to one. I got NullReferenceException.
Error message:
An unhandled exception was thrown by the application. System.NullReferenceExcepti on: Object reference not set to an instance of an object. at NPOI.XSSF.UserModel.XSSFSheet.CopySheetImages(XSSFWorkbook destWorkbook, XSSFSheet destSheet) at NPOI.XSSF.UserModel.XSSFSheet.CopyTo(XSSFWorkbook dest, String name, Boolean copyStyle, Boolean keepFormulas)
For some reason cellAnchor.picture is null so this is not even going deeper in to blipFill.blip.embed
string embed = cellAnchor.picture.blipFill.blip.embed;
line 2939This is the input file from which I want to copy sheets to new workbook. I got more of them but they look almost the same first sheet with table and second sheet with different types of charts.
input.xlsx
My code that isn't working:
`
public string MergeReports(List reportsPaths)
{
string path = "D:\02_Testy";
finalFile = Path.Combine(path,test.xlsx);
XSSFWorkbook workbookMerged = new XSSFWorkbook();
`
Every other parts of that 2 sheets are copied just fine. Only issue is that application crash when there is chart in second sheet.
The text was updated successfully, but these errors were encountered: