• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 474
  • Last Modified:

CR 2008 Server: Filter Saved Data via current CE User

Hi Guys,

I'd like to re-open this topic. orig thread ling below. I tried what you suggested and no records are being returned. I verified the current CE user by printing it in header.

I placed the following formula in the REPORT-SELECT EXPERT-SAVED DATA

{PR_BACKUP_POLICY.DOMAIN}=CurrentCEUserName

Can anyone help?

http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_27412074.html#a37036710
0
mullykid
Asked:
mullykid
  • 15
  • 8
3 Solutions
 
mullykidAuthor Commented:
ps, I Created a CR Server User, which I then logged in as. Do I need a profile or anything?
0
 
mullykidAuthor Commented:
Ok, this works but not as I want from CMC

1. Created a User
2. Created a profile for that user and added the filter condition
3. Run the report as Administrator
4. Log out
5. Log in as new user created in step 1.
6. Click View Latest Instance. Nothing is displayed, despite the Saved Record condition set in developer above.
7. Click View
8. Report returns filtered content.

Q. Why does step 6 not work?
Q. View hits the database right, so this is not required.

TIA!
0
 
mullykidAuthor Commented:
I think I may have an idea why its not working.

Is Crystal Report Server 2008 compatable with Saved Record Selection?

When you look at the report filter options, Record and Group Selection only exist?

0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
mullykidAuthor Commented:
Can anyone help here? Thanks.
0
 
mullykidAuthor Commented:
Continue here is fine thanks.
0
 
Kurt ReinhardtCommented:
Yes, Crystal Reports Server 2008 is compatible with Saved Record Criteria. That feature was introduced with Crystal Reports 2008, which is a companion product. That being said, starting with the XI 3.1/2008 product line, all install products do have to be the same patch level for guaranteed compatibility.  So, if you have Crystal Reports Server 2008 V1 SP3 then you need to be using Crystal Reports 2008 V1 SP3.

In general, what you're trying to do isn't really what Saved Data Criteria is for.  Saved Data Criteria is intended to be used with interactive parameters. As an example, you may have a report that filters by country in the record selection criteria, but has an optional interactive parameter for region.  The report would return data for the entire country and the user could then filter against specific regions via the parameter panel without having to run the actual database query again.

The proper method for filtering against the logged in CE User in Crystal Reports Server 2008 is to build a report against a Business View you've created that limits data based on filters against the existing users and/or user groups. At a high level, Business Views are essentially SQL queries that allow for both row and column level security.  Building them can be fairly complex, because you need to make sure you've been proactive in designing your logical/functional folder/group permissions (assuming you want to take advantage of the security filters), know how to build a Business View and know how to build a Crystal Report against a Business View.
0
 
mullykidAuthor Commented:
Thanks Rhinok for the SP version heads up.

I understand your point on the architecture, but I guess (for us) using the example case above, the Administrator User will be the country.

Therefore, we will initially generate the report for all regions via the Admin user, and then allow subsequent region 'Saved Data' filtering per non administrator user.

I'll give this a test and report back early next week.

Sorry JustAMod. I won't do that again. Thanks for helping me out.
0
 
mullykidAuthor Commented:
Hi Rhinok.

You mentioned in your reply above that you can filter via user groups. Do you mean Crystal Report Server user groups, and if so, how?

Thanks.
0
 
Kurt ReinhardtCommented:
It's more complicated than that.  You do need to create user groups based on logical and functional access.  For example, only finance department employees can see finance department reports.

You then need to use the Business View manager from your programs list to create a Business View.  This complicated, since a Business View is the result of setting up a structure that includes Data Foundations, Data Connections and Business Elements.  Only after you've set up everything can you apply filters so that specific users/groups can only see specific sets of data.  In general, it's too complicated to simply explain with a forum post like this.  You'd need to either take a class or, at minimum, review documentation.  Here's a link to an excerpt from 'Crystal Reports 2008: The Complete Reference":

http://www.crystalbook.com/crtcr/extras/2008/BusinessViews.pdf
0
 
mullykidAuthor Commented:
Hey,

Ok. I ran the report in CMC for all users (Administrator) to generate the data. This will be scheduled. Then I logged in as another user.

When I click VIEW LATEST INSTANCE, the report gives me ALL customer data with the Saved Data Selection Formula in place.
When I click VIEW the report successfully filters the data.

I need this to work with VIEW LATEST INSTANCE. Am I doing something wrong? Isn't VIEW hitting the Database?

TIA
0
 
Kurt ReinhardtCommented:
Like I said - this isn't how the save data feature is intended to be used and it won't work with View Latest Instance.  Saved data is intended to be used with a parameter after the report has already been run.

So, you run the report for everybody. Let users open the instance--which shows all data--and then use the parameter panel on the left hand side to filter the data further by using a parameter for the user name.
0
 
mullykidAuthor Commented:
Ok. But isn't passing the current user (CurrentCEUserName) as a parameter not the same as just using CurrentCEUserName? Am I missing something, or do I need to do this?
0
 
Kurt ReinhardtCommented:
It's not the same thing.  
0
 
mlmccCommented:
If you don't pass it in as a parameter then when you open the saved report for viewing it just displays the report and doesn't do any updating or further filtering.

mlmcc
0
 
mullykidAuthor Commented:
Thanks. I'll give it a shot.
0
 
mullykidAuthor Commented:
Hey Guys,
Sorry, I am strugglng to understand this.
All I want to do ths is the following.
1. Run/Schedule a report for all users via CMC
2. For current logged in user, when VIEWING LATEST INSTANCE, filter the report content
3. If possible, instead of filtering by user filter by its user group. Is the parent GroupName available?

Can someone list actions to help me do this? I have to have this resolved today.

Thank you!!

0
 
Kurt ReinhardtCommented:
The proper method to achieve what you want is to create and use Business Views.  That's your answer.
0
 
mullykidAuthor Commented:
Ok, if it all possible could I do it the way already suggested.

I added a parameter to the report and used this in my saved selection formula.

I executed the report for all users (administrator parameter passed in) .

So, when I go to VIEW LATEST INSTANCE how do I pass in a parameter to filter as suggested above?
]Thank you!



0
 
mullykidAuthor Commented:
Ok, i see the parameter list. It works when you enter a parameter, i.e. the report content filters.

My last question before I close this so is, how do I populate the parameter automatically with the current logged in user, instead of entering it?

Thanks again.
0
 
Kurt ReinhardtCommented:
You can't populate the parameter automatically without using some sort of front end application.  It would have to be entered.

About the only other thing I can think of, since you don't want to build it with a Business View, would be to conditionally suppress detail data where {PR_BACKUP_POLICY.DOMAIN} <> CurrentCEUserName.  You may have to  account for this in your various formulas and calculations, too.
0
 
mullykidAuthor Commented:
Ok thanks. Would this work for VIEW LATEST INSTANCE though?

Also, a nagging question. Does VIEW hit the database or no?
0
 
Kurt ReinhardtCommented:
1)  I haven't tested whether or not it would work with View Latest Instance, so I don't know for sure

2)  In general, View hits the database, but depending on your settings you may actually be pulling cached data.
0
 
mullykidAuthor Commented:
Ok. Thanks Rhinok. I will go from here.

Last question :)

Is it possible to know the current user group name. I don't see a reserved field in Crystal like CurrentCEUserName. All I see is GroupNo.
0
 
Kurt ReinhardtCommented:
There's no built-in function for the user group.
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.

  • 15
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now