Aspose.Words Cloud LINQ report engine is rendering version string data as date

When I use a template to generate word, I get two errors :(I’m sure my template is ok)

  1. The JSON field contains Chinese characters
  2. 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”}}

Can this be repaired?

@Lifa

Please share a sample template along with the data. It will help us to replicate your issue and address it.

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)

How can I use the template syntax

@Lifa

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.

JSON data:

...
"MysqlVersion": {
      "Major": 5,
      "Minor": 3,
      "Build": 2
    },
...

Word Template field:

...
,SQLVersion: <<[MysqlVersion.Major]>>.<<[ MysqlVersion.Minor]>>.<<[ MysqlVersion.Build]>>,
...

@Lifa

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.

oh…It’s too much work to change the json structure.
Hope to support turning off automatic formatting,Thanks!

1 Like

Hi,tilal.
How is ticket WORDSCLOUD-1693 going? :smiley:

@Lifa

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.

Our business is looking forward to this feature. :sob:
How is ticket WORDSCLOUD-1693 going?

@Lifa

I am afraid the issue is still not resolved. I have requested the ETA and will update you asap.

How is ticket WORDSCLOUD-1693 going? :sob:

@Lifa

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.

Hi,I notice that the WordsCloud-1693 problem has been closed.
Is there a way to display the version filed now?

@Lifa

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.

Config.json file:

{
	"ClientId": "your client id",
	"ClientSecret": "your client secret",
	"BaseUrl": "https://api.aspose.cloud"
}  

thanks!It works.

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.

I’m sorry. It was my mistake.

@Lifa

Thanks for your feedback. And it is good to know that your above issues are resolved after following the suggestions.

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