c# - Fetching Data For crystal Report and displaying in it -
table1
doctorid(primary key),
fee,
fee-unit,
name
table2
doctorid(foreign key),
full name,
age
i have 2 tables ,i trying fetch rows in doctorid
same(to display in crysatal report
) ,i tried below query , working fine , giving me result shown in crystal report ,now problem
1)in crystal report doctor name
duplicating number of patients (which want show once )
2)same fee column fee duplicating number of patients
time
3)below fee column showing sum how give heading "total fee="
4)and if don't want show patient name count
shall use different datatables ? if b query getting number of patients
query
da = new oledbdataadapter(@"select d.[firstname]&' '&d.[lastname] [doctor name],d.[fee_unit], d.[fee],p.[pfirstname]&' '&p.[plastname] [patient name],p.[age],p.[birthdate],p.[mobileno]&' '&p.[landlineno] [contact number] doctor_master d,patient_registration p p.doctorid=" + drid + " , d.doctorid=" + drid, acccon);
you should first make sum(fee) totalfee, count(pname) total patient , grouped seleted field
Comments
Post a Comment