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

Crosstable timeformat

3 Answers 104 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Stijn
Top achievements
Rank 1
Stijn asked on 03 Aug 2012, 12:23 PM
I created a crosstable
Rows contains the projects
columns contains persons.
In the value fields i would like the sum of total spend time
At this the total it is returned like 1.04:00:00 (so 1 day and 4hrs)
however i want it in hours only, in this case 28:00:00
Tried to change it by setting the format on the field, but it doesn't work
any suggestions?

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 08 Aug 2012, 09:01 AM
Hi Stijn,

You can use the following expression to display the TimeSpan data in the required format:

=Fields.TimeSpanField.TotalHours.ToString("N0") + Fields.TimeSpanField.ToString("\:mm\:ss")

Kind regards,
Peter
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Olivier
Top achievements
Rank 1
answered on 08 Apr 2014, 02:33 PM
I have the same question in a table.

I have a column to calculate the spend time
and i want to do a sum on a raw group of the spend time and i have this result "2.02:00:00"

I do your suggestion like

=sum (Fields.TimeSpanField.TotalHours.ToString("N0") + Fields.TimeSpanField.ToString("\:mm\:ss"))

But in the result i have all the raw ( 2:00:00 2:00:00 2:00:00) instead of 6:00:00 for example.
0
Nasko
Telerik team
answered on 11 Apr 2014, 01:47 PM
Hello Olivier,

You are passing a string to the Sum aggregate function. This will result in a concatenation of the strings, which were passed to the aggregate function. To avoid this, either pass the correct type of data to the aggregate function, or create your own custom aggregate function which will handle the data as you desire.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Report Designer (standalone)
Asked by
Stijn
Top achievements
Rank 1
Answers by
Peter
Telerik team
Olivier
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or