Exemplo n.º 1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (vOpenMode == false)
                {
                    return;
                }
                string vWhere = string.Empty;

                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                vWhere = "AND Sale.SaleID=" + this.txt_InvNo.Text;

                DAL.Reports Msc = new DAL.Reports();
                Msc.connectionstring = objDAL.connectionstring;


                DataTable dt = Msc.getSaleInvoices(vWhere);
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }

                int vStyle = 0;

                if (chkLetterPad.Checked)
                {
                    vStyle = 2;
                }

                if (chkInUrdu.Checked)
                {
                    vStyle = 1;
                }



                vForm.SaleInvoicePrint(dt, vStyle);
                vForm.ShowDialog();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }