Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Restricted Views Post Reply Post New Topic
Page  of 2 Next >>
Author Message
ssiah91
Newbie
Newbie
Avatar

Joined: 21 May 2015
Location: United States
Online Status: Offline
Posts: 6
Quote ssiah91 Replybullet Topic: Restricted Views
    Posted: 21 May 2015 at 7:32am
So I have this report which looks something like this

gh1 regionname | 506
gh2 marketname | 193
gh3 branchname | 12
d                         1
d                         1
d                         0
and so on...

each region, market, branch is assigned to a manager login, so in the select expert it is something like this:
{RegionManager} = CurrentCEUserName or
MarketManager} = CurrentCEUserName or
{BranchManager} = CurrentCEUserName or
CurrentCEUserName = 'administrator'

administrator can see all the data, but each manager can only view the detail rows that are affiliate to them.

The problem now is when I ran it using a market manager login, the detail section did only show the rows that are related to the market manager, but the groups are not giving me the sum of rows that are related to the market manager.

Anyone has an idea on how to solve this?

p.s runningtotal does not work in this case because my sums must be placed on the report header.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 21 May 2015 at 8:52am
Do you have this in the formula of the Select Expert or in the Suppress Formula on the section where the data is displayed?

-Dell
IP IP Logged
ssiah91
Newbie
Newbie
Avatar

Joined: 21 May 2015
Location: United States
Online Status: Offline
Posts: 6
Quote ssiah91 Replybullet Posted: 21 May 2015 at 8:54am
Hey Dell,

I am using the formula in the select expert.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 22 May 2015 at 3:24am
Is that all that's in the select formula or do you have other criteria as well? If you have other criteria, you should either add parentheses around it like this:

(
{RegionManager} = CurrentCEUserName or
{MarketManager} = CurrentCEUserName or
{BranchManager} = CurrentCEUserName or
CurrentCEUserName = 'administrator'
)

Or change it to something like this:

CurrentCEUserName in ({RegionManager}, {MarketManager},{BranchManager}, 'administrator')

-Dell
IP IP Logged
ssiah91
Newbie
Newbie
Avatar

Joined: 21 May 2015
Location: United States
Online Status: Offline
Posts: 6
Quote ssiah91 Replybullet Posted: 22 May 2015 at 4:07am
Thank you for the reply.

Yea that is all it is in the select formula, basically what it does is to filter (not suppress) the details so that it will only show the rows that are related to the manager login.

The formula I have is doing the job at the detail section, but the group levels are still summing all values of all manager, instead of that specific manager.

It is weird because i applied the formula to all 3 select experts (records, group, saved data). Somehow CR still summing up all the values, regardless if it is related to the manager or not.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 22 May 2015 at 4:52am
Are you using summaries for your sums or do you have them in formulas? If formulas, please post the formula.

-Dell
IP IP Logged
ssiah91
Newbie
Newbie
Avatar

Joined: 21 May 2015
Location: United States
Online Status: Offline
Posts: 6
Quote ssiah91 Replybullet Posted: 22 May 2015 at 4:58am
I actually tried both ways.
1. I just right click the detail value and insert a summary.
2. I used COUNT ({detail value}, {branchname}) , i also dd it for other group levels too.

But both still sum up all the values even when I ran it where CurrentCEuserName as one of the managers.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 22 May 2015 at 5:03am
Ok, let's break this down a bit. For the part where your summary is a count, try using DistinctCount instead of Count. If that gives you the correct number, then the issue is not that it is counting other managers, it's that there are multiple rows for each item for the current manager.

-Dell
IP IP Logged
ssiah91
Newbie
Newbie
Avatar

Joined: 21 May 2015
Location: United States
Online Status: Offline
Posts: 6
Quote ssiah91 Replybullet Posted: 22 May 2015 at 5:12am
I am sorry, maybe I did confuse you there a bit. So the detail part can only be 1 or 0 .
So for example this is the full table (full access to view):

               Manager    Total
branch group               3
detail          John        1
detail          Mike        1
detail          Jason       1

So if I run it with John's login, I am supposed to only get sum total for branch level to be 1:

               Manager    Total
branch group               1
detail          John        1

but instead I got this sum is 3:

               Manager    Total
branch group               3    <-- sum is still 3
detail          John        1

I am sorry if I caused any misunderstanding.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 22 May 2015 at 6:25am
This still has to be an issue with the data - if you have the filter in the Select Expert, Crystal won't even pull from the database the data that doesn't match the filter.

If you go to my website (www.dellstinnett.com) you can get my email address. If you send me the .rpt file after saving it with data, I'll take a look at it and see if there's anything obviously wrong.

-Dell
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.