Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            reports_receipt rpt = new reports_receipt();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        private void rpt()
        {
            con.Open();
            DataSet1 ds = new DataSet1();

            adpt = new MySqlDataAdapter("SELECT * FROM tblorder WHERE Order_TransNo = '" + account.TransNo + "'", con);
            adpt.Fill(ds.tblorder);

            reports_receipt receipt = new reports_receipt();

            TextObject text1 = (TextObject)receipt.ReportDefinition.Sections["Section4"].ReportObjects["cashier"];

            text1.Text = account.UserFullName;

            TextObject text2 = (TextObject)receipt.ReportDefinition.Sections["Section4"].ReportObjects["OderType"];

            text2.Text = account.OrderType;

            TextObject text3 = (TextObject)receipt.ReportDefinition.Sections["Section4"].ReportObjects["tableNo"];

            if (account.StrTableNo == "")
            {
                text3.Text = "-";
            }
            else
            {
                text3.Text = account.StrTableNo;
            }

            receipt.SetDataSource(ds);

            frmReceipt rpt = new frmReceipt();

            rpt.crpReceipt.ReportSource = receipt;
            rpt.crpReceipt.RefreshReport();
            rpt.crpReceipt.RefreshReport();

            rpt.ShowDialog();
            con.Close();
        }