读书人

使用report builder 怎么制表中的特殊

发布时间: 2012-12-15 15:16:03 作者: rapoo

请求帮助使用report builder 如何制表中的特殊合计数?
report builder初学者,要建如下表,请问表中最下方正/负金额的合计如何做?看参考书上,只是简单的汇总列,与此例不同。请求高手帮助,谢谢!

编号 地点 金额

0301 13273 -1000
0303 13273 600
0306 13273 3000
0102 3606 -500
0304 3606 400
0108 3671 -1500
0309 3671 200
0103 4562 800
0105 4562 -500

正金额合计: -3500
负金额合计: 5000
[解决办法]
把表达式改下就行了。

正金额: =Sum(IIf(Fields!Price.Value>0,Fields!Price.Value,0))

负金额: =Sum(IIf(Fields!Price.Value<0,Fields!Price.Value,0))
[解决办法]

引用:
把表达式改下就行了。

正金额: =Sum(IIf(Fields!Price.Value>0,Fields!Price.Value,0))

负金额: =Sum(IIf(Fields!Price.Value<0,Fields!Price.Value,0))

楼上正解
[解决办法]
还有一种方法,就是计算好,这些你想要的数据,以参数方式传递到报表里面,绑定显示。

r_f.rptv.LocalReport.SetParameters(
new ReportParameter[]
{
new ReportParameter("price", price.ToString())//写你需要的值
});

读书人网 >.NET

热点推荐