Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Using "previous" function Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Pushrod
Newbie
Newbie


Joined: 20 Sep 2010
Online Status: Offline
Posts: 13
Quote Pushrod Replybullet Topic: Using "previous" function
    Posted: 08 Mar 2011 at 6:20am
I am creating a report that reports document access. In the details area I have PEOPLE_1.FULL_NAME and GROUPS.GROUP_NAME on top of each other so both are displayed for each document. There is also a formula to display the type of rights for people and groups.
 
Because duplicates are displaying for each version of the document I used the "previous" function like this:
{GROUPS.GROUP_NAME} = previous ({GROUPS.GROUP_NAME})
 
This works great for the groups but I also want to do the same for people, so I tried:
{GROUPS.GROUP_NAME} = previous ({GROUPS.GROUP_NAME}) and
{PEOPLE_1.FULL_NAME} = previous ({PEOPLE_1.FULL_NAME})
 
The result is the GROUPS and PEOPLE are not duplicated for each version of the document and the type of rights for each group are correct but only the first people rights are displayed, the rest are blank (as if the "previous" function is not working on people).
 
Please advise.
 
 
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 08 Mar 2011 at 7:51am
Is this a suppression formula?
Is it on the specific field?

In formula workshop if you go to formatting formulas and expand details, you should see your report fields. You then define the conditions that they should be suppressed.

So for GROUP_NAME you would use the one you wrote, and for people you would write "{PEOPLE_1.FULL_NAME} = previous ({PEOPLE_1.FULL_NAME})" there.

You may have accidentally suppressed entire records.
IP IP Logged
Pushrod
Newbie
Newbie


Joined: 20 Sep 2010
Online Status: Offline
Posts: 13
Quote Pushrod Replybullet Posted: 08 Mar 2011 at 10:06am
I have a formula that is an if statement that says if security.accessrights is a certain number then display a string. And this formula is working on both the GROUP and PEOPLE to give their accessrights. But because there are versions of the documents these PEOPLE and GROUPS are duplicating. So I put a "Suppress If Duplicated" on the formula and added the "previous" function indicated in my first post, but it only seems to work on either GROUP or PEOPLE but not both.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 09 Mar 2011 at 2:52am
If you right-click --> format field --> suppress if duplicated I believe it will suppress the entire record. Unless you have found that it only suppresses the particular field (I had run into errors when I did a careless suppression and was missing important data).
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Mar 2011 at 3:18am
are you grouping by People as well, or just Groups? if not, I would try grouping by People as well, then the rights should align.
IP IP Logged
Pushrod
Newbie
Newbie


Joined: 20 Sep 2010
Online Status: Offline
Posts: 13
Quote Pushrod Replybullet Posted: 09 Mar 2011 at 4:49am
In the formula workshop, under Formatting Formulas, on the Details section I have a formula I called "RightsFormula". I right clicked on that formula and made a new Formatting Formula on Suppress If Duplicated.
 
So with:
{GROUPS.GROUP_NAME} = previous ({GROUPS.GROUP_NAME})
I am suppressing the duplicate results that came up.
 
The duplicates were: the same GROUP and it's "rights" would show up for each version of the document.
 
Using the "previous" function fixed this problem.
IP IP Logged
Pushrod
Newbie
Newbie


Joined: 20 Sep 2010
Online Status: Offline
Posts: 13
Quote Pushrod Replybullet Posted: 09 Mar 2011 at 4:50am
Actually the report is grouped by Document Number
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 10 Mar 2011 at 3:37am
would it hurt the report to order by groups and people? If not, that is something to try.  If it is being ordered by date, and the groups and people interleave....
 
I don't think that I fully understand what you are wanting.  It sounds like you want to display rights for groups and people for a document that changes.  If you do this in a group header, it will only look at the record that is current for that group header at that  moment.  If it is being done in the detail section, then the sort order will matter as to what the previous record is. 
 
 
IP IP Logged
Pushrod
Newbie
Newbie


Joined: 20 Sep 2010
Online Status: Offline
Posts: 13
Quote Pushrod Replybullet Posted: 10 Mar 2011 at 5:31am

Thanks for trying to help. I think you have the basics of what I am trying to do, unfortunately I cannot change the grouping.

Is there a way to upload a sceen shot of my report?
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 10 Mar 2011 at 6:35am
hit printscreen on your keyboard, open an image editor like paint, paste it, then upload it to an imagehost and post it here via BBcode.
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.031 seconds.