When I use a template to generate word, I get two errors :(I’m sure my template is ok)
The JSON field contains Chinese characters
The JSON field is empty
err info:
{“RequestId”:“Root=1-6100b874-70cb778a1db0d8867e39ab8b”,“Error”:{“Code”:“ErrorInvalidInputData”,“DateTime”:“0001-01-01T00:00:00Z”,“Description”:“Operation Failed. The input data is not valid.”,“InnerError”:{“DateTime”:“0001-01-01T00:00:00Z”,“Message”:“An error has been encountered at the end of expression
‘cloudNodeInfoItem.cloudNodeRole.ifrolebingofsmaster == 1]\u003e’. Can not apply operator ‘==’ to operands of type ‘System.String’ and ‘System.Int32’.”},“Message”:“Error while build report”}}
Thank you for reply!
Sorry, it’s my fault.I have a template syntax err.Now finished!
But now I find another problem:
The JSON field name “MysqlVersion”,its value is “5.7.32”,but when I finish build the word report,the value is:5/7/1932 12:00:00 AM image.png (2.3 KB)
The reason for the behavior is automatic format date recognition of Aspose LINQ engine. You may split the version into different components as following and join them in the template. Hopefully, it will help you to accomplish the task.
In addition to above workaround. We have logged a ticket WORDSCLOUD-1693 in our issue tracking system to enable/disable the automatic format recognition feature. We will keep you updated about the issue resolution progress.
We have completed the issue analysis and now working to implement some load options as a fix. We will update you as soon as the issue is resolved and gets available in Aspose.Words Cloud.
We have completed the issue investigation and now it is in the planning phase for the resolution. Hopefully, If everything works as per plan then we will include the fix in the October 2021 release.
We have introduced ExactDateTimeParseFormats property in JsonLoadOptions , XmlLoadOptions and CsvLoadOptions for BuildReport API method. So now to accomplish your above requirement you can specify the ExactDateTimeParseFormats for redefine all datetime formats excluding “dd.mm.yy”.Report_output.docx (9.3 KB)
var requestReportEngineSettings = new ReportEngineSettings()
{
DataSourceType = ReportEngineSettings.DataSourceTypeEnum.Json,
ReportBuildOptions = new List<ReportBuildOptions>()
{
ReportBuildOptions.AllowMissingMembers,
},
JsonDataLoadOptions = new JsonDataLoadOptions() // <= new field for specify load options for JSON data
{
ExactDateTimeParseFormats = new List<string>()
{
"dd.mm.yy"
}
}
};
var request = new BuildReportRequest(
name: "ReportTemplate_version.docx",
data: File.ReadAllText("ReportData_version.json"),
reportEngineSettings: requestReportEngineSettings
);
wordsApi.BuildReport(request);
I would like to try using Aspose.Words Version: 21.10.0 in golang.
However, an error was reported while generating the Word report.
What went wrong?
(Attached is my code,thanks!) build_word.zip (19.0 KB)
@Lifa
Please update your Config.json file as follows. As we have changed the parameters order and name as well in the recent past. It will resolve the issue.
In addition.
When I was using the Golang SDK, I found that there was a method missing in the code, which made it impossible for me to use it properly.
The code works fine after I supplement it.
I have submitted the problem on Github, please check.
The issues you have found earlier (filed as WORDSCLOUD-1693) have been fixed in this update. This message was posted using Bugs notification tool by Ivanov_John