gopaltayde
asked on
Parameter values not showing up when pushing data to a Crystal report
I am using VS 2010 & Crystal reports for VS 2010. I developed a simple report using a stored proc. The stored proc has two parameters @Year & @Month. I am passing the parameters to crystal as below
crRptDoc.SetParameterValue ("@Year", 2011);
crRptDoc.SetParameterValue ("@Month", 5);
This works fine in pull method. The report is displayed correctly.
But if I tried to push the data using crRptDoc.SetDataSource(ds. Tables[0]) ; then the parameters doesn't display on the report, even though they are set in the code -
crRptDoc.SetParameterValue ("@Year", 2011);
crRptDoc.SetParameterValue ("@Month", 5);
crRptDoc.SetDataSource(ds. Tables[0]) ;
Please let me know what I am doing wrong.
crRptDoc.SetParameterValue
crRptDoc.SetParameterValue
This works fine in pull method. The report is displayed correctly.
But if I tried to push the data using crRptDoc.SetDataSource(ds.
crRptDoc.SetParameterValue
crRptDoc.SetParameterValue
crRptDoc.SetDataSource(ds.
Please let me know what I am doing wrong.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi mlmcc, I agree with you that when we use the push method, the stored procedure isn't run.
But I wanted to display the Month & Year at the top of the report, which are passed by the user.
As you said, normal crystal parameters are working.
So I guess, I need to create 2 parameters for year and month respectively and pass the values to them.
Any other solutions?
But I wanted to display the Month & Year at the top of the report, which are passed by the user.
As you said, normal crystal parameters are working.
So I guess, I need to create 2 parameters for year and month respectively and pass the values to them.
Any other solutions?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Mroonal,
The 1st link provided by you doesn't have the accepted solution.
The 3rd link has a solution but not the complete one. It will pass the parameter value to crystal's parameter and not to the stored proc's parameter.
In short from my question I will have to modify the code as shown below -
crRptDoc.SetParameterValue ("crYear", 2011);
crRptDoc.SetParameterValue ("crMonth" , 5);
Where crYear & crMonth are the crystal;s parameter and not the stored proc's.
The 1st link provided by you doesn't have the accepted solution.
The 3rd link has a solution but not the complete one. It will pass the parameter value to crystal's parameter and not to the stored proc's parameter.
In short from my question I will have to modify the code as shown below -
crRptDoc.SetParameterValue
crRptDoc.SetParameterValue
Where crYear & crMonth are the crystal;s parameter and not the stored proc's.
I don't know much about crystal reports. But have you checked these links:
http://www.codeproject.com/kb/aspnet/crystal_report.aspx?display=Mobile&fid=14950&df=90&mpp=10&noise=3&prof=True&sort=Position&view=Quick&fr=41
http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx
Hope this helps you.