Passing parameters to Crystal Solution

I noticed that from time to time the question comes up about how to pass parameters to BAQ/Crystal Reports that are launched from an existing screen. For example if on the sales order entry screen you might want to launch a report that runs against the sales order currently on the screen

Until recently the question was just of passing interest until I had a need for a workable solution. A solution I came up with keys off the fact that each Epicor session has a unique session id. The session id is the same for the main form and the report form you are launching. The creates a bridge of known information between the two since you can't pass anything between them otherwise.

Using the session id as the name of an XML file I pass the values that the report needs via the XML file. The Report form upon launching runs a few lines of embedded custom code to read the XML file and populates the fields in the reportparam table. The report immediately deletes the file after reading to prevent any file conflicts. Since the session id is unique to the session and only one report gets launched at a time file name conflicts are highly unlikely.

This is a summary of what I do, I will post a complete document in the files area later today.

1. Create BAQ/Crystal Report as usual
2. Add options to the report, these will be fields (field1, field2...) in the reportparam table that we need to populate via the XML File.
3. Customize calling program (i.e. Sales Order Entry) to create/populate/save XML file with the needed information for the fields on the option screen.
4. Customize calling program to call BAQ/Crystal Report using the processcaller.launchform command.
5. Add BAQ/Crystal report temporarily to a menu item so you can customize it easily.
6. Customize report's Option Screen to read the file created in step 3 and populate the appropriate fields in reportparam table.
7. Add report to Sub Process and Process Management referring to Report Customization created in Step 6.
8. Test program

I'll post a complete document with code later today.

Hope you find it useful.

Jim Kinneman
Senior Consultant
En>compass Solutions Inc.
Tel 336.298.1296 (Google Voice)
E-mail jimki@...
www.encompass-inc.com