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

Automatically add username

Status
Not open for further replies.

kwirky

MIS
Apr 22, 2010
85
AU
Hi,
Is there any way to create a field etc to allow the name of the user who printed the document to show?

For instance
Report Printed by: {@username}

We create the reports through CR 2008 and they are run by end users on terminals (they log into the terminals using AD) through an MIS. We need the name to come up automatically, not to be a parameter or anything like that.

Thanks in advance.
 
You can use UFL library. This one exposes LoginName: It is free. You can also write your own UFL library. Check this link how to do it:Of course you can use viewer that can detect and pass the username as parameter. UFL will be easier and cheaper to implement, but if you already use report viewer check if it supports this functionality.

Viewer, scheduler and manager for Crystal reports.
Send your report everywhere.
 

Depending on your backend database, you might be able to use a SQL Expression. For SQL Server it would just be:

suser_name()

Oracle is osuser and other db's have similar functions.

 
Thank you.

I tried the SQL expression and it worked beautifully :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top