Vb.Net显示MS SQL + Crystal Reports的报告 [英] Vb.Net Displaying report from MS SQL + Crystal Reports

查看:76
本文介绍了Vb.Net显示MS SQL + Crystal Reports的报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hellow Guru,请协助,

我在MS SQL的视图中有以下数据:



TypeID TypeName Amount

1先生10.00

1先生12.50

1先生5.30

2太太10.00

2 12.20夫人

2夫人5.00

2夫人2.60

3女士15.20





我想要显示的Crystal报表是特定类型的金额与TypeID和TypeName的总和。

所以从上面例如我希望数据显示如下:



TypeID TypeName金额

1 Mr 27.80

2 Mrs 29.80

3女士15.20



我有我所有的编码来显示完成的报告,报告按预期显示。我只需要上面的帮助。



提前谢谢

解决方案

一种方法可以解决这个问题是简单地编写SQL以提取所需格式的数据,然后在Crystal Report上显示。



例如:

 选择 TypeID,TypeName,Sum(Amount) as  TotalAmount 
来自 VIEWNAME
group by TypeID,TypeName
order by TypeID,TypeName


Hellow gurus, Please assist,
I have the following data in a view in MS SQL:

TypeID TypeName Amount
1 Mr 10.00
1 Mr 12.50
1 Mr 5.30
2 Mrs 10.00
2 Mrs 12.20
2 Mrs 5.00
2 Mrs 2.60
3 Ms 15.20


What I want to have Crystal reports to display is "The sum of the Amounts for a particular Type together with the TypeID and the TypeName".
So from the above e.g. I want to have the data displayed as follows:

TypeID TypeName Amount
1 Mr 27.80
2 Mrs 29.80
3 Ms 15.20

I have all my codings to display the reports done and the reports are showing as anticipated. I just need assistance on the above.

Thanks in advance

解决方案

One way to go about this is to simply write your SQL to extract the data in the format you want, then display that on your Crystal Report.

eg:

select TypeID, TypeName, Sum(Amount) as TotalAmount 
from VIEWNAME 
group by TypeID, TypeName 
order by TypeID, TypeName


这篇关于Vb.Net显示MS SQL + Crystal Reports的报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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