Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Compress blank fields/lines in detail section? Post Reply Post New Topic
Author Message
abrow
Newbie
Newbie


Joined: 09 Oct 2007
Location: United States
Online Status: Offline
Posts: 2
Quote abrow Replybullet Topic: Compress blank fields/lines in detail section?
    Posted: 09 Oct 2007 at 1:49pm
I'm using Crystal Developer 9.2.  I have to write a security report and I have this problem to solve. One security record contains 90+ privilege settings/fields. My security group only wants to see a list of privileges that have been granted, rather than a list of all privileges with a yes or no next to each.
 
So, instead of seeing:
 
Access Ticketing System     Yes
Update Ticketing System    No
Access TimeCard System    Yes
Update TimeCard System   Yes
Access CoffeePot                No
Access Refrigerator             Yes
Access Restroom                 No
 
They just want to see:
 
Access Ticketing System     Yes
Access TimeCard System    Yes
Update TimeCard System   Yes
Access Refrigerator             Yes
 
Since all of the security fields are in one record, it seems like they should all be in the Detail section. I can see how to suppress the 'No' privileges so that nothing prints at all, but I can't figure out how to make the other fields 'slide up' so that there are no gaps in the list. I'm guessing that it could be done with a lengthy formula, but if there's an easier way I'd like to know it. If there isn't, I'd like to know if I can do that with a formula.
 
Thanks!
 
IP IP Logged
abrow
Newbie
Newbie


Joined: 09 Oct 2007
Location: United States
Online Status: Offline
Posts: 2
Quote abrow Replybullet Posted: 09 Oct 2007 at 2:54pm
I figured this out shortly after posting the question. My original search of this forum had led me eventually to the property of Text Objects that allows them to concatenate fields placed in them (Piotror's book online). I then searched on the string "line feed" and found that concatenating ChrW(13) & ChrW(10) to my string would create a CR-LF (hilfy's message in this forum).
 
Then I created a custom function that returned privilege-field & ChrW(13) & ChrW(10) if the privilege was granted and an empty string if it was not. Then I put a Text Object on the detail section and dropped each privilege field in it, applying the custom function to each one. Worked like a charm!
 
So, many thanks to: Piotror & hilfy !!!

Smile
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.031 seconds.