Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables for dates with mulitple values

Status
Not open for further replies.

catchingup

Technical User
May 11, 2006
37
US
I am using CR11 to create a meeting report.

I have the report grouped by business group in Group1.
In the detail section, I want it to display the meeting(s) that are appropriate - see diagram below.

The problem, I am having is that is putting all dates on separate lines even though the variable formulas are on the same row.
How can I correct this?

I have the following formulas set up
GROUP1 Header
{@Set Variables} =
whileprintingrecords;
dateVar MtgType1;
dateVar MtgType2;
dateVar MtgType3;
dateVar MtgType4;


DETAILS
[/b]{@MtgType1} =[/b]
DateVar MtgType1;
MtgType1 := CDate({@Meetingtype1);

[/b]{@MeetingType1} = [/b]
if (not isnull({Meetings.MeetingName}) and {Meetings.MeetingName} in "MtgType1"
and {Meetings.Date} < CurrentDate)
then {Meetings.Date}

{@MtgType2} =
DateVar MtgType2;
MtgType2 := CDate({@Meetingtype2);

{@MeetingType2} =
if (not isnull({Meetings.MeetingName}) and {Meetings.MeetingName} in "MtgType2"
and {Meetings.Date} < CurrentDate)
then {Meetings.Date}

There may be multiple dates that apply to both of these formulas. what I am trying to acheive is a details section that looks like this:

Meeting Type1 Meeting Type2
06/14/06 07/15/06
09/30/06 10/18/06
05/01/07 07/10/07
07/15/07


What I am currently getting looks like this:

06/14/06
09/30/06
05/01/07
07/15/06
10/18/06
07/10/07
07/15/07

How can I correct this?
 
Could you be eliminating records that don't meet your criteria in the record selection formula? Like:

not isnull({Meetings.MeetingName}) and
{Meetings.Date} < CurrentDate

Anyway you could do this with formulas like this:

//{@reset} in the group header:
whileprintingrecords;
stringvar MtgType1 := "";
stringvar MtgType2 := "";
stringvar MtgType3 := "";
stringvar MtgType4 := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar MtgType1;
stringvar MtgType2;
stringvar MtgType3;
stringvar MtgType4;

if not isnull({Meetings.MeetingName}) and
{Meetings.Date} < CurrentDate then
(
if {Meetings.MeetingName} = "MtgType1" and
instr(MtgType1,{Meetings.Date}) = 0 then
MtgType1 := MtgType1 + {Meetings.Date} + chr(13);
if {Meetings.MeetingName} = "MtgType2" and
instr(MtgType2,{Meetings.Date}) = 0 then
MtgType2 := MtgType2 + {Meetings.Date}+chr(13);
if {Meetings.MeetingName} = "MtgType3" and
instr(MtgType3,{Meetings.Date}) = 0 then
MtgType3 := MtgType3 + {Meetings.Date}+chr(13);
if {Meetings.MeetingName} = "MtgType4" and
instr(MtgType4,{Meetings.Date}) = 0 then
MtgType4 := MtgType4 + {Meetings.Date}+chr(13);
)

//{@displMtgType1} for the group footer section:
whileprintingrecords;
stringvar MtgType1;
"Meeting Type 1"+ MtgType1

Repeat the last formula for each MtgType, and then place the formulas in the group footer, evenly spaced. Right click on each formula->Format field->common tab->check "Can Grow". Then suppress the detail section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top