This is a migrated thread and some comments may be shown as answers.

Accessing .NET properties of objects in Expressions

1 Answer 70 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Magnus
Top achievements
Rank 1
Iron
Magnus asked on 25 Oct 2016, 10:42 AM

Hello,

I am trying to display the total time span in seconds for a report with two parameters; From (DateTime) and To (DateTime). The subtraction between two DateTime objects is a TimeSpan object, but the following expression fails, claiming that it cannot interpret '.':

=(Parameters.To.Value-Parameters.From.Value).TotalSeconds

 

Is there an alternative syntax I can use, or is this kind of expression just not supported? 

 

Best regards, 

Magnus

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 25 Oct 2016, 11:17 AM
Hi Magnus,

You can use an expression as follows, where variable are of DateTime type:
= Parameters.Parameter2.Value.Subtract(Parameters.Parameter1.Value)

The expression uses the access to Datetime methods, Subtract method in the example.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Magnus
Top achievements
Rank 1
Iron
Answers by
Stef
Telerik team
Share this question
or