AlwaysGenerateRootObject
Inhalt
[
Ausblenden
]JsonDataLoadOptions.AlwaysGenerateRootObject property
Ruft ein Flag ab oder setzt es, das angibt, ob eine generierte Datenquelle immer ein Objekt für ein JSON-Stammelement enthält. Wenn ein JSON-Stammelement eine einzelne komplexe Eigenschaft enthält, wird ein solches Objekt standardmäßig nicht erstellt.
public bool AlwaysGenerateRootObject { get; set; }
Bemerkungen
Der Standardwert istFALSCH
.
Beispiele
Zeigt, wie JSON als Datenquelle (Zeichenfolge) verwendet wird.
Document doc = new Document(MyDir + "Reporting engine template - JSON data destination.docx");
JsonDataLoadOptions options = new JsonDataLoadOptions
{
ExactDateTimeParseFormats = new List<string> {"MM/dd/yyyy", "MM.d.yy", "MM d yy"},
AlwaysGenerateRootObject = true,
PreserveSpaces = true,
SimpleValueParseMode = JsonSimpleValueParseMode.Loose
};
JsonDataSource dataSource = new JsonDataSource(MyDir + "List of people.json", options);
BuildReport(doc, dataSource, "persons");
doc.Save(ArtifactsDir + "ReportingEngine.JsonDataString.docx");
Siehe auch
- class JsonDataLoadOptions
- namensraum Aspose.Words.Reporting
- Montage Aspose.Words