Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Repeating Data Post Reply Post New Topic
Author Message
AndyDonut1
Newbie
Newbie


Joined: 26 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote AndyDonut1 Replybullet Topic: Repeating Data
    Posted: 26 Mar 2009 at 9:12am
Hi There,
I am having a problem on v XI and wondering if anyone can help.
 
Basically i have a set of data and have written a formula to perform some calculations and if the data qualifies for one set of rules, the formula gives me a text string of "standard user" as the result. If the data qualifies for the other set of rules, the text string is "view only".
 
There is multiple rows of data per user, and some rows qualify for standard, and some for view.
 
So, when i group my report on the Standard or view formula, the same user is appearing in both groups.
 
What i need to achieve is that if any of the rows of data for that user fall into the "standard" cirteria, then i dont want them to appear again on the "view only"... if there is one single instance of standard then they should automatically fall into that catagory and not appear anywhere else!
 
i hope that makes sense, and that someone can help as i am stuck
:(
 
Thanks in advance,
Andy
 
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Mar 2009 at 1:10pm
How many users have both?  Do you have a unique identifier (key field?) for each user?
 
-Dell
IP IP Logged
AndyDonut1
Newbie
Newbie


Joined: 26 Mar 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote AndyDonut1 Replybullet Posted: 26 Mar 2009 at 2:54pm

hey,

a lot of them have both... yes, they are uniquely identified by a USERID. i have tried to suppress if duplicated but this doesnt work and they still appear in both groups.

 

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Mar 2009 at 12:01pm
Suppress if duplicated only works on consecutive records - it doesn't work on records that are in different places on the report.
 
Try this:
1.  Create a formula that will gather the ID's of all of the "standard" users.  It will look something like this:
whileprintingrecords;
StringVar Array users;
NumberVar userCount;
if {@UserTypeFormula} = "standard user"
  if PreviousIsNull({table.UserID}) then 
    userCount := 1;
    users := [{table.UserID}]
  else
    userCount := userCount + 1;
    Redim Preserve users[userCount];
    users[userCount] := {table.UserID};
2.  In the suppress formula for the section that you don't want to display if the user has already been printed, you'll do something like this:
StringVar Array users;
({@userTypeFormula} = "view only") and ({table.userID} in users)
This will suppress the section if the type is view only and the user ID is in the list of users that have already been processed as standard users.
 
I haven't tested this, but I think it will work.
-Dell
IP IP Logged
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.015 seconds.