This article contains details relevant to versions up to 6.5. A future post will explain changes introduced by 7.0.
How does SL communicate the choices you make on the ROI screen to Crystal? By creating record in a table named RPTRuntime. When you click Print or Print Preview in the ROI screen, ROI inserts a record into the RPTRuntime table and stores the values you entered into (or the default values from) the ROI screen.
Here’s a simple example. In the General Ledger module, click the Trial Balance menu option in the Reports section and click the Print Preview button on the ROI screen (just accept all the default values). While the Crystal Print Preview window is still open, run this query on your system database – select * from RptRuntime. You should see at least one record. (If other users in your system are running reports at the same time, you will see more than one record. If there are multiple records, you should be able to find yours by looking for a record that’s UserID field value is the User Id that you’re logged on to SL with and the ReportNbr field value will be 01610.)
Notice that the values in the BegPerPost and EndPerPost fields are the values from the ROI screen. Close the Print Preview window and re-run the query. Notice that the RPTRuntime record is gone. ROI deletes the RPTRuntime record it inserted either when the print job is finished or when the Print Preview window is closed.
Now enter different values for the Beginning and Ending Periods in the ROI screen and click Print Preview again. If you re-run the query, you will see a new RPTRuntime record with the new values you just typed in the BegPerPost and EndPerPost fields.
This is how ROI communicates the SL users selections to Crystal – by storing the values in the RPTRuntime table.
I mentioned earlier that there can be multiple records in RPTRuntime at one time, if multiple users are running reports at the same time. How does Crystal know which record is yours?
The primary key of RptRuntime is an integer field named RI_ID. When ROI inserts a record into RptRuntime, it specifies a unique RI_ID value. It then passes that RI_ID value to Crystal. (Technically, it passes it to CRPEHLPR , but that’s beyond the scope of this post.)
User Function Libraries (UFLs) in Crystal
Crystal Reports includes support for User Function Libraries. This always 3rd party developers that use Crystal (like Microsoft Dynamics) to write new functions that can then be used in formulas in a Crystal Report. Dynamics SL ships with several of these. One of the most-used UFL functions used by Dynamics SL is called RIPARAM. RIPARAM takes 1 parameter – the name of a field in the RptRuntime table.
If you want to use the Beginning Period to Post value specified by a user (like we discussed earlier with the Trial Balance), you could call RIPARAM(“BegPerPost”).