Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hold variable value from CR session to the next

Status
Not open for further replies.

suecobb

Programmer
Sep 18, 2001
32
US
Is it possible to hold a variable's value from one session of Crystal Reports to the next. I need to create a report that lists the most recent additions to a file (daily). The "added date" is not an option as there is no field in the database to capture that information. The "holderid" field is autogenerated and increments by one each time a new shareholder is added. Is there a way to store the max value of that field for use the next time the report is run? So if today's report ran for holderid 100 to 108, tomorrow's report would start with holderid > 108. Or is there a way to export that value to a text file, and retrieve it the next time? I am using CR 8.0. Thanks!
 
The simplest and cleanest solution is to add a date/time stamp column to the database.

If you can't do that (may I ask why?), then if you call the Crystal Report from an application (e.g., Visual Basic), you could use the application logic to record the max id value in an INI file, the registry, or the database each time the report is requested.

Cheers,
- Ido ixm7@psu.edu
 
Here is a technique but it could be regarded as a bit strange.

You'll need to write a UFL to save the value and to retrieve a value. It could be in a file, or I've written a UFL to retrieve values from the Registry. It wouldn't be difficult to create a function to store a value in the registry.

On my site is a PPT to demonstrate how to write a UFL and get the names right. Editor of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top