Hello,
I am currently using v24.1.0 of the Aspose.Words nuget package with a word document template. I am calling my reporting engine as follows in C#/.NET:
var asposeDocument = new Document(AuditWorksheetWordDocService.GetWordDocumentStream());
var tempCompleteAuditFileLocation = $"{tempCompleteAuditPath}\\{tempCompleteAuditName}";
ReportingEngine reportingEngine = new ReportingEngine();
reportingEngine.Options = ReportBuildOptions.AllowMissingMembers;
reportingEngine.BuildReport(asposeDocument, new object[] { worksheet }, new string[] { "fd" });
Attached is the template document that reproduces the error, “unexpected end of template”. I am curious what is causing the error. It seems to only occur when you have ~30 rows inside of an if
tag. Thank you for any and all help on this issue.
asposeIfTest.docx (17.0 KB)
@nsinotte Unfortunately, I cannot reproduce the problem with the provided template and the following code:
Document asposeDocument = new Document(@"C:\Temp\in.docx");
ReportingEngine reportingEngine = new ReportingEngine();
reportingEngine.Options = ReportBuildOptions.AllowMissingMembers;
// Use empty object as a data source since there are not data fields in the template.
reportingEngine.BuildReport(asposeDocument, new object());
asposeDocument.Save(@"C:\Temp\out.docx");
If possible, could you please create a simple console application that will allow us to reproduce the problem?
@alexey.noskov Thanks for responding!
I was wondering if you could tell me what version of .NET you are running? What version of the Nuget package you have downloaded, and if you could add 5 - 10 rows to the table and see if that triggers it?
Thanks again for checking this out!
Sincerely,
Nick Sinotte
@nsinotte Most likely, the problem occurs because Aspose.Words is used in evaluation mode, i.e. without license. In evaluation mode Aspose.Words limits the maximum size of the processed document to several hundreds of paragraphs. So your document is truncated.
If you would like to test new version of Aspose.Words without evaluation version limitations, you can request a free 30-days temporary license .
Please see our documentation to learn more about licensing:
https://docs.aspose.com/words/net/licensing/