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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing data from a report

Status
Not open for further replies.

wonderlander

Instructor
Oct 19, 2001
8
GB
I have a report that needs to select all the records that have been changed since the last time the report was run.

Is there anyway I can store this parameter in a file or database for selection on?

Database I am running this report against is access and I have access to Crystal version 8.5, 9 and 10

Many thanks!
 
The more I think about this the less likely I think it can be done.

The report I am trying to recreate is an access based one which prompts the user whether the print has been sucessful and if it has it updates the current date and time into a database.

Can someone just confirm that I can't do this?!
 
Just thinking aloud here...

In Access you could get your DB to create a copy of the records and attach that to a trigger or macro.

Then code a formula which will run a comparison on the "live" records and the copy.

Your live data will obviously have changed and your copy should remain as it was when the trigger was last activated.

That would be my approach, it will take one of the coding gurus in these forums to make it a reality!



Lido
Development & Reporting
UK
 
The thing I have learnt with software is that it is always possible. The question should not so much be "can I do this?" (Answer=Yes). Ask instead "How do I do this?"

Several possible solutions:
Assumption: A Field in the DB to show when the report was run (Run Date). NULL to show it hasn't been run on a report, and with the date/time when it was run.

1) Use a Stored procedure or SQL command inside CR9/10 to update a "Run Date" field, then select those records and process them on the report.

2) Use a UFL to directly update the records as they are being viewed. You would need to write some custom VB code for this but it would work.

3) Use a UFL like my disk UFL to write some SQL update statements to the disk while the report is processing. Then use an automated script to run and then delete the SQL in the disk file you've created.

Editor and Publisher of Crystal Clear
 
Dear Wonderlander,

I just wanted to add to Chelseatech's excellent post, that if you have to use 8.5, you could base your report on a stored procedure which would first update a database field with the run date time and then select the records to return for the report.

I have successfully used this logic with reports against SQL Server 2000 when a client required the "Batch Run Date" on the report to be populated when a report was run.

In my case, I created a table specifically for holding the print date time and the user who ran the report. The only negative is since the report is based on the Stored Procedure, each time the report is Refreshed, the field is updated. Also, I had no guarantee that the report was actually printed, only that it was run.

Regards,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top