fguihen Posted November 30, 2005 Posted November 30, 2005 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? Quote
pendragon Posted November 30, 2005 Posted November 30, 2005 Hi fguihen Never used the report expert so don't 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 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 crReportDocument.RecordSelectionFormula = "{PatientTable.PatientID} = '12345'"; Hope this helps Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.