Share Variable - Main Report and Sub Report
Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22725
Printed Date: 04 May 2024 at 5:55am
Topic: Share Variable - Main Report and Sub Report
Posted By: Emir_W
Subject: Share Variable - Main Report and Sub Report
Date Posted: 05 Feb 2019 at 2:50am
Hi,
I have a main-report and sub-report as follow:
Main report (MR), contains:
- MRN, DOB, Civil-ID, Date Added
Sub report (SR), contains;
- MRN, DOB, Civil-ID, Date Added
Where MR is list of last month New Patients.
While SR is list of all patients (from beginning till before last month) where Civil-ID is dobel with the one in MR.
My goal is: to exclude for Baby patient (which is born last month) with the mother. Because both are using same Civil-ID.
Till now my report are OK, it listed all the same Civil-ID.
But, how to determine that data from sub-report is the mother of the baby with other data.
I am using a shared variable in SR and MR, but it give me incorrect result.
------------- Emir W
|
Replies:
Posted By: Emir_W
Date Posted: 05 Feb 2019 at 2:57am
my current report shows as below:
MRN DOB CID DtAdd mrn dob cid dtadd xshare yshare
0201 01/12 823 01/12 0113 03/05 823 27/11 03/05 <blank>
------------- Emir W
|
Posted By: hilfy
Date Posted: 05 Feb 2019 at 6:28am
Try this:
Use both the Civil-ID and the MRN as links to the subreport. You'll filter the subreport by looking for the Civil-ID to be the same and the MRN to be different, so you'll have to modify what's in the Select Expert after you add the MRN link. It should look something like:
{MyTable.CID} = {?PM-CID} and
{MyTable.MRN} <> {?PM-MRN}
If you set all of the visible sections in the subreport to suppress when there's no data (IsNull{MyTable.CID})) then set the section the subreport is in to suppress when empty, you'll only see the subreport when there is a baby to report.
-Dell
------------- Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics
|
|