如何为每个id计算总和 [英] How to make a sum of total for each id

查看:14
本文介绍了如何为每个id计算总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用水晶报表 7

我要查看表1和表2的总和

I want to view the table 1 and sum of table2

表1

id name

001 raja
002 vijay
003 suresh
....

表2

id value

001 100
001 200
001 150
002 200
003 150
003 200
...

我想显示 table1 中的所有行和 table2 中的 sum(values).这个怎么做在水晶报表中

I want to display all the rows from table1 and sum(values) from table2. How to do this in crystal report

预期输出

id name value

001 raja 450
002 vijay 200
003 suresh 350
................
           1000 (sum of value)

注意:我将表格字段直接添加到报表中,我没有在报表中添加存储过程或视图或查询.

Note: I add the table field directly to the report, i am not added store procedure or views or query in the report.

如何做到这一点.

需要水晶报表帮助

推荐答案

试试这个对你有用

1) 在水晶报表中添加一个组,即按名称

1) Add a Group in your crystal report i.e. by Name

2) 添加一个运行总计

2) Add a running total

3) 您的报告将如下所示

3) your report will be as follow

4) 你的输出将是

这篇关于如何为每个id计算总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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