hello everyone...
I m currently using vs2010. In that i want to generate crystal report for invoice.
My database tables are Table 'A' and Table 'B' which are as follows
-----------------------------------------------------------------
Table 'A'
------------------------------------------------------------------
invoiceid | invoicedate | subtotal | tax1 | tax2 | Grand Total
1 07/13/2012 500.00 VAT CST 700
2 09/08/2011 800.00 VAT Sales 1000
------------------------------------------------------------------
-----------------------------------------------------------------
Table 'B'
------------------------------------------------------------------
invoiceid | invdetid | itemno | itemname | qty | rate | amount
1 1 1 item A 5 10.0 50.0
1 2 2 item B 3 5.00 15.00
2 3 1 item A 10 12.00 120.00
------------------------------------------------------------------
so here..i m using dataset in which, i m taking two tables,i.e. Table 'A' and
Table 'B'
and my query in procedure is
select A.invoiceid,A.invoicedate,A.subtotal,A.tax1,A.tax2,A.Grand Total,
B.invoiceid,B.invdetid,B.itemno,B.itemname,B.qty,B.rate,B.amount
from Table A,Table B
where A.invoiceid=B.invoiceid
so by this query i m getting result by invoice number.
My aspx.cs code is
---------------------
Con = new SqlConnection(strConnString);
Con.Open();
cmd.CommandText ="TestReport";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = Con;
adapter = new SqlDataAdapter(cmd);
ds = new DataSet();
adapter.Fill(ds,"A");
adapter.Fill(ds,"B");
rptDoc.Load(Server.MapPath("/Report/InvoiceReport.rpt"));
rptDoc.SetDataSource(ds);
CrystalReportViewer1.ReportSource = rptDoc;
CrystalReportViewer1.RefreshReport();
-------------------------------------------
here i m getting data in dataset ..but while displaying it is showing no data on report..
please help..
Thanks in advance