Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Share Variable - Main Report and Sub Report Post Reply Post New Topic
Author Message
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Topic: Share Variable - Main Report and Sub Report
    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.

Edited by Emir_W - 05 Feb 2019 at 2:53am
Emir W
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet 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
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.027 seconds.