如何在Rdlc报告中获取行的值的总和? [英] How to get sum of values of rows in Rdlc reports?

查看:305
本文介绍了如何在Rdlc报告中获取行的值的总和?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要计算值或行的总和。但是有一个问题:我将行的所有值都设置为字符串并使用(00:00:00)格式。如何在rdlc报告中对这种类型的字符串求和?我已将数据显示为如下组:



名称val 
a 12:35:56(这是字符串)
b 345:54:45(这是字符串)
c 65:15:10(这是字符串)
----------------
总计423 :45:51



请任何人帮我。在此先感谢... 

解决方案

您好,

试试这个

如果您的数据是时间格式,那么您需要在Val列的页脚行中添加

 = Sum(Fields!val.Value)


 DateTime to  String  = CStr(Fields!Date.Value)
String 到DateTime = DateTime.Parse(Fields!DateTimeinStringFormat.Value)
String 到DateTimeOffset = DateTimeOffset.Parse(Fields!DateTimeOffsetinStringFormat。价值)
提取年份=年份(字段!TimeinStringFormat.Value)

- 或 -

=年份(字段!TimeinDateTimeFormat.Value)
布尔到Integer = CInt(参数!BooleanField.Value)

-1 True和 0 False。
布尔到Integer = System.Convert.ToInt32(Fields!BooleanFormat.Value)

1 为True且 0 错误。
只是DateTimeOffset的DateTime部分 value = Fields!MyDatetimeOffset.Value.DateTime
只是DateTimeOffset的偏移部分 =字段!MyDatetimeOffset.Value.Offset


I want to make sum of values or rows. But there is one problem: I have all values of rows as string and with (00:00:00) format. How do I make sum of this type of string in rdlc report? I've shown data as group like:


Name   val
a      12:35:56  (This is string)
b     345:54:45  (This is string)
c      65:15:10  (This is string)
----------------
Total 423:45:51


Please any body help me. Thanks in advance...

解决方案

Hello,
Try this
If Your Data comes in Time format then you need to add

=Sum(Fields!val.Value)

in footer row for "Val" column.


DateTime to String	=CStr(Fields!Date.Value)
String to DateTime	=DateTime.Parse(Fields!DateTimeinStringFormat.Value)
String to DateTimeOffset	=DateTimeOffset.Parse(Fields!DateTimeOffsetinStringFormat.Value)
Extracting the Year	=Year(Fields!TimeinStringFormat.Value)

 -- or --

 =Year(Fields!TimeinDateTimeFormat.Value)
Boolean to Integer	=CInt(Parameters!BooleanField.Value)

-1 is True and 0 is False.
Boolean to Integer	=System.Convert.ToInt32(Fields!BooleanFormat.Value)

1 is True and 0 is False.
Just the DateTime part of a DateTimeOffset value	=Fields!MyDatetimeOffset.Value.DateTime
Just the Offset part of a DateTimeOffset value	=Fields!MyDatetimeOffset.Value.Offset


这篇关于如何在Rdlc报告中获取行的值的总和?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆