示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptBarcode rpt = new rptBarcode();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void frmBaoCaoBarcode_Load(object sender, EventArgs e)
        {
            try
            {
                switch (HanhDong)
                {
                case "MotCot":
                    if (Code.Length > 0)
                    {
                        Report.rptBarcode report = new Report.rptBarcode();
                        report.SetDataSource(Code);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close();
                    }
                    break;

                case "Loại A5":
                    if (Code.Length > 0)
                    {
                        Report.In_MaVach_Chuan report = new Report.In_MaVach_Chuan();
                        report.SetDataSource(Code);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close();
                    }
                    break;

                case "Loại 110":
                    if (Code.Length > 0)
                    {
                        Report.In_MaVach_ChuyenDung report = new Report.In_MaVach_ChuyenDung();
                        report.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;
                        //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                        report.SetDataSource(Code);
                        ////report.Section3.Height = 300;
                        //report.PrintOptions.PageContentHeight
                        //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                        crvReport.ReportSource = report;
                        //crvReport.Size = new Size(300, 100);
                        //crvReport.ToolPanelWidth = 300;
                        //report.Section3.Height = 400;
                        //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                        //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                case "Loại A4":
                    if (Code.Length > 0)
                    {
                        Report.In_MaVach_Khac report = new Report.In_MaVach_Khac();
                        report.SetDataSource(Code);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                case "TV":
                    if (_maVach.Length > 0)
                    {
                        Report.rptMaVachTheVip report = new Report.rptMaVachTheVip();
                        report.SetDataSource(_maVach);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                case "TGT":
                    if (_maVach.Length > 0)
                    {
                        Report.rptMaVachTheGT report = new Report.rptMaVachTheGT();
                        report.SetDataSource(_maVach);
                        crvReport.ReportSource = report;
                        crvReport.Show();
                    }
                    else
                    {
                        MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close();
                    }
                    break;

                default:
                    Close();
                    break;
                }
            }
            catch
            {
                MessageBox.Show("Thất bại"); Close();
            }
        }
示例#3
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptBarcode rpt = new rptBarcode();
     rpt.Site = this.Site;
     return rpt;
 }
        private void frmBaoCaoBarcode_Load(object sender, EventArgs e)
        {
            try
            {
                switch (HanhDong)
                {
                    case "MotCot":
                        if (Code.Length > 0)
                        {
                            Report.rptBarcode report = new Report.rptBarcode();
                            report.SetDataSource(Code);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close(); }
                        break;
                    case "Loại A5":
                        if (Code.Length > 0)
                        {
                            Report.In_MaVach_Chuan report = new Report.In_MaVach_Chuan();
                            report.SetDataSource(Code);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); this.Close(); }
                        break;

                    case "Loại 110":
                        if (Code.Length > 0)
                        {
                            Report.In_MaVach_ChuyenDung report = new Report.In_MaVach_ChuyenDung();
                            report.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;
                            //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                            report.SetDataSource(Code);
                            ////report.Section3.Height = 300;
                            //report.PrintOptions.PageContentHeight
                            //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                            crvReport.ReportSource = report;
                            //crvReport.Size = new Size(300, 100);
                            //crvReport.ToolPanelWidth = 300;
                            //report.Section3.Height = 400;
                            //report.PrintOptions.PaperSize = PaperSize.PaperLegal;
                            //report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    case "Loại A4":
                        if (Code.Length > 0)
                        {
                            Report.In_MaVach_Khac report = new Report.In_MaVach_Khac();
                            report.SetDataSource(Code);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    case "TV":
                        if (_maVach.Length > 0)
                        {
                            Report.rptMaVachTheVip report = new Report.rptMaVachTheVip();
                            report.SetDataSource(_maVach);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    case "TGT":
                        if (_maVach.Length > 0)
                        {
                            Report.rptMaVachTheGT report = new Report.rptMaVachTheGT();
                            report.SetDataSource(_maVach);
                            crvReport.ReportSource = report;
                            crvReport.Show();
                        }
                        else
                        { MessageBox.Show("Chưa có mã vạch để in hãy kiểm tra lại"); Close(); }
                        break;
                    default:
                        Close();
                        break;
                }
            }
            catch
            {
                MessageBox.Show("Thất bại"); Close();
            }
        }