private void BIllreportprint_Load(object sender, EventArgs e) { BillPrintreport crystalReport = new BillPrintreport(); DataAccessLayer dal = new DataAccessLayer(); BillingDataset dsCustomers = dal.GetBillInfo(billinID); crystalReport.SetDataSource(dsCustomers); this.crystalReportViewer1.ReportSource = crystalReport; this.crystalReportViewer1.RefreshReport(); }
//strock entry finish--------------------------------------------------------- public BillingDataset GetBillInfo(string BillingID) { using (SqlConnection con = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand("SP_GetProductTransaction")) { cmd.Parameters.Add(new SqlParameter("@BillingID", BillingID)); cmd.CommandType = CommandType.StoredProcedure; using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (BillingDataset dsCustomers = new BillingDataset()) { sda.TableMappings.Add("Table", "DataTable1"); sda.TableMappings.Add("Table1", "DataTable2"); sda.Fill(dsCustomers); return(dsCustomers); } } } } }