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!

Permission Question 1

Status
Not open for further replies.

edwindow

Programmer
Jul 13, 2001
51
0
0
US
I want to make a parameter that shows data based on permission tables I have. Based on permissions I want to populate my parameter field with data that is based on the user that is running the report. The permissions are composed of many tables and fields. Has anyone tried to do something like this. I was thinking of creating a view but the parameter field comes up before it even looks at the report. If anyone has ideas around this please tell me!!

I want to do this straight from Crystal.

EX. Department Owner, in the parameter box I want to display only the departments he/she owns.

Eddie
 
GREAT question.

I had something somewhat similar about 2 years ago that the client scapped in favor of 2 separate reports. We started to write a report that required cost info to be suppressed if the user was not a supervisor. I could read the table of users and determine which ones were considered supervisors, but I could not make sure that the person running the report and answering the "user" paramter field was, in reality, who they claimed to be. I also could not link the users table to the data I was trying to extract. Thats when the client scrapped the idea and went with 2 reports. I have never gone down this road since.

My thinking at the time was to write a subreport for the unlinkable users table, prompt for user name and password, and if the password parameter answer did not match the password in the users file, put code in the record selection formula to select zero records. If it did match the report would go ahead and execute.

Then I thought I would conditionally format field objects (the aforementioned cost info) to suppress if the user was not a supervisor. As I said I never got far down this road. But maybe its some food for thought on how to approach this. Software Support for Sage Mas90, Macola, Crystal Reports and Goldmine
Cell/VM: 714-348-0964
 
Well I do have an ID that I can pick up to compare against the database. I can get the id from the database but after that I need to populate the paremeter. How did you populate the paremeter once the person put in the password/login id? Was that login in a the main report and then it went to a subreport. I guess I don't understand if you can get the user id information then how can the parameter in the subreport be populated based on the selection from the main report. I hope that makes sense.
 
Edwindow,

Well, if you read my post closely, I never finished the project....it got axed by the client. I just threw out the road I was going down as food for thought. Software Support for Sage Mas90, Macola, Crystal Reports and Goldmine
Cell/VM: 714-348-0964
 
If you are running your reports on NT, you could try taking the login username of the user on the PC and assuming match that against your table of users.

You can get the NT username by using a UFL function.

If you want, I could post the appropriate code.
 
ScottWebb-

I would love that code for the UFL. Do you have an equivalent for Novell? Perhaps better yet something that can do an if-then-else logic on server types Novell and NT? Software Support for Sage Mas90, Macola, Crystal Reports and Goldmine
Cell/VM: 714-348-0964
 
edwindow,

I am not sure if you got the answer, but if you are staying within CR there is no way for the contents of the parameter drop down to dynamically change. Unfortunately, the parameter list is static.

That can only be done within a front end application. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Edwindow/dgillz,

I've just created a faq and added the code to it.

faq149-1283

dgillz - From what I understand if you've set your Primary Network Logon to Novell this function will return the Novell username otherwise the NT username
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top