Click here to Skip to main content
11,483,003 members (68,396 online)
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.8K
v3

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



Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 5 Apr 2012
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