Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I want to create Crystal Report on asp.net with C#
 
I have two tables 'Sales,TempSales'
 
In my table has following
Sales
Billno  Billdate  BillAmount Tax TPTCharge ..........NetTotal
E001     3/4/2012   3000      1    1.................3500
E002     4/4/2012    2000     2    2.................2200
TempSales
Billno  Item     Qty Rate Amount
 
E001    kova       1  20    20
E001    kalakandu  2  30  60
E002     Paneer    1   40  40
E002      cheese    1   50  50
I want to get report from Both tables
 
So i give the following code but it is not working
 

   SqlDataAdapter da = new SqlDataAdapter("Select T1.Billno,T1.Billdate,T1.BillAmount,T1.TPTCharge,T1.LBCharge,T1.Nettotal,T1.Tax,T1.Discount,T1.CName,T1.ONo,T1.Vno,T2.Item,T2.qty,T2.Rate,T2.Rate_Typ,T2.Amount,T2.Tax from Sales T1,Tempsales T2 where T1.Billno=T2.Billno and T2.Billno=T1.Billno and T1.Billdate>='" + DateTime.Parse(TextBox1.Text).ToString("MM/dd/yyyy") +"' and T1.Billdate<='" + DateTime.Parse(TextBox2.Text).ToString("MM/dd/yyyy") +"' order By T1.Billno", connect.cn());
     
The report is display all the records in second table
 
I give the following code to generate report
  ReportDocument rptdoc = new ReportDocument();
        rptdoc.Load(Server.MapPath("SalesReport.rpt"));
        rptdoc.SetDataSource(ds.Tables[0]);
      
Please anybody help for this problem
Posted 5-Apr-12 1:00am
devausha1.4K
Edited 5-Apr-12 1:04am
(no name)15.7K
v3

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

  Print Answers RSS
0 OriginalGriff 290
1 Jochen Arndt 150
2 Kornfeld Eliyahu Peter 149
3 PIEBALDconsult 110
4 Richard MacCutchan 105
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 5 Apr 2012
Copyright © CodeProject, 1999-2014
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