Skip to Content
0
Jan 26, 2016 at 03:10 PM

Passing a parameter to Crystal Report in Visual Studio

46 Views

I have a crystal report that I created outside of visual studio that I'm now trying to integrate into visual studio.

I added a new item to my project, and I chose a crystal report. I then selected the report to be an existing one.

That created an item called CrystalReport1.rpt to my project.

I then created a window form(frmview.cs) and added a CrystalReportViewer control and set it up so it uses my crystal report

The report works just fine, but I don't know how to pass a parameter to the report. The parameter is received utilizing a 3rd parties API and is in a class I created called SupplierContactInfo.cs.

Inside this class I can open the windows form that has the report using the following code:

But I don't know how to take the value in the string parameter SupplierID and pass it to the crystal report that's in my FrmViewer window form.

Any help would be greatly appreciated.