Print Page | Close Window

Displaying multiple values in group header

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21740
Printed Date: 02 May 2024 at 2:52pm


Topic: Displaying multiple values in group header
Posted By: barry.ein
Subject: Displaying multiple values in group header
Date Posted: 18 Oct 2015 at 5:42am
Hi all,

I have a sub-report with 5 groups.
One of the fields in the sub-report displays multiple values so I am using formulas to reset (Group Header), calculate (Details) and display (Group Footer).

Now I need to place a display formula in the group header but I cannot figure out where to place the initialization and calculation formulas.

My formulas are:
Init formula
Shared stringVar Department:=chr(13);

Calc formula
Shared stringVar Department;
if ({DATA_FIELDS.NAME}="Department")
    then
    (
        if (InStr(Department,chr(13)+{TYPE.NAME}+chr(13))=0)
            then Department:=Department+{TYPE.NAME}+chr(13)
    )
;

Display formula
Shared stringVar Department;
if (Department=chr(13))
    then ""
    else Right(Left(Department,Length(Department)-1),Length(Department)-2)
;

Any ideas would be highly appreciated,

Barry



Replies:
Posted By: DBlank
Date Posted: 19 Oct 2015 at 2:57am
I am unclear on what you are trying to do. Are you trying to display the results of sub-report in the GH of the main report or are you trying to display the results in the gh of the sub-report(s) ?
If this is all in the sub reports your process will not support display in the GH. Have you considered a cross tab? Maybe with a suppressed values?


Posted By: barry.ein
Date Posted: 19 Oct 2015 at 11:12pm
I am trying to display the data in the GH of the subreport.



Posted By: DBlank
Date Posted: 22 Oct 2015 at 4:53am
try the cross tab trick.
shared variables only display results in details and footers. the results for a group do not exist for a header display.


Posted By: barry.ein
Date Posted: 22 Oct 2015 at 8:45am
I will give it a try, thanks.



Print Page | Close Window