How to pass parameter values to a Crystal Reports web page on the URL, from a form, or from an existing application.
Article ID: 0024
Date Created: March 31, 2014
Last Modified: March 31, 2014
Applies to: ReCrystallize Pro Web Wizard for Crystal Reports
When viewing a Crystal Report in a web browser, it can often be convenient to pass parameter values directly to the report rather than prompting the user to select or enter the parameter values. For example, a report can be called from an existing web application where the user or the application itself has already determined the parameter values that should be used to run the Crystal Report; in that case, prompting the user to select values again would be undesirable. Another example would be a web page where the appearance and behavior of the page have been customized; such a page could contain a form — either visible or hidden — that includes the parameter values.
To create the web page to run the Crystal Reports, use the Dynamic option in the ReCrystallize Pro wizard. When the wizard gets to the parameter that you want to pass directly, select the "Prompt the user..." option as shown in the example below. (Do not select "Use the Crystal Reports .NET Viewer to prompt for this value.")
Select the "Prompt the user..." option for other parameters that you wish to pass directly. For any parameters that the user should select, the "Use the Crystal Reports .NET Viewer to prompt for this value" option may be selected.
When you click Finish in the ReCrystallize Pro wizard to create the web pages, an additional parameters web page named parameters.htm, parameters.asp, or parameters.aspx will be created. The parameters page contains an input form that can be used to prompt the user for the values. However, use of the form is not required. You may bypass the form to pass parameter values directly to the dynamic.asp or dynamic.aspx page on the URL or from your own form. Open the parameters page in an editor or view its source code in a browser. Use the form field naming on the parameters page as a guide to determine the field names expected for each parameter value.
The parameters for field names expected by the dynamic page generally follow the pattern P1, P2, P3 and so on for the first, second and third parameters in the report respectively. Parameters that are Date type are an exception as they require month, day, and year values to be passed following the pattern P1M, P1D, P1Y. (Future version of ReCrystallize Pro may replace the P1, P2, P3... pattern with the actual parameter names, so check the parameters page to be certain of the required field names.)
As an example, consider a report named Book Lookup that accepts 2 parameters. The first parameter is the author's last name and the second parameter is the book title. The URL to pass the two parameter values would be similar to
If using a form to POST the values rather than passing them on the URL, the form would contain fields named P1 and P2 with values set to Shakespeare and Hamlet respectively. The form action would be to POST to http://mywebserver/myreports/booklookup-dynamic.aspx.