コード例 #1
0
ファイル: frmInMaVach.cs プロジェクト: vanhungit/SaleManager
        public frmInMaVach(DataTable _dtable)
        {
            InitializeComponent();
            InMaVach       mavach    = new InMaVach();
            DataTable      dataTable = mavach.SanPham;
            BarcodeSanPham Report    = new BarcodeSanPham();

            foreach (DataRow datarow in _dtable.Rows)
            {
                DataRow drow = dataTable.NewRow();
                {
                    //drow["Barcode"] = "*";
                    drow["Barcode"] = "*" + datarow["Barcode"] + "*";
                    //drow["Barcode"] += "*";

                    drow["Product_ID"]   = datarow["Product_ID"];
                    drow["Product_Name"] = datarow["Product_Name"];
                    drow["Price"]        = datarow["Retail_Price"];
                    drow["Unit"]         = datarow["Unit"];
                }
                dataTable.Rows.Add(drow);
            }
            Report.Database.Tables["SanPham"].SetDataSource((DataTable)dataTable);
            crystalReportViewer1.ReportSource = Report;
            crystalReportViewer1.Refresh();
        }
コード例 #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BarcodeSanPham rpt = new BarcodeSanPham();

            rpt.Site = this.Site;
            return(rpt);
        }