Parameter values not showing up when pushing data to a Crystal report

Posted on 2011-10-12
Last Modified: 2012-05-12
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);
Please let me know what I am doing wrong.
Question by:gopaltayde
    LVL 22

    Expert Comment

    LVL 100

    Accepted Solution

    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.

    LVL 7

    Author Comment

    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?
    LVL 22

    Assisted Solution

    LVL 7

    Author Comment

    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.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now