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 resultthe query is as bellwcreate proc FetchInvoice(@invoiceNo numeric(10) )asbegin 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=@invoiceNoendand the code which i am using to show this report is as bellowint 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 reportcan any one help me regarding this issue??thanks in advance 解决方案 这篇关于动态数据未显示在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 22:40
查看更多