根据用户取值在水晶报表中进行选择 [英] Selection in crystal report based on value taken from user
问题描述
你好朋友,
我被困在项目中的某个位置,我只想选择并仅在报告中显示该记录,而该记录是我在文本框中使用其主键值形式的用户的.
我想我必须通过参数传递值.如果正确,请告诉我相关步骤.
我设计报告的方式并创建了一种表单,可以在Crystal Report Viewer中显示该报告.我还使用了我在查询中使用适配器填充的数据集.查询就像
Hello friends,
I am stuck at one point in my project where I want to select and show only that record in report for which I have taken its primary key value form user in text box.
I think I have to pass the value through parameter. If am right then please tell me the steps.
What I did I designed report and created one form on which I shown the report in crystal report viewer.Also I used dataset which I filled using adapter with the query.The query was like,
"SELECT s.regno,s.fname,s.lname,s.mname,n.ntpname,c.eduration,c.emarks FROM NTP n,student s,registration r,course c where c.cid = r.cid and s.regno=r.regno and n.ntpregno = s.ntpregno and s.regno=''" & txtRegNo.Text.ToString & "''"
但这向我显示了报告中的所有记录意味着查询行为类似
But it is showing me all the records in report means query behaving like,
"SELECT s.regno,s.fname,s.lname,s.mname,n.ntpname,c.eduration,c.emarks FROM NTP n,student s,registration r,course c where c.cid = r.cid and s.regno=r.regno and n.ntpregno = s.ntpregno"
如果我在datagridview中显示相同的结果,那么它会给出正确的结果,意味着像第一个查询.
请帮忙.
提前致谢..! :)
and if I show same result in datagridview then it gives proper result,means like first query.Am not getting where the problem happening.
Please help.
Thanks in Advance..! :)
推荐答案
您是否在Crystal Report rpt文件上创建了任何组?
如果不是,则在Crystal报表中创建一组主键列.
并将要显示在组部分中的列拖动.
希望对您有所帮助.
have u created any group on crystal report rpt file ?
If not then create a group of your primary key column in crystal report.
And drag the column which you want to display in group section.
I hope this will help you.
这篇关于根据用户取值在水晶报表中进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!