Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Track back Record??????????? Post Reply Post New Topic
Author Message
overcharge
Newbie
Newbie
Avatar

Joined: 12 Mar 2010
Location: Malaysia
Online Status: Offline
Posts: 12
Quote overcharge Replybullet Topic: Track back Record???????????
     Posted: 04 May 2010 at 7:28pm
Hi all experts,

I'm facing a problem to track back record to get the Title which its ProgrammeID is not null. My scenario is like below:

presentationID        ProgrammeID                 Title                   
12 123 Singing Competition
13 NULL Promotion Break 1 minute
15 146 Morning News
17 105 Cooking Programme
19 NULL Promotion Break 1 minute
24 NULL Promotion Break 1 minute
30 NULL Promotion Break 1 minute
67 NULL Promotion Break 1 minute

Condition:
If the programmeID is not null it should show Title and if the programmeID is null then the system will be continued automatically to track back the previous row data until the system found out the ProgrammeID is not null. Consequently the Title will be shown in the report.

Eg: My report is referring to presentationID=67, so in my report the Title should be Cooking Programme.

My Question is how i get the correct Title ? Using while loop and previous() function will be helped?

I need to get the answer as soon as possible.
Thanks in advance.
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 05 May 2010 at 2:18am
I'm thinking a manual running total will help. Try this:
 
whileprintingrecords;
 
global numbervar nTitle:= if isnull({table.ProgrammeID}) then nTitle
     else {table.ProgrammeID};
 
nTitle;
 
This however does not take in to account if the first record is null. May need someone else to answer that if it is a problem.
 
HTH.
|< /\ '][' ( )
IP IP Logged
overcharge
Newbie
Newbie
Avatar

Joined: 12 Mar 2010
Location: Malaysia
Online Status: Offline
Posts: 12
Quote overcharge Replybullet Posted: 06 May 2010 at 3:35pm
Thanks HTH, i think your formula should be worked fine if there is no any filtering.

I found out that, after the filtering, all of my data is with null progID.
Is there a way to let me track back the ProgID with the proper title in the database. In the other hand, the formula would not be affected by the filtering, is that possible????

Let us using back the same sample data but all the data with ProgID will be filtered out. Just leave the data with NULL progID.

Any suggestion is glad for me.. Embarrassed

Thank you.


Edited by overcharge - 06 May 2010 at 3:37pm
IP IP Logged
Printable version Printable version

Forum Jump
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