JsonDataLoadOptions.AlwaysGenerateRootObject

JsonDataLoadOptions AlwaysGenerateRootObject property. Gets or sets a flag indicating whether a generated data source will always contain an object for a JSON root element. If a JSON root element contains a single complex property such an object is not created by default.

JsonDataLoadOptions.AlwaysGenerateRootObject property

Gets or sets a flag indicating whether a generated data source will always contain an object for a JSON root element. If a JSON root element contains a single complex property, such an object is not created by default.

public bool AlwaysGenerateRootObject { get; set; }

Examples

Shows how to fill template with data from JSON data source loaded from file using LINQ Reporting engine.

JsonDataSource ds = new JsonDataSource(MyDir + "ReportingData.json", new JsonDataLoadOptions() { AlwaysGenerateRootObject = true });

ReportBuilder.BuildReport(MyDir + "ReportingTemplateForeach.docx", ArtifactsDir + "ReportingForeachJsonDataSource.docx", ds);

See Also