FastReport .NET Designer: Parameter with type DateTime, how to set the value?

I'm trying to create a report with FastReport .NET Designer (Version 2021.2.8 Demo) with two DateTime parameters (date range for the data).

I create the parameter, set its type to DateTime and then, how do I set a value in the Expression field? I tried: 1/1/2021, 1.1.2021, 20210101, 2021/01/01. But when I then preview the report, an error occurs: "a call target caused an exception" (in German: Ein Aufrufziel hat einen Ausnahmefehler verursacht).

How do I have to enter a date value, and how do I enter one with a time also? Thanks a lot.

Comments

  • Hello!

    Set the default value in the Expression field using one of the following C# methods:

    new DateTime(2021, 1, 1) (a universal option that is independent of regional settings!)

    or DateTime.Parse(‘2021-01-01’)

    or DateTime.Today / DateTime.Now.AddDays(-7)

    (If the report script is written in VB.NET, use #2021-01-01# or New DateTime(2021, 1, 1).)

This discussion has been closed.