在水晶报告中多次重复相同的数据。 [英] Repeating same data multiple time in crystal report.

查看:59
本文介绍了在水晶报告中多次重复相同的数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在水晶报告上调用数据时,它会重复多次。

我已经尝试了Supress,如果重复的话,



这是我的代码

While calling data on crystal report it repeats multiple times.
I have tried Supress if repeated also,

This is my code

DT.Clear()
       Ds.Clear()

           Da = New OleDbDataAdapter("SELECT distinct(A.AdmissionID),R.SName,R.RollNo,R.ClassName,S.Amount " &
                                     "from ((Admission A " &
                                     "INNER JOIN StudentAccount S ON A.AdmissionID = S.AdmissionID) " &
                                     "INNER JOIN MasterRollNo R ON A.AdmissionID = R.AdmissionID) " &
                                     "where R.ExamName='" & ComboBox1.Text & "' and R.ClassName='" & ComboBox2.Text & "'", Conn)

           Ds = New DataSet
           Da.Fill(Ds)
           Dim PartyLed1 As New rptHallTicketSA1
           PartyLed1.SetDataSource(Ds.Tables(0))
           CrystalReportViewer1.ReportSource = PartyLed1

推荐答案

因为你是这样的,所以说的确切原因是不可能的。只有一个知道数据及其结构的人。



最简单的方法是将查询带入SSMS(或类似的,如果你不使用SQL Server)并运行查询。首先,将SELECT子句中的列名替换为星号,以包含所有列。这有助于您查看每行重复的数据和不同的数据。



最有可能的问题是您的加入条件,也许是从入场到关系的关系StudentAccount是1:N,同样适用于MasterRollNo的入学之间的关系...



作为附注,永远不要将值直接连接到SQL语句。相反,使用参数; OleDbParameter [ ^ 在你的情况下。
It's quite impossible to say the exact reason since you're the only one who knows the data and it's structure.

The easiest thing to do is to take the query into SSMS (or similar if you don't use SQL Server) and run the query. In the beginning, replace the the column names in SELECT clause with an asterisk in order to include all columns. This helps you to see what data is repeated and what is different per each row.

Most likely, the problem is in your join conditions, perhaps the relation from Admission to StudentAccount is 1:N and the same applies to the relation between Admission to MasterRollNo...

As a side-note, never concatenate values directly to SQL statements. Instead, use parameters; OleDbParameter[^] in your case.


这篇关于在水晶报告中多次重复相同的数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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