private void btnPreviewReport_Click(object sender, EventArgs e)
        {
            dsReport ds   = new dsReport();
            DataSet  dsSP = bllReports.GetSalesInvoice(this.txtInvoiceNumber.Text.Trim());

            try
            {
                foreach (DataRow dr in dsSP.Tables[0].Rows)
                {
                    ds.Tables["SalesParentInfo"].ImportRow(dr);
                }
                foreach (DataRow dr in dsSP.Tables[1].Rows)
                {
                    ds.Tables["SalesChildInfo"].ImportRow(dr);
                }
                foreach (DataRow dr in bllCompanyInfo.getById(1).Rows)
                {
                    ds.Tables["CompanyInfo"].ImportRow(dr);
                }

                rptSalesInvoice_Large rptTest = new Report.rptSalesInvoice_Large();
                rptTest.SetDataSource(ds);
                //rptTest.PrintToPrinter(1, false, 0, 0);
                frmRptv obj = new frmRptv();
                obj.SetReportDataSource = rptTest;
                obj.ShowDialog();
            }
            catch
            { }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_SelctedInvoice == "")
            {
                XtraMessageBox.Show("You have not select any invoice.", "Information");
            }
            else
            {
                string   SalesReturn = bllReportUtility.ReportData("Select IsNull(SalesReturn,0) from SalesParentInfo where InvoiceNo='" + _SelctedInvoice + "'").Rows[0][0].ToString();
                dsReport ds          = new dsReport();
                DataSet  dsSP        = bllReports.GetSalesInvoice(_SelctedInvoice);
                try
                {
                    foreach (DataRow dr in dsSP.Tables[0].Rows)
                    {
                        ds.Tables["SalesParentInfo"].ImportRow(dr);
                    }
                    foreach (DataRow dr in dsSP.Tables[1].Rows)
                    {
                        ds.Tables["SalesChildInfo"].ImportRow(dr);
                    }
                    foreach (DataRow dr in bllCompanyInfo.getById(1).Rows)
                    {
                        ds.Tables["CompanyInfo"].ImportRow(dr);
                    }
                    rptSalesInvoice_Large rptTest = new Report.rptSalesInvoice_Large();


                    rptTest.SetDataSource(ds);
                    rptTest.SetParameterValue("SalesReturn", bllUtility.Val(SalesReturn));
                    //rptTest.PrintToPrinter(1, false, 0, 0);

                    frmRptv obj = new frmRptv();
                    obj.SetReportDataSource = rptTest;
                    obj.ShowDialog();
                }
                catch
                { }
            }
        }