Hi Team,
I am not able to return value as false when syntax has issue for example for method Engine.BuildReport(builder.Document, "", "");
when <[Study.Title]>>
is missing one angular bracket in starting.
Hi Team,
I am not able to return value as false when syntax has issue for example for method Engine.BuildReport(builder.Document, "", "");
when <[Study.Title]>>
is missing one angular bracket in starting.
@Amisha43 <[Study.Title]>>
is not recognized as a reporting syntax and is treated as a simple text, so Aspose.Words does not detect any errors in the syntax.
what all errors it can detect
@Amisha43 The returned flag indicating whether parsing of the template document was successful. For example, there is <<[test]>>
, but there is no test
variable in the data source. In this case if ReportBuildOptions.InlineErrorMessages
is not set Aspose.Words will throw an exception. But in case if ReportBuildOptions.InlineErrorMessages
is set, ReportingEngine.BuildReport
will return false
:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("<<[test]>>");// Invalid syntax
ReportingEngine engine = new ReportingEngine();
engine.Options = ReportBuildOptions.InlineErrorMessages;
Console.WriteLine(engine.BuildReport(doc, "", "test1"));
Thanks for the reply. Is there any way to get total count of errors in document in one go.
Thanks for the reply. I am facing “Stack empty” issue with below code.Could you please tell what is the problem.
<<foreach [Name in Student.Missing]>> Name - <<[Name ]>> <</foreach>>
@Amisha43 Could you please provide you sample template, data and code that will allow us to reproduce the problem? We will check the issue and provide you more information.
Above shared is the sample data.
I can discribelittle more.
<<foreach [ADate in Study.Missing]>>Amendment Date - <<[ADate]>> <</foreach>>
Study.Missing
will give inline error after executing BuildReport
first time<<[ADate]>>
also give inline error after executing BuildReport
second timeBuildReport
it will give exception “stack empty” for <>(it doesn’t have anything to iterate over) as "<<foreach [ADate in Study.Missing]>>Amendment Date - <<[ADate]>>"
already have error.@Amisha43 Unfortunately, it is still not clear how to reproduce the problem. Could you please create a simple console application that will allow us to reproduce the problem?