Click here to Skip to main content
15,940,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a crystal report and i run it from vs 2008 c# code

but it always ask me for paramenter

hear is my code

C#
ReportDocument cryRpt = new ReportDocument();
         
            cryRpt.Load(@"\\Server\\a\\ajay setup\\diamondmanager\\report\\11.rpt");
            cryRpt.SetDatabaseLogon("ajay", "1234", "server", "diamondmanager");
       
            cryRpt.SetParameterValue("@kapan1", cmbkapan.Text);
            cryRpt.Refresh();
       
            crystalReportViewer1.ReportSource = cryRpt;
          
            //crystalReportViewer1.Refresh();
Posted
Updated 16-Aug-14 22:09pm
v2

It's because you are Refreshing your report after setting parameter and before binding your report source.So it requires parameters again.Try removing
C#
cryRpt.Refresh();
line from your code.
 
Share this answer
 

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