• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

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.
0
gopaltayde
Asked:
gopaltayde
  • 2
  • 2
2 Solutions
 
mlmccCommented:
WI believe when you use the PUSH method, the stored procedure isn't run.  Try using normal Crystal parameters and passing the values to them.

mlmcc
0
 
gopaltaydeAuthor Commented:
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?
0
 
gopaltaydeAuthor Commented:
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.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now