ReCrystallize Pro Support Frequently Asked Questions

How to pass parameter values to a Crystal Reports web page on the URL, from a form, or from an existing application.

Not yet using ReCrystallize Pro to enable viewing your Crystal Reports on the web?

Try it - click here to view sample Crystal Reports in your browser now.

Click here for more information and a free trial download.

Synopsis:

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.

Dynamic report web pages created by ReCrystallize Pro can accept parameter values on the as part of the web address / URL (HTTP GET) or from a form (HTTP POST).  Other methods such as a JavaScript window.open command could also be used.  When some or all parameter values are provided in this way, the user need not be prompted before viewing the report.  When using a form, the parameter values may be hidden so that it is more difficult for users to observe the parameter values or run the report using different parameter values.

Directions:

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.")

Param Data

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

http://mywebserver/myreports/booklookup-dynamic.aspx?P1=Shakespeare&P2=Hamlet

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.