Esempio n. 1
0
        private void invoiceNoComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string query = "";

            query = "Select * From TbAfterManufactureStockOut Where  EmployeeName = @EmployeeName Order By StockOutDate";
            if (query != "")
            {

                SqlConnection conn = new SqlConnection(this.connectionString);
                SqlCommand comm = new SqlCommand(query, conn);

                comm.Parameters.Add("@EmployeeName", SqlDbType.VarChar, 50);
                comm.Parameters["@EmployeeName"].Value = invoiceNoComboBox.Text;

                SqlDataAdapter adap = new SqlDataAdapter();
                StockOutDataSet dataset = new StockOutDataSet();
                StockOutCrystalReport crp = new StockOutCrystalReport();

                try
                {
                    conn.Open();
                    adap.SelectCommand = comm;
                    adap.Fill(dataset, "DataTable1");

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
                finally
                {
                    conn.Close();
                }
                crp.SetDataSource(dataset);
                crystalReportViewer1.ReportSource = crp;
            }
        }
Esempio n. 2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     StockOutCrystalReport rpt = new StockOutCrystalReport();
     rpt.Site = this.Site;
     return rpt;
 }