Printing Variables on condition

Hi,
I have a report and heirarachy of grouping in the report is patientName , CollectionDate, Tests. I am initializing the variables in the groupheader(collection date), filling up in the Details,Printing(test results) in the GroupFooter(Collection Date).So my report looks like for each patient on that particular collection date it prints those particular test results. But the problem is when ever there is no test results for particular collection date then it needs to pick the previous test result value.

Thanks for any suggestions.
RaoVPAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
You could have a reset formula like

whileprintingrecords;
stringvar test1;
stringvar test2;
If Condition1 then
   test1 := "";

mlmcc
0
 
peter57rCommented:
How is crystal supposed to know what tests there should be and what collection dates there should be?
0
 
RaoVPAuthor Commented:
For Each test i do have a sequence Number and there are total of 10 test but the printing of previous test results is required only for two different tests.For eg: test sequence No: 4 and 5
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
mlmccCommented:
What variables are you initializing?

Where do you gve them report values?

mlmcc
0
 
RaoVPAuthor Commented:
//I am initializing the variable in group header of collection date as
while printing records
string var test1 :=" ";
string var test2 :=" ";

//Filling them in the details section

select  test_seq_no(Column name)
   case "test_seq_No_1" :
               test1 :=test_result
   case "test_seq_No_2" :
               test2 :=test_result

//Printing them in the group footer as

while printing records
string var test1

0
 
mlmccCommented:
If you declare them in the report header and don't reset them in the group header, the variables will have the last value in them if there wasn't a test

Move the formula in the group header to the report header.

mlmcc
0
 
RaoVPAuthor Commented:
I need to reset them in some particular cases, then how can i handle this condition?
0
 
Alpesh PatelAssistant ConsultantCommented:
Previous REcord function is there
use If condition to get particular column value from previous record.
0
 
RaoVPAuthor Commented:
@mlmcc
I have used your fomula,but the issue is when ever there is change in the group for the patient then the value has to reset, by using your formula its carring the same result for next patient with out reseting.
How can i reset for each patient.
0
 
RaoVPAuthor Commented:
Got it,I have moved the intializing of the tests to the patient Group header from Report Header. It worked.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.