Skip to Content
author's profile photo Former Member
Former Member

VS2010 with Crystal Reports : Ignoring Parameter Input Box


I want to be able to bypass any parameters in a report so they do not interfere with a selection formula I pass programmatically by either bypassing the paramater prompt window (I assume the 3 dots ... would be in the parameter causing them to be ignored) or to pass the parameters an "ALL RECORDS" value so again they do not interfere. My parameters are set to Optional.

For instance I have 2 parameters in a report that I wish to keep but I also want to bypass them with my app. I have seen the SAP video where the hasvalue function is used for REPORT, SELECTION FORMULAS which utilises the code below. No matter what I do, the parameter input box comes up. How do i surpress it please? Thanks.

if hasvalue({?Param1}) then

{AuditUtility.ProdCode} = {?Param1}


true and

if hasvalue({?Param2}) then

{AuditUtility.PalletID} = {?Param2}



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2011 at 06:41 AM

    Hello Paul,

    The Crystal engine will prompt for parameters as it needs more information to complete the report processing.

    You can use the following piece of code to pass parameters to the report, from your app:

    ReportDocumentObject.SetParameterValues("Name of the parameter", "Value");

    Also, you might want to ensure that you have kept the allow null value option, for the parameter, as true.

    Hope that helps.

    Thank You.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member


      Yes, I have found the ReportDocumentObject.SetParameterValues("Name of the parameter", "Value");

      I can pass parameter values but I actually want to ignore them completely through my app and keep my passed selection formula untouched. So is there a value that can be passed that is a null or represents ALL RECORDS. For instance, when you are asked for parameter values, you can choose "..." and it acts as all records. Or how do I pass NULL to the parameters if that will show all my records?

      I have not seen an "allow null value option" unless it's the same as "OPTIONAL PROMPT" which doesn't seem to help if it's YES or NO?



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.