Click here to Skip to main content
11,802,636 members (70,761 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# CrystalReports
string query = "SELECT Account_Credit.Transaction_No, Account_Credit.Amount_Credit, Account_Credit.Credit_Date, Account_Credit.Total_Amount_Credit,     Account_Debit.Transaction_No, Account_Debit.Amount_Debit, Account_Debit.Debit_Date, Account_Debit.Total_Amount_Debit, Accounts.Account_No FROM Account_Credit INNER JOIN     Account_Debit ON Account_Credit.Transaction_No = Account_Debit.Transaction_No INNER JOIN Accounts ON Account_Credit.Account_No = Accounts.Account_No and Accounts.Account_No='" + cboaccount1.Text + "-" + cboaccount2.Text + "'";
                   da = new SqlDataAdapter(query, cn);
                   DataTable dt = new DataTable();
                   if (dt.Rows.Count == 0)
                       MessageBox.Show("The Complete Info of Account No'" + cboaccount1.Text + "-" + cboaccount2.Text + "'does not Exists!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                  CrystalReport1 crt = new CrystalReport1();
                       Report_Viewer rpt = new Report_Viewer();
                       rpt.crystalReportViewer1.ReportSource = crt;
Posted 11-Jan-13 2:10am
Edited 12-Jan-13 16:31pm
Sandeep Mewara at 11-Jan-13 10:41am
You sure have data? Further, is crystal report designed to show data? Automatically it will not show the data.
zeshanazam at 11-Jan-13 10:45am
yeah i m sure..
Sandeep Mewara at 11-Jan-13 10:52am
You designed properly to show data? Mapped fields?
zeshanazam at 11-Jan-13 11:01am is accessing from 3 tables.
Sandeep Mewara at 11-Jan-13 11:03am
Not accessing. Are they mapped to some field in report?
zeshanazam at 11-Jan-13 11:05am
i made three datatables, made their relations and drag fields to report from datatables.
Dharmendra-18 at 13-Jan-13 2:48am
for this data fields name will be same as table column name.

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

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100