jimmarkham
Programmer
Crystal Reports 8.0
Oracle 8.0 Database
Apologies if this is obvious but I'm a newcomer to Crystal and have acces only to simple documentation.
I have a report that contains a subreport.
The records returned to the subreport contain a field called SORCE indicating where they came from. SORCE is used to sort the records so we get all the type A's first followed by the B's etc., but I don't know what the values will be.
So records are like this
SORCE F2 F3 etc.
AAAAA 99 abcde
AAAAA 98 xxxxx
BBBBB 95 xxxxx
etc.
I require to display only the first set of records i.e. all the records that have SORCE equal to that on the first record. So I have created a formula field that stores the value from the first record and checks the other records against the stored value and returns eitehr a 'Y' or an 'N'. This displays correctly on the subreport.
Formula (called codtype)is as follows (Basic syntax)
.....................................
global typer1 as string
if recordnumber=1 then
typer1={OPSHEETCODING.SORCE_CODE}
formula = "Y"
else
if typer1 = {OPSHEETCODING.SORCE_CODE}then
formula = "Y"
else
formula="N"
end if
end if
...................................
BUT, I cannot use this Formula field to select records via the selection expert because Crystal will not let me use formula fields for selection criteria in a subreport. If I type @codtype into the formula editor it gets treated as a string literal.
Any suggestions welcome
Jim Markham
Oracle 8.0 Database
Apologies if this is obvious but I'm a newcomer to Crystal and have acces only to simple documentation.
I have a report that contains a subreport.
The records returned to the subreport contain a field called SORCE indicating where they came from. SORCE is used to sort the records so we get all the type A's first followed by the B's etc., but I don't know what the values will be.
So records are like this
SORCE F2 F3 etc.
AAAAA 99 abcde
AAAAA 98 xxxxx
BBBBB 95 xxxxx
etc.
I require to display only the first set of records i.e. all the records that have SORCE equal to that on the first record. So I have created a formula field that stores the value from the first record and checks the other records against the stored value and returns eitehr a 'Y' or an 'N'. This displays correctly on the subreport.
Formula (called codtype)is as follows (Basic syntax)
.....................................
global typer1 as string
if recordnumber=1 then
typer1={OPSHEETCODING.SORCE_CODE}
formula = "Y"
else
if typer1 = {OPSHEETCODING.SORCE_CODE}then
formula = "Y"
else
formula="N"
end if
end if
...................................
BUT, I cannot use this Formula field to select records via the selection expert because Crystal will not let me use formula fields for selection criteria in a subreport. If I type @codtype into the formula editor it gets treated as a string literal.
Any suggestions welcome
Jim Markham