Formula Field Not growing when in the same page footer as a sub-report

252 views Asked by At

Basically, I have a formula that runs while printing records, that can print 0-3 rows using chr(13) and global stringvars to form a final string (tried with chr(10) and chr(13)), in the same page footer as a sub report that can have anywhere from 0 rows to above 3. Both are set to "Can grow" however the formula field never grows past the sub-report.

I'm using Crystal Reports 9.

I also tried using a box around the formula leading from the previous page footer to another page footer.

Here's my formula

WHILEPRINTINGRECORDS;
global stringvar WD;
global stringvar ADV;
global stringvar NASC;
stringvar final :="";

IF WD <> "" AND ADV <> "" AND NASC <> "" THEN final := WD  + Chr(13) + chr(10) +  NASC + Chr(13) + chr(10) + ADV
ELSE IF WD = "" AND ADV <> "" AND NASC <> "" THEN final := NASC + Chr(13) + chr(10) + ADV
ELSE IF WD <> "" AND ADV = "" AND NASC <> "" THEN final := WD + Chr(13) + chr(10) + NASC
ELSE IF WD <> "" AND ADV <> "" AND NASC = "" THEN final := WD + Chr(13) + chr(10) + ADV
ELSE IF WD = "" AND ADV = "" AND NASC = "" THEN final := "";
final

And here's a sample of one of one of the formulas that set the stringvars, they all follow the same method.

WHILEPRINTINGRECORDS;
global Stringvar ADV;
global Stringvar Status;

if({COLUMN1}="EX" 
  OR {COLUMN1}="ADV" 
  OR {COLUMN1}="CR" 
  OR {COLUMN1} = "DES" )
 THEN ( ADV := "#     - EXEMPT";  Status := "Status"; "#") ELSE ""
1

There are 1 answers

0
jambonick On

Each Subreport has it's own details section and if your fields are set there, it shows results for all of your rows, even if you put it in footer. Conversely, a formula that is set in a footer (page or report) works in an aggregate form, because footer is supposed to be used only for aggregate result (max,min,sum etc). If you put a formula in footer and you edit it to return a field value or something that it has to do with a field's value, then it will return result only for the first row of your select (like TOP 1 in SQL), I think.

Of course I am not completely sure because you have not displayed any results or your schema, but your case seems much like it