SimpleValueParseMode

JsonDataLoadOptions.SimpleValueParseMode property

Ottiene o imposta una modalità per l’analisi di valori JSON semplici (null, booleani, numeri, interi e stringhe) durante il caricamento di JSON. Tale modalità non influisce sull’analisi dei valori di data e ora. Il valore predefinito è Loose .

public JsonSimpleValueParseMode SimpleValueParseMode { get; set; }

Esempi

Mostra come utilizzare JSON come origine dati (stringa).

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");

Guarda anche