如何将查询结果显示为Crystal Reopt [英] How to display query result into crystal reopt

查看:76
本文介绍了如何将查询结果显示为Crystal Reopt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用了水晶报表.

In my application I used crystal report.

dim str as new string
str="select table1.*,table2.* from table2 inner join table1 on              table1.id=table2.code where table1.id=1500
Dim mycmd As New SqlCommand
mycmd.Connection = roConform
mycmd.CommandText = StrSQl
mycmd.CommandType = CommandType.Text
Dim myda As New SqlDataAdapter
Dim myds As New DataSet
myda.SelectCommand = mycmd
myda.Fill(myds, "table")
Dim crptReport As New CryFamilyMembers1
crptReport.SetDataSource(myds)
CRViewer.ReportSource = crptR




查询结果正确,但是Crystal报表填充了所有记录.




Query result is correct but crystal report populated all records

推荐答案

您好,

根据我到目前为止使用的内容,当您使用查询将数据发送到数据库时,应该在Crystal报表中命令而不是从数据库中直接定向表.

如果使用的是表,则需要使用RecordSelectionFormula传递条件以过滤Crystal报表中的记录,如下所示.

report.RecordSelectionFormula = [条件]

例如,{table1.ID}> 1和{table1.ID}< 10将显示ID在1到10之间的记录.
希望能回答您的问题.
Hello,

Acc to what i have used upto now, when you are using a query to send data to database, you should Command and not direct tables from database in Crystal reports.

If you are using tables, you need pass the Condition for filtering records in crystal reports using RecordSelectionFormula as below.

report.RecordSelectionFormula = [Conditions]

eg.{table1.ID}>1 and {table1.ID}<10 will display records with ID between 1 and 10.

hope that answers your question.


这篇关于如何将查询结果显示为Crystal Reopt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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