Crystal报表运行总计显示行数而不是总和 [英] Crystal report running total shows row count instead of sum
本文介绍了Crystal报表运行总计显示行数而不是总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是水晶报告的新手.
我有一个具有运行总计字段的水晶报表.
字段数据类型在数据集中为int32,并且在数据集中具有整数值.
我已将该字段的运行总值添加为总和,但它仅显示报告中的记录数(记录数).
如何获得总和而不是计数?
谢谢.
Hi,
I''m new to crystal reports.
I have a crystal report having a running total field.
The field data type is int32 in the dataset and have the integer values in the data set.
I have added the running total value of the field as sum, but it only displays the number of records in the report (count of records).
How can I get the sum instead of count?
Thanks.
推荐答案
看看这篇非常好的文章: ^ ]
要么是运行摘要,要么是汇总摘要.看哪一个适合您并实施它.
对于分组,文章中已经有.有关运行摘要:
1.右键单击报告,然后单击插入->摘要
2.选择要累加的字段
如果太复杂,请使用公式字段.
Have a look at this very good article: Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]
Either, it would be a running summary or a grouped one. Look which one fits in for you and implement it.
For grouping, it''s already there in article. For running summary:
1. right click on report click Insert->Summary
2. select the field you want to sum
If it''s too complex, use formula fields.
嗨
因为您有一个从(decimal,int)到string
的类型转换,代替了代码 您必须找到解决之道
像这样的东西(在此示例中,默认数据类型为字符串)
hi
because in place of your code, you have a type casting from (decimal,int) to string
you must find that an solve it
Something like this (in this sample default datatype is string)
dt = new DataTable("TBL");
dt.Columns.Add("comment");
dt.Columns.Add("num1");
dt.Columns[1].DataType = typeof(Int32);
dt.Columns.Add("num2");
dt.Columns[2].DataType = typeof(float);
这篇关于Crystal报表运行总计显示行数而不是总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文