如何在vb.net中显示水晶报表上的列数 [英] how to show count of the column on the crystal report in vb.net
本文介绍了如何在vb.net中显示水晶报表上的列数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个代码
i have this code
RptSurname.Show()
Dim qry As String = "SELECT Count([LastName]) AS surname,lastname FROM Voter group by (lastname)"
Dim da As New OleDbDataAdapter(qry, My.Settings.trialConnectionString)
Dim ds As New trialDataSet
da.Fill(ds, "voter")
Dim rpt As New RptSurane
rpt.SetDataSource(ds)
RptSurname.CrystalReportViewer1.ReportSource = rpt
赞
like
count of lastname lastname
10 Kumbhar
21 Patil
i想要显示报告中的计数和姓氏
请帮帮我
提前感谢
。
i want show the count and lastname in report is possible
please help me
thanks in advance
.
推荐答案
在SQL中进行分组时,列的顺序很重要。即使您的报告要显示它,您也希望计数持续。
试试这个:
SELECT lastname,Count(*)AS姓氏FROM Voter GROUP BY姓氏
When you do groupings in SQL, the order of the columns is important. You want the count last even if your report is going to display it fist.
Try this:
SELECT lastname, Count(*) AS surname FROM Voter GROUP BY lastname
这篇关于如何在vb.net中显示水晶报表上的列数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文