Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Variable in Group header Post Reply Post New Topic
Author Message
nelsont
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Online Status: Offline
Posts: 4
Quote nelsont Replybullet Topic: Variable in Group header
    Posted: 16 Dec 2008 at 6:51am
A question that is puzzling me -
 
We have a report that we wish to alter by changing the messages that print when certain criteria are met.  In general, an employee may have 1, 2 or 3 plans associated with him. 
 
When 1 plan is present, there is not a problem with printing the plan message after the plan ID.
 
When 2 or 3 plans are present, we would like to print the plan IDs, and then print all of the messages (2 or 3 different pieces of data).
 
We can't get all 2 or 3 messages to print.  Only the last  message will print.  We can get the message to print if we include it after the specific plan (change the print order), but we don't want to setup the report this way.Thumbs%20Down
 
I have the report set up as:
 
Page Header
         [Info]
Group Header 1
         [employee name and information]
Group Header 2
         [Plan 1]
         [Plan 2 - if present]
         [Plan 3 - if present]
         [Plan 1 message]
         [Plan 2 message - if present]
         [Plan 3 message - if present]
Group Footer 2
         [empty]
Group Footer 1
         [general information to employee]
Page Footer
         [Info]
 
Thanks in advance for any help.


Edited by nelsont - 16 Dec 2008 at 6:51am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 16 Dec 2008 at 6:56am
I am guessing that the message is in a formula.  I would concatenate the messages together.   It sounds like the formula is an if statement and is only printing the last message, which is why I thought to concatenate.  You would need to set the field to grow so that all lines can be viewed (if space wasn't allotted for that)
 
Only other thought, since it isn't mentioned is that the group interfers with the message.
 
These are my first thoughts...
Hope they help in some small way.
IP IP Logged
nelsont
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Online Status: Offline
Posts: 4
Quote nelsont Replybullet Posted: 16 Dec 2008 at 10:20am
Thanks for the feedback.
 
Yes, the message is in a formula.  I don't think that I can concatenate the messages because each time through the detail, the plan (and message) may change.  I cannot understand how to get a message(s) to "stick" for all details to be read.  And then to reset it for the first reading of a new employee.
 
I did leave out one important (potentially) component.  The details section, which is between the header & footer is suppressed.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 16 Dec 2008 at 10:26am
Suppressed is OK.  To get the message to 'stick'
 
in the formula for the message at the top:
Shared StringVar msg;
 
In the formula, where you decide which message to display, instead of something like "Message" make it msg := msg + "Message"
 
The display formula is simply: Shared StringVar msg
and in the group header 1 set the msg := "" to reset it.
 
Does this help?
IP IP Logged
nelsont
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Online Status: Offline
Posts: 4
Quote nelsont Replybullet Posted: 16 Dec 2008 at 12:29pm
I am still having an issue with the msg only displaying text based on the last Plan included for the employee.
 
In the Group Header 1, to reset the msg, I have:
Shared StringVar msg;
msg := ""
 
In the Group Footer 1, to print the messages, I have:
Shared StringVar msg;
IF {PlanID} <> 'HRA'
then msg := msg +
     'message for non-HRA'
else msg := msg +
     'message for HRA'
 
There are only 2 plans in this example, to attempt to get the deal working - then I'll add the 3rd plan.
 
I can try to post actual code, if that will help any.
 
Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 16 Dec 2008 at 12:59pm
I think you want what is in the footer to be in Group Header 2, then display the result in Group Footer 1
 
Does that make sense?  You want to loop through any plans and update the variable, then display it.
IP IP Logged
nelsont
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Online Status: Offline
Posts: 4
Quote nelsont Replybullet Posted: 18 Dec 2008 at 5:39am
Thanks for the assistance.  I believe that I now have what I need - thanks to the Shared msg info.
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.