im trying to display data from multiple tablesinto single report with the simple query with joins but when i am running bpage then the crystal report is completly empty means its not fetching data from database,but when i am execeuting that query in sql server it shows me a proper result
the query is as bellw
create proc FetchInvoice
(@invoiceNo numeric(10) )
as
begin
SELECT c.CompanyName,c.ExciseNo,c.VATNo,c.CSTNo,c.CompanyId,
com.AddressId,com.AddressLine1,com.CompanyCity,com.Country,com.Pin,com.State,
cust.Cust_First_Name,cust.Cust_Last_Name,cust.ContactNo,cust.EmailId,
h.CustomerPONo,h.Fi_Year,h.FinalInvoicePrice,
h.FinalInvoicePrice_WithoutRO,h.inv_date,h.invoice_no,
h.RO_Fact,h.TaxPrice,h.TaxTerms,h.CompanyId,
l.Item,l.Description,l.Quantity,l.TeriffClass,l.Unite_Price,l.Total_Price
FROM company_master c
INNER JOIN
companyaddress AS Com
ON c.CompanyId=Com.AddressId
INNER JOIN customeraddress as cust
on c.CompanyId=cust.Cust_Add_Id
inner join Header as h
on c.CompanyId=h.CompanyId
inner join invoiceItems as l
on h.invoice_no=l.invoice_no
where h.invoice_no=@invoiceNo
end
and the code which i am using to show this report is as bellow
int invNo = 1;
SqlConnection con = new SqlConnection(CS);
SqlCommand cmd = new SqlCommand();
TaxInvoice ds = null;
SqlDataAdapter adapter;
try
{
con.Open();
cmd.CommandText = "FetchInvoice";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@invoiceNo", invNo);
cmd.Connection = con;
cmd.ExecuteNonQuery();
ds = new TaxInvoice();
adapter = new SqlDataAdapter(cmd);
adapter.Fill(ds);
ReportDocument rd = new ReportDocument();
rd.Load(Server.MapPath("Invoicereport.rpt"));
rd.SetDataSource(ds.Tables[1]);
CrystalReportViewer1.ReportSource = rd;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
but at the end i am getting is empty report
can any one help me regarding this issue??
thanks in advance