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!

Can Crystal v11 and/or 2008 evaluate a real-time user ID?

Status
Not open for further replies.

N22S

Instructor
Jun 3, 2002
12
0
0
US
Can 11 and/or 2008 evaluate a user's data access user ID online, real time? While using either Crystal version to access a SQL based database can the user ID used to access the data be reflected within a report? I'm not looking for IDs that are stored historically within the database. This is not so much for security within the report but more to perform sorting and grouping based upon that ID. I know various report distribution tools can, more or less, do what I want. I'm more interested in the capabilities of the off the shelf Crystal stand-alone versions mentioned above.
 
Hi,
AFAIK, CR, by itself, cannot use a user ID to organize or filter the data returned from the database since CR does not use a login with a username to run. BOE XI ( the enterprise version for published reports) can use a special variable called CurrentCEUser to do that since a user must login to the BOE system to run reports.

You could however, based on the database login information, create separate views of the data including limiting which records are returned but sorting and grouping would still be affected by the user once the data was returned.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 

You could create a command object to return the current username.

In SQL Server it would be:

select system_user

In Oracle

select user from dual

Subject to version differences.
 
If there is one user (and there would be), there would be no need to sort or group by it that I can see.

In addition to the command, you could try creating a SQL expression--for some datasources there is a function current_user (Oracle). Theoretically, if you have fields in the database that capture User ID to identify the person entering the data or providing the service, etc., then you could potentially filter based on the current_user field set to that data field in the selection formula.

-LB
 
It took me long enough but thanks all for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top