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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Details section appearing twice

Status
Not open for further replies.

bigmelon

MIS
Sep 25, 2003
114
US
I am creating a report with a bunch of subreports. Each subreport is in its own group footer. But for some reason it is showing my details information twice and wondered if anyone knew why?

Thanks in advance,

Jeremy
 
Look at the SQL query that is being used for this report (Database > Show SQL Query) and see if that explains it.
If you are not sure post the SQL here.
 
Without knowing your environment such as

Crystal Version
Database
Connectivity
Sample data
Expected output

we can only guess.

Based on the limited amount of information given, like

What are you doing in the main report?
Where are the subreports?
What are the subreport links?

It looks like there are duplicate entries in the main report that is triggering the subreport to run multiple times

 
I did away with the group by because i didnt really need it and just added more details sections but it shows the report 3 times for some reason.

Here is the SQL:

SELECT
Pt_Ident."Last Name",
Pt_Ident."First Name",
Pt_Ident."Middle Initial",
Pt_Ident."6 Digit Hospital Number",
Pt_Ident."Birth Date",
Pt_Ident."Sex",
Pt_Ident."Blood Type",
Pt_Ident."Allergies",
Surgproc."Social_Security_Number",
Surgproc."Date_of_Admit",
Surgproc."Proc_Date",
Surgproc."Primary_Surgeon",
Surgproc."Assisting_Surgeon",
Surgproc."Proc_Type",
Surgproc."Primary_Perfusionist",
Surgproc."Anesthesia",
Surgproc."Urgency",
Surgproc."Age_at_Surgery",
Surgproc."Ejection_Fraction",
Surgproc."Sequence_Num",
Surgproc."Diag_Cath_Hosp",
Surgproc."ClampTime",
Surgproc."PumpTime",
Surgproc."Oxygenator",
Surgproc."OxygenatorSN",
Surgproc."TubingPack",
Surgproc."TubingPackSN",
Surgproc."Pump",
Surgproc."PumpSN",
Surgproc."Total Prime",
Surgproc."AnesCrystalloid",
Surgproc."Height",
Surgproc."Weight",
Surgproc."Referring_Physician",
Surgproc."CCS_Class",
Surgproc."CathDate",
Surgproc."PumpCryst",
Surgproc."BloodProducts",
Surgproc."ACTMonitor",
Surgproc."ABGMonitor",
Surgproc."PrePumpUrine",
Surgproc."Hemoconcentrator",
Surgproc."Mg_Cardioplegia",
Surgproc."K_Cardioplegia",
Surgproc."TotalHeparin",
Surgproc."Protamine",
Assesmnt."Pre_Op_Time",
Assesmnt."Pre_OP_Temp",
Assesmnt."Pre_OP_Syst_BP",
Assesmnt."Pre_OP_Diast_BP",
Assesmnt."Pre_OP_PA_Syst",
Assesmnt."Pre_OP_PA_Diast",
Assesmnt."Pre_OP_HR",
Assesmnt."Pre_OP_CO",
Assesmnt."Pre_OP_pH",
Assesmnt."Pre_OP_pCO2",
Assesmnt."Pre_OP_pO2",
Assesmnt."Pre_OP_HCO3",
Assesmnt."Pre_OP_BE",
Assesmnt."Pre_OP_Hct",
Assesmnt."Pre_OP_K",
Assesmnt."Pre_OP_ACT",
Assesmnt."Post_Op_Time",
Assesmnt."Post_OP_Temp",
Assesmnt."Post_OP_Syst_BP",
Assesmnt."Post_OP_Diast_BP",
Assesmnt."Post_OP_PA_Syst",
Assesmnt."Post_OP_PA_Diast",
Assesmnt."Post_OP_HR",
Assesmnt."Post_OP_CO",
Assesmnt."Post_OP_pH",
Assesmnt."Post_OP_pCO2",
Assesmnt."Post_OP_pO2",
Assesmnt."Post_OP_HCO3",
Assesmnt."Post_OP_BE",
Assesmnt."Post_Op_Hct",
Assesmnt."Post_OP_K",
Assesmnt."Post_OP_ACT",
Pumpstat."Urine"
FROM
((x.dbo.Pt_Ident Pt_Ident INNER JOIN x.dbo.Surgproc Surgproc ON
Pt_Ident."Social_Security_Number" = Surgproc."Social_Security_Number")
INNER JOIN x.dbo.Assesmnt Assesmnt ON
Surgproc."Surg_Proc_Number" = Assesmnt."Surg_Proc_Number")
INNER JOIN x.dbo.Pumpstat Pumpstat ON
Surgproc."Surg_Proc_Number" = Pumpstat."Surg_Proc_Number"
WHERE
Surgproc."Social_Security_Number" = 'xxx-xx-xxxx'
 
The main report just lists some vital information about that patient. I have 4 subreports that have additional information on the patient displayed in a table format. I know have details sections a-g, and it displays all of my information correctly, it just shows it 3 times back to back. Any ideas??
 
The problem is in the visual linking expert. I have a total of seven tables. 6 of them contain surg_proc_num and two have ssn, bet when i try to link them all up i get the duplicate
 
Using the SQL above, the number of detail lines depends on the number of records in each join..
Th only circumstance in which you will get one detail record is if:
for a given Pt-Ident record there is
just one matching SurgProc record
and for this surgProc record there is
just one matching Assesment record and just one matching pumpstat record.

Any other situation would produce either no output record or multiple outputs.

So are you satisfied that there is just one record in each case.
 
No, one surgproc record can have two or more pumpstat records
 
Then you will get as many detail records for each pt-ident as there are pumpstat records.
 
You could suppress the duplicates. Right-click on the detail section and choose Format Section. Then choose the formula icon (x+2 and a pencil) for suppression.

Test pumpstat = Previous(pumpstat).

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top