Example #1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                documentViewer1.PrintingSystem = null;
                rptQuotation _rptQuotation = new rptQuotation();
                sprptQuotationTableAdapter.Fill(dsrptQuotation.sprptQuotation, gridLookUpEdit1.EditValue.ToString(), AppConstant.CompCode);
                _rptQuotation.DataSource       = dsrptQuotation.sprptQuotation;
                _rptQuotation.DataSourceSchema = dsrptQuotation.sprptQuotation.DataSet.GetXmlSchema();
                _rptQuotation.DataMember       = "sprptQuotation";
                _rptQuotation.CreateDocument();

                this.documentViewer1.DocumentSource = _rptQuotation;
            }
            catch (Exception)
            {
                MessageBox.Show("Sorry! There are no records for specified parameters.");
            }
        }
       public void LunchQoutation()
        {
            try
            {

                documentViewer1.PrintingSystem = null;
                rptQuotation _rptQuotation = new rptQuotation();
                sprptQuotationTableAdapter.Fill(dsrptQuotation.sprptQuotation,AppConstant.Quotation, AppConstant.CompCode);
                _rptQuotation.DataSource = dsrptQuotation.sprptQuotation.DataSet;
                _rptQuotation.DataSourceSchema = dsrptQuotation.sprptQuotation.DataSet.GetXmlSchema();
                _rptQuotation.DataMember = "sprptQuotation";
                _rptQuotation.CreateDocument();

                this.documentViewer1.DocumentSource = _rptQuotation;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry! There are no records for specified parameters.");
            }
        }