Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
CrystalReport1 cr=new CrystalReport1();
            cr.SetParameterValue("name",textBox1.Text);
            crystalReportViewer1.ReportSource = cr;
            crystalReportViewer1.RefreshReport();


In Report i passed value through parameter which takes value from textbox. But there is a parameter box is opened for taking that value again which i have already passed. I have to stop that prompting parameter box, please give me solution.
Posted
Updated 30-Jan-12 20:12pm
v2
Comments
Rajesh Anuhya 31-Jan-12 2:13am    
Code tags added
--RA

1 solution

This is not the case with crystal report.
It could only happen when you wrongly spell the parameter name.

I think "name" is not correct parameter name in crystal report.

Please check again or try like

C#
CrystalReport1 cr=new CrystalReport1();
            cr.SetParameterValue("name1",textBox1.Text);
            crystalReportViewer1.ReportSource = cr;
            crystalReportViewer1.RefreshReport();
 
Share this answer
 
Comments
roxyraj 31-Jan-12 5:39am    
I have tried it but the same problem occurs.
RDBurmon 31-Jan-12 6:29am    
Try this

CrystalReport1 cr=new CrystalReport1();
cr.SetParameterValue("name",textBox1.Text);
crystalReportViewer1.ReportSource = cr;

It works for me
roxyraj 1-Feb-12 1:06am    
There is a problem of prompting box that ask for value for the required field. I hope i am trying in the wrong method of parametrized crystal report. pls give appropriate method how to make a prarametrized crystal report in 2010.
RDBurmon 1-Feb-12 1:31am    
No roxyraj, You are using correct way to parameterized the crystal report. But I would suggest you not to use " crystalReportViewer1.RefreshReport();" Just make call without refresh method. The same way I given you in my previous replay . Again Do not use "refresh" method of crystal report that is the root cause actually.
RDBurmon 1-Feb-12 1:31am    
Please accept and vote it that helps
--Rahul D.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900