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

Log File or something? 1

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
0
0
IE

I am using CRXI on SQL Server
We have some reports for data check, each user has to print the report to see the data input errors he/she made and then fix them
My boss wants to know if there is a way to find out when a user printed the report?
Is this possible with CR?
Thank you
 
It is not possible to log Print date & times just with Crystal.

Sorry,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Hi,

Although you wouldn't know if a user has printed the report, you could see when it has been run. If you base the report on a stored procedure, you could write a record to an audit trail each time it is run to produce the report. Something like.
Code:
CREATE PROC sMyReport
AS

--Add record to audit trail
INSERT INTO AuditTrail(ReportName,StartTime) VALUES('MyReport',GETDATE())

--Return some data to Crystal
SELECT
   col1
  ,col2
  ,col3
FROM
 MyTable

Of course there are more elegant ways to write the SP, but the theory is there.

You can then create another report from your audit trail to show your boss when the report is being run.

As I said, it does not work for printing, but it gets you part way there.

Cheers

mrees
 
Thank you
I don't know what is an audit trail. can you give me more details, please?
I really have no idea how to do this
 
An audit trail is just really a list of information that you think is necessary to be recorded.

In your case you wanted to know when your report was printed. The suggestion I gave was to record each time the report was run, by adding a new record to your list (The audit trail)

It may be worth looking at how to create Stored Procedures in HELP on SQL Server. You could then look at how to create your report in Crystal based on the SP using Crystals HELP file.

mrees
 
If all you need is to know when the report was run (not when it was printed), then another option is to use one of the UFLs listed at: to append text to a text file (your log file). You would simply need to place a formula (calling the function provided by the UFL for writing to a text file) in the report header or footer.

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top