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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to identify in a formula the last record in a subreport

Status
Not open for further replies.

adoctor

Technical User
Oct 3, 2006
24
US
Hi all-

I am wondering if anyone can help me. I have a subreport that pulls in information on exhibitions and I am trying to add a period at the end of one particular object report.

So far, only this one object reports’ exhibition records end not with a date, but with RegNotes. All other instances, so far, of RegNotes are within the subreport paragraph and do not need a period. I want to write this period into the formulas so that if there is another instance of a last record ending with RegNotes then a period is inserted to end the paragraph. We sort by date within this subreport, so there is always the possibility that a new record could end up after the one that ends with RegNotes currently.

The formulas for this subreport are set up so that a period is inserted after the Max End Date, called out with a formula called ‘period’:

//use this if exhibition citation needs it ant end
Code:
if{@max end date}={Exhibitions.EndISODate} and {Exhibitions.ActualAttendance}=1 then '' else
if {@max end date}={Exhibitions.EndISODate} 
and isnull({exhobjxrefs.remarks}) then '.' else 
if {@max end date}={Exhibitions.EndISODate} and
{ExhObjXrefs.Remarks} = 'ill.'  then "" else 
if ({@max end date})={Exhibitions.EndISODate}
then '.' else ";"+" "

For reference, the '@max end date' formula is:

Code:
Maximum ({Exhibitions.EndISODate})

Is there a way to write into the 'period' formula that if the last record in the exhibitions subreport ends with RegNotes it ends with a period? I have scoured the help documents and can’t seem to find what I’m looking for.

Thanks for your help!

Angie
 
Sorry, meant to also add that I use CR 11.

Thanks!

Angie
 
Try using the onlastrecord function. This boolean function returns true for the last record in any report including subreports.

 
Thank you! It works perfectly. I knew there was a function but I just couldn't find it.

Best, Angie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top