?
Solved

Restrict data to that owned by current user

Posted on 2004-09-14
13
Medium Priority
?
507 Views
Last Modified: 2008-01-09
I'm designing a report to be used with Counterpoint SQL, which uses a Crystal viewer.  It is a commission report, so while there are 30 reps and I have added a parameter to allow the user to select which rep they want to report on, there is nothing stopping a rep from choosing a different rep in the parameter field and seeing their commissions.  I am looking for a way to restrict the data returned by the report to that which is owned by the current user.  Ideally, I would be able to create a formula or parameter called UserID that would be populated by the current user id.  Then, I would be able to add a report restriction like DataRecord.Owner = UserID.  But I don't know how to capture the current user.  Any ideas?
0
Comment
Question by:sanw2020
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
13 Comments
 
LVL 23

Expert Comment

by:Ido Millet
ID: 12056144
Are you the developer of the viewer?  If so, just grab the user id from Windows and assign it to a parameter.

In my DataLink Viewer, I do this automatically if the report has a parameter called "DLV_User_ID."  That way the user never gets prompted for that parameter because the value is already set programmatically.

Cheers,
- Ido
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 12056182
Agree with Ido.

Are the reports being run from an application?

mlmcc
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12056211
there is a formula in the special fields tbal in the field explorer

Current userid

You can use that in your select expert and check if the current userid(coming from report) = userid(coming from db) then you show the fields
Regards
Emre
0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 23

Expert Comment

by:Ido Millet
ID: 12056325
Emre,

Can you clarify;  where exactly do you see that special field?

Is it possible you are looking at a formula provided by a User Function Library (UFL)
rather than by Crystal.  

By the way, a UFL is another option to provide the Windows user id to record selection
criteria within Crystal.  I'm aware of at least one 3rd-party UFL that provides a function for
returning the Windows User ID.

Cheers,
- Ido
0
 

Author Comment

by:sanw2020
ID: 12056380
Sorry, I "Accepted" the response from ebolek any my own response went away.  

No, I am not the developer of the viewer.
Yes, it's being run from within Synchronics Counterpoint SQL.  I can also be run outside of it using the Viewer.

I don't see the Special Field called Current User ID.

Sandy
0
 
LVL 28

Expert Comment

by:bdreed35
ID: 12056388
I was just about to post the same question as Ido.

I was looking and I only see Current CE User ID or Current CE User Name in CR 10.  I checked and both of those were not available in CR 9.
0
 

Author Comment

by:sanw2020
ID: 12056477
Ido, can you tell me how to get more information on the 3rd party UFL you are aware of that will return the Windows User ID?  

Sandy
0
 
LVL 23

Expert Comment

by:Ido Millet
ID: 12056497
Sandy,

If you are not the developer of the Viewer and if you need a solution that works with the existing viewer, the simplest solution is to create or purchase a UFL that has a function returning the Windows user_id.  

See list of UFLs under "Other Utilities" at: http://www.kenhamady.com/bookmarks.html
At least two of the UFLs listed there provide a User_ID function.

Cheers,
- Ido
0
 
LVL 10

Accepted Solution

by:
ebolek earned 1000 total points
ID: 12056742
I was talikng about Current CE User ID and  Current CE User Name functions. She can use that in the select expert to get what she wants. However I am using 10 so I dont know she has those functions in the special fields tab.

Regards
Emre
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12248139
Solution offered below should work
Comment from ebolek
Date: 09/14/2004 09:55AM PDT

Regards
Emre
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question