Hi there, we're using Excel 2013 templates and the latest NetOffice 1.7.0 libs in a C# assembly to create reports from data stored in an MS-SQL server database. This works well, unless a certain amount of data is exceeded. My code looks like this:
// exportSheet is a Worksheet instance
ListObject dataTable = exportSheet.ListObjects["DataTable"];
Range dataTableBody = dataTable.DataBodyRange;
...
// Loop start...
// recordCount increases with evaluated records from DB
dataTableBody[recordCount, 1].Value = recordCount; //Exception may occur here...
dataTableBody[recordCount, 2].Value = meterRecord.Timestamp; //...or here or...
dataTableBody[recordCount, 3].Value = meterRecord.IntervalValueDiff; //...or here
...
// Loop end
When a (non deterministic) amount of data is exceeded, I get a COMException with an inner exception of type System.Reflection.TargetInvocationException in the lines where I try to assign the cell values (see attached file). This happens with more than roughly 500-700 records on my machine - with fewer records, everything is fine.
Any chance to find out, what the source of the problem is? Any hint for a workaround?
Best regards,
Hans
// exportSheet is a Worksheet instance
ListObject dataTable = exportSheet.ListObjects["DataTable"];
Range dataTableBody = dataTable.DataBodyRange;
...
// Loop start...
// recordCount increases with evaluated records from DB
dataTableBody[recordCount, 1].Value = recordCount; //Exception may occur here...
dataTableBody[recordCount, 2].Value = meterRecord.Timestamp; //...or here or...
dataTableBody[recordCount, 3].Value = meterRecord.IntervalValueDiff; //...or here
...
// Loop end
When a (non deterministic) amount of data is exceeded, I get a COMException with an inner exception of type System.Reflection.TargetInvocationException in the lines where I try to assign the cell values (see attached file). This happens with more than roughly 500-700 records on my machine - with fewer records, everything is fine.
Any chance to find out, what the source of the problem is? Any hint for a workaround?
Best regards,
Hans