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!

Create a blank record if one does not exist.

Status
Not open for further replies.

BigDaddyE

MIS
Apr 29, 2010
27
US
I have a report that I want to show 6 pipe deliminated codes for each patient. If the Code does not exist then I still need to reserve a pipe position for it. Example below has 4 codes for the patient John Doe:

John Doe
1 aaa
2 bbb
3 ccc
4 ddd
5
6

This should display as:
|Doe|John|aaa|bbb|ccc|ddd|||

Fields used are:
patient.LastName
Patient.FirstName
Code.Key
Code.Seq_Num

Any help is greatly appreciated!
 
Assuming you're grouping by patient, I would create a variable for each code that looks something like this:

Code:
StringVar code1;
If {patient.ID} <> previous({patient.ID}) then code1 := '';
If {code.SEQ_NUM} = 1 then code1 := {code.KEY} + '|';
code1

You then just concatenate the codes onto the patient name in each group footer.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
You will need to give more info

How is data presented and how should it display, ie do you need to see the detail lines you have shown and then a summary filed at the end. Or is the goal to only display the delimited filed example you have shown.

If later create 6 vars for each element, then use a reset in patient header

@reset
whileprintingrecords;

global stringvar E1:="|";
global stringvar E2:="|";
global stringvar E3:="|";

etc

In details create formula to add data to each element

@Eval
whileprintingrecords;

global stringvar E1:= E1&{FirstName};
global stringvar E2:= E2&{LastName};
etc

In Patient footer

@Display
whileprintingrecords;

global stringvar E1&global stringvar E2&global stringvar E3&global stringvar E4&global stringvar E5&global stringvar E6

As the last two vars have values by default it will not mater if report finds data for them or not.

Ian



 
Currently data is grouped by {patient.ID} and I would like to only display the delimited filed shown. EX: |Doe|John|aaa|bbb|ccc|ddd|||
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top