Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在RDLC中达到HH:MM:SS的总时间_C#_C# 4.0_Rdlc - Fatal编程技术网

C# 在RDLC中达到HH:MM:SS的总时间

C# 在RDLC中达到HH:MM:SS的总时间,c#,c#-4.0,rdlc,C#,C# 4.0,Rdlc,这是我现在掌握的密码。这段代码使用表达式计算rdlc中的总时间 System.TimeSpan.FromTicks(Sum(system.TimeSpan.Parse(Fields!Number_of_Hours.Value))) 此代码显示天、小时和分钟 我想看到的是这个 113:37:00 我怎样才能做到呢?可能吗?不幸的是TimeSpan不支持这种格式(输出总小时数),因此您必须手动执行: TimeSpan ts = new TimeSpan(113, 37, 0); string s

这是我现在掌握的密码。这段代码使用表达式计算rdlc中的总时间

 System.TimeSpan.FromTicks(Sum(system.TimeSpan.Parse(Fields!Number_of_Hours.Value)))
此代码显示天、小时和分钟

我想看到的是这个

113:37:00


我怎样才能做到呢?可能吗?

不幸的是
TimeSpan
不支持这种格式(输出总小时数),因此您必须手动执行:

TimeSpan ts = new TimeSpan(113, 37, 0);
string s = string.Format(@"{0}:{1:mm\:ss}", (int)ts.TotalHours, ts);

尝试此操作,您必须在报告中添加此表达式
=TimeSpan.FromTicks(Sum(TimeSpan.Parse(Fields!DurationTime.Value))

@20131620我不知道RDLC,但我认为您必须执行类似于
((Int32)System.TimeSpan.FromTicks(Sum(System.TimeSpan.Parse(Fields!Number of_Hours.Value)).ToString()&“&System.TimeSpan.FromTicks(Sum(System.TimeSpan.Parse))的操作(字段!小时数.值)).ToString(“mm\:ss”)