Search code examples
sql-servercrystal-reports-xivisual-foxpro

Dynamically set Crystal Report Viewer parameter default value


We are using the Crystal Report viewer (XI I believe but we can upgrade) with a VFP front end.

Is there some way to dynamically set the parameter default value at run time? For example, If the user is viewing an invoice and they try to run a report, I would like it to automatically default to the current invoice. As it stands right now, they have to type in the invoice number even though they already have the actual invoice already open.

If not, is there a better viewer available that we could use to accomplish this goal?


Solution

  • I currently use VFP with Crystal Reports in Accountmate SQL (AMSQL). AMSQL has its own blackbox code to do what you are asking so I can't give details on how it is done, but I do set parameters dynamicaly (e.g. invoice#) and Crystal generates a report based on the parameters sent.

    I know you can accomplish this in your case by creating a Crystal Reports object in VFP, thereby exposing Crystal properties, events and methods to VFP. Craig Bernston has a good article on what you are looking for at: http://www.craigberntson.com/docs/integratingcr.pdf