C1FlexReport conversion: "+" for string concatenation

Posted by: wknauf on 20 September 2018, 9:32 am EST

    • Post Options:
    • Link

    Posted 20 September 2018, 9:32 am EST

    Hi C1,

    I noticed an interesting problem when converting C1Report to C1FlexReport.

    Attached is a sample (contains a small MDB file datasource and a C1Report and C1FlexReport file). The sample has a field which should display a string with two date values in the format “dd.MM.yyyy - dd.MM.yyyy”.

    The expression is this:

    Format(Datum1, "dd.MM.yyyy") + " - " + Format(Datum2, "dd.MM.yyyy")
    

    In C1Report this works.

    But C1FlexReport prints a number. I assume this is the subtraction of the two date values ;-).

    It works if I use “&” for string concatenation:

    Format(Datum1, "dd.MM.yyyy") & " - " & Format(Datum2, "dd.MM.yyyy")
    

    Was this change intentional ;-)? If yes it might break old reports.

    Best regards

    Wolfgang

    sample.zip

  • Posted 21 September 2018, 5:51 am EST

    Hello Wolfgang,

    I previewed your reports at my end and found that the C1FlexReport renders as expected, with the “dd.MM.yyyy - dd.MM.yyyy” format. This was checked with 4.0.20182.320 builds.

    Please refer the attached gif showing the scenario observed at my end. Kindly inform if something is missing. Further, share your build version and environment details as well.

    Best Regards,

    Esha

    FlexReport_DateExpression.zip

  • Posted 24 September 2018, 3:50 am EST - Updated 13 August 2025, 11:13 am EST

    Hi Esha,

    I tested it on three machines (Win10 1803 x64, Win10 1803 x32, Win7 Enterprise x64). Same result on all machines.

    Attached is a new sample: I added a new field with this formula:

    Format(Datum1, "dd.MM.yyyy") + "-5"
    

    The result is “19092013”, which is the formatted date 19.09.2018 minus 5 (years):

    Here is a reworked sample, including this new calculated field:

    sample2.zip

    Maybe related to locale settings?

    Best regards

    Wolfgang

  • Posted 24 September 2018, 3:58 am EST

    I can confirm that it must be locale related: I tested it on another machine (Windows 2012R2, english locale), and here it worked as expected. On a german Win2012R2, the same incorrect results as on all other german machines occured.

    Best regards

    Wolfgang

  • Posted 26 September 2018, 1:28 am EST

    Hello Wolfgang,

    Thank you for the details.

    I could observe the issue on a machine with German locale and Win 10 1803 version.

    I have escalated the same to the concerned team [Internal Tracking ID: 344719] and will let you know once I receive an update.

    Best Regards,

    Esha

  • Posted 26 September 2018, 3:48 am EST

    Thanks!

    Wolfgang

  • Posted 27 December 2018, 12:05 pm EST

    In the release notes for .343, I found this:

    Added bool BehaviorOptions.AddOperatorAsInC1Report { get; set; } property. Setting this property to true forces script ADD operator to work as in C1Report, it improves compatibility with C1Report. (TFS:344719)

    Is this related to this issue?

  • Posted 28 December 2018, 1:28 am EST

    Hello Wolfgang,

    Yes, the notes are related to this issue. You can set the AddOperatorAsInC1Report from the report’s properties to resolve the issue.

    Regards,

    Esha

  • Posted 28 December 2018, 5:00 am EST

    Hi Esha,

    so I assume that “+” is no longer the valid operator for string concatenations, but I have to use “&” instead?

    Best regards

    Wolfgang

  • Posted 31 December 2018, 12:22 am EST

    Wolfgang,

    “+” can be used for concatenation in FlexReport on ensuring that you have set the AddOperatorAsInC1Report property to True.

    Let me know in case you face any issue.

    Regards,

    Esha

  • Posted 31 December 2018, 3:55 am EST

    Thanks, I will try to keep this in mind ;-).

    Best regards

    Wolfgang

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels