Hi Folks,
This one is driving me up the wall and I can't imagine why it's so difficult. In my main report, I'm building 2 arrays from the detail section:
Array 1 = the unique ID's
Array 2 = a date value associated with that ID.
The arrays are declared in the main report as Shared variables:
Shared stringVar array arrIndexMRN;
Shared stringVar array arrIndexDischargeDt;
In the Subreport, I would simply like to list the multiple records associated with each ID in the array. But I want these records to have date values that are > than the date value stored in the second array.
I can't use record selection, and am limited to group selection. So in the group selection, I have the following:
WhilePrintingRecords;
Shared stringVar array arrIndexMRN;
Shared dateVar array arrIndexAdmissionDt;
numberVar i;
// MAKE SURE RECORD ID IS IN ARRAY
{khs_financial_v.med_rec_no} In arrIndexMRN
And
// LOOK FOR THE CORRESPONDING DATE VALUE IN DATE ARRAY
(
for i := 1 to UBound(arrIndexMRN) step +1 do
(
If (arrIndexMRN = {khs_financial_v.med_rec_no}) Then
(
// MAKE SURE THE DATE IN CURRENT RECORD IS GREATER THAN THE ORIGINAL DATE
If (CDateTime (arrIndexAdmissionDt) > CDate({khs_financial_v.adm_dtime})) Then
(
arrIndexAdmissionDt = DateValue ({khs_financial_v.adm_dtime});
);
Exit For;
)
);
)
The result is thousands of pages of records if I test by placing the ID field in the Details section of the sub-report. I know that the arrays are getting populated correctly and have about 250 elements (which is printed out in the subreport). But somehow the record selection in the subreport is not working.
If there's a more straightforward way to achieve this, I'm happy to change my design. But I just don't see why the filtering is not working.
Thanks in advance for your suggestions.
This one is driving me up the wall and I can't imagine why it's so difficult. In my main report, I'm building 2 arrays from the detail section:
Array 1 = the unique ID's
Array 2 = a date value associated with that ID.
The arrays are declared in the main report as Shared variables:
Shared stringVar array arrIndexMRN;
Shared stringVar array arrIndexDischargeDt;
In the Subreport, I would simply like to list the multiple records associated with each ID in the array. But I want these records to have date values that are > than the date value stored in the second array.
I can't use record selection, and am limited to group selection. So in the group selection, I have the following:
WhilePrintingRecords;
Shared stringVar array arrIndexMRN;
Shared dateVar array arrIndexAdmissionDt;
numberVar i;
// MAKE SURE RECORD ID IS IN ARRAY
{khs_financial_v.med_rec_no} In arrIndexMRN
And
// LOOK FOR THE CORRESPONDING DATE VALUE IN DATE ARRAY
(
for i := 1 to UBound(arrIndexMRN) step +1 do
(
If (arrIndexMRN = {khs_financial_v.med_rec_no}) Then
(
// MAKE SURE THE DATE IN CURRENT RECORD IS GREATER THAN THE ORIGINAL DATE
If (CDateTime (arrIndexAdmissionDt) > CDate({khs_financial_v.adm_dtime})) Then
(
arrIndexAdmissionDt = DateValue ({khs_financial_v.adm_dtime});
);
Exit For;
)
);
)
The result is thousands of pages of records if I test by placing the ID field in the Details section of the sub-report. I know that the arrays are getting populated correctly and have about 250 elements (which is printed out in the subreport). But somehow the record selection in the subreport is not working.
If there's a more straightforward way to achieve this, I'm happy to change my design. But I just don't see why the filtering is not working.
Thanks in advance for your suggestions.