Hi everyone,
When I use the JsonDataSource with the Reporting engine, first level properties are not case sensitive but nested array or Object property name are case sensitive.
Is it normal? Is there a way to ignore case?
I want to avoid forcing users to respect a certain case for property in word document.
For example in this code:
string startJson = "{\"Test\":{\"Var1\":\"22.50\",\"var2\":{\"foo\":\"2024-01-01\"},\"Objects\":[{\"Foo\":\"this is props foo of first object\"},{\"foo\":\"this is props foo of last object\"}]}}";
Document doc = new Document("input/test.docx");
ReportingEngine report_engine = new ReportingEngine();
report_engine.Options = ReportBuildOptions.AllowMissingMembers;
JObject jsonParsed = JObject.Parse(startJson);
var json = new MemoryStream(Encoding.UTF8.GetBytes(jsonParsed.ToString()));
JsonDataLoadOptions jsonDataLoadOptions = new JsonDataLoadOptions();
jsonDataLoadOptions.SimpleValueParseMode = JsonSimpleValueParseMode.Strict;
jsonDataLoadOptions.ExactDateTimeParseFormats = new List<string>();
report_engine.BuildReport(doc, new JsonDataSource(json, jsonDataLoadOptions), "test");
doc.Save("output/output.pdf");
If we dont follow the case from the Word document in the Json object for nested array, the outputed propery is blank (or will trigger an error depending of AllowMissingMembers).
Thanks for your help,