Hi,
We are using the LINQ Reporting Engine in C# to generate Word documents based on a Word template.
Our parameter AMOUNT in the JSON object can have two values:
A number, for example 7000000
Null
The below shortcode works for an amount like 7000000, but not for null values. <<[AMOUNT / 1000000]:"0.##">>
The error we get is:
Error! Can not apply operator ‘/’ to operands of type ‘System.String’ and ‘System.Int32’.
We tried with the below shortcode to resolve this, but it also doesn’t work. <<[AMOUNT ?? 0 / 1000000]:"0.##">>
Working with if else also doesn’t work. The reporting engine always executes the else clause even if we go into the if.
How can we resolve this? Worst case I need to tackle this on JSON generation side, for example by replacing null with 0 but I am not really a fan of this.
@wfbe Could you please provide your sample template and datasource that will allow us to reoriduce th eproblem? I tested with the following simple data:
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.