?
Solved

Restrict data to that owned by current user

Posted on 2004-09-14
13
Medium Priority
?
501 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
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

764 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