how to layout my crystal report

fguihen

Well-known member
Joined
Nov 10, 2003
Messages
248
Location
Eire
ive never used crystal reports before. ive been messing with it today and created some basic basic reports with the report expert. i cant get it to do what i want though.

i have 3 tables. the main table is the patient table
it is linked to the patient_illness table via patient Id.
there is an illnesses table that contains a list of illnesses and is linked to the patient_illness table via illness_id.

i want the report to look like this:


patient name, address, phone


illness_name, details
illness_name, details
illness_name, details



i cant get it to only select the data i want. it keeps displaying data like this:

patient_name, address, phone, illness_name, illness_id, details

patient_name, address, phone, illness_name, illness_id, details

patient_name, address, phone, illness_name, illness_id, details

patient_name, address, phone, illness_name, illness_id, details

patient_name, address, phone, illness_name, illness_id, details



also , rather than having to speicfy the select parameters when i actually design the report, how to i set it so that the report will be populated based on whatever patient_id i pick at runtime?
 
Hi fguihen

Never used the report expert so dont know what the setup looks like at the moment but to get it to print the way you want you will need to add a group with the patient Id as what it is grouping on.

Put the patient name, address, and phone number in the group header and the illness_name and details in the details section, this should lay out your report as you want it.

You have two options to make it only print the data you want, either set the data source to a table containing only the records required when you run the report ie

Code:
crReportDocument.Database.Tables[0].SetDataSource(tblPatients);

Do this in the viewer Load event.

or set the record selection formula again in the Load event ie

Code:
crReportDocument.RecordSelectionFormula = "{PatientTable.PatientID} = 12345";

Hope this helps
 
Back
Top