Word Cloud API auto convert content to number

Hi Support Team,
I’m using Word cloud API : https://api.aspose.cloud/v4.0/words/buildReport
My template:
image.png (6.0 KB)
The model:
{
“testNo”: “00012345”
}
But the output is:
image.png (4.4 KB)

Expected result: 00012345 . Please help me to fix it

Thanks.
image.png (6.00 KB)
image.png (4.41 KB)

@toannt.ts Your question is related to Cloud version of Aspose.Words. I will move it to the appropriate forum. My colleagues will help you shortly.

@toannt.ts

You may set the SimpleValueParsieMode property of JsonDataLoadOptions to Strict as follows. It will help you to accomplish the task.

WordsApi wordsApi = new WordsApi(ClientId, ClientSecret);

var requestReportEngineSettings = new ReportEngineSettings()
{
    DataSourceType = ReportEngineSettings.DataSourceTypeEnum.Json,
    JsonDataLoadOptions = new JsonDataLoadOptions() // <= new field for specify load options for JSON data
    {
        SimpleValueParseMode= JsonDataLoadOptions.SimpleValueParseModeEnum.Strict
    }
};
var request = new BuildReportRequest(
    name: "Test.docx",
    data: File.ReadAllText("C:/Temp/Report/Test.json"),
    reportEngineSettings: requestReportEngineSettings,
    destFileName: "Report_output.docx"
);
await wordsApi.BuildReport(request);

Thanks for your support, it’s working now.

1 Like