Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I have an SQLquery like...

SQL
select PurchaseDetails.order_no, PurchaseDetails.order_date, PurchaseDetails.sup_name, PurchaseDetailsCHILD.Prod_name,PurchaseDetailsCHILD.prod_qty,PurchaseDetailsCHILD.Amt_per_piece,PurchaseDetails.VAT,PurchaseDetails.Discount,PurchaseDetails.Netamt
from PurchaseDetailsCHILD join PurchaseDetails
on PurchaseDetails.Purchd_id = PurchaseDetailsCHILD.Purchd_id



While i fill my datatable it contains only two records...But after i set it as my datasource like...

MIDL
rpt.SetDataSource(myDatatable); //here is the datatable contains result of my query
CrystalReportViewer1.ReportSource = rpt;


It displays the records twice(Creating duplicate records)....

Even i check after inserting another row in my table....
if my datatable contains three records then my crystalrpt contains Eight records.


I'm having two different tables inside my crystalreport DatabaseFields by refering PURCHD_ID. I don't know how it assume's their links...Even i deleted those links(in "Database Expert"--> "link" tab) it didnt work...

As finally i made a check by remove the line "rpt.SetDataSource(myDatatable);". Its works fine....but what i need is, i'm dynamically passing query. Actually i need filter the Query results through this Datatable only. So, i need it.

Please give me your suggestions....
Posted
Updated 15-Jul-11 2:41am
v3
Comments
Member 9960222 4-Sep-13 6:19am    
how to get crystal report for two tables in asp.net

My be you could try on crystal report

File -> Report Option , then "check on" "Select Distinct Records".

or

make sure your PurchaseDetailsCHILD have no repeat key. (usually we join with PurchaseHeader)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900