Last post Jun 16, 2012 09:12 AM by tunafish12
May 15, 2012 08:15 AM|tunafish12|LINK
I'm developing a web app in ASP.NET 4.0 using VS2010 and in C#.
I'm currently using CrystalReportViewer that has 2 parameters in the report. When the report is loaded, a user is expected to enter values and click an ok button. Again, the inputs are coming directly from the report itself and not a webcontrol. I can display
the report fine, just don't know how to pass the 2 parameters to the report itself. Does someone have a basic sample code that shows how this is done?
I really appreciate it!!!
May 15, 2012 08:45 AM|shree_ars|LINK
Actually you need to pass parameter to report from webpage. am i right?
R u calling the report from the codeing by creating the report instance . right.
If its yes, there is option for CreateParameter() for the report. Try it .
May 15, 2012 09:03 AM|tunafish12|LINK
Thank you for responding. Yes, I need to pass the parameter to the report from the webpage. Here are my codes (with line numbers) that actually brings up the report. I think my confusion is how do I get the values that are entered by a user where the input
parameter that comes from the CrystalReport itself. Looking at my codes, is there a property in CrystalReportViewer class I can retrieve, then, pass it to perhaps CreateParameter like yuo suggested?
May 15, 2012 09:08 AM|tunafish12|LINK
BTW, here is my test codes (in the Page_Load section) to pass the parameter values. I'm hardcoding it for now just to see if this will work. If it does work, like I said, I need to pass the actual values taken from the CrystalReport textbox.
May 15, 2012 09:36 AM|tunafish12|LINK
Problem SOLVED!!! My example did work. However, the person who created these reports was able to configure the parameters which allows the report to retrieve the parameters. Thanks for helping out.
May 15, 2012 04:02 PM|sriramabi|LINK
try this way
May 16, 2012 01:30 AM|shree_ars|LINK
Gud. You need to create parameter variable under report, so those paameter will capture the passed values and used across your report.
May 16, 2012 03:01 AM|amit.jain|LINK
Hi first you need to set parameter field in during design of report
then you can pass it as follows
refer http://csharpdotnetfreak.blogspot.com/2011/09/pass-crystalreport-parameters.html for more info
Jun 16, 2012 09:12 AM|tunafish12|LINK
Thank you all.... I have it working!