Topic: Previous/Next Function Posted: 19 May 2009 at 3:25am
Hi all,
I have been using the previous/next functions in my report to allow me to compare dates on different detail rows.
However, I noticed on my report that the next/previous function does not seem to stop at the last detail row of the group. i.e the next function in the last line of a group is taking data from the first line of the next group.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 19 May 2009 at 6:54am
I haven't use previous and next, but I am guessing that you will need to check the grouping criteria in your formula so that you don't get erroneous results.
I am also guessing, that Crystal doesn't really care about the group criteria...if the report writer wanted to use previous and next, then, we will just do as they say. It probably allows for some really flexible reports, but in this case is causing a headache instead.
Joined: 01 Dec 2009
Location: United States
Online Status: Offline
Posts: 1
Posted: 01 Dec 2009 at 12:09pm
I am having the same problem that you posted regarding the previous/next function not stopping at the end of the group. Did you get an answer to the issue?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 01 Dec 2009 at 1:17pm
Depends on what you want it to display on the last record or first record but the idea is to add an if then to your formula using onfirstrecord or onlastrecord.
An example to display 0 days on the last row:
if onlastrecord then 0 else datediff('d',next(datefield),datefield)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum