[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

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.
0
RaoVP
Asked:
RaoVP
1 Solution
 
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
 
mlmccCommented:
What variables are you initializing?

Where do you gve them report values?

mlmcc
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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
 
mlmccCommented:
You could have a reset formula like

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

mlmcc
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now