Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...