public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            Nyuukin_Ichihanyou rpt = new Nyuukin_Ichihanyou();

            rpt.Site = this.Site;
            return(rpt);
        }
        protected override void PrintSec()

        {
            // レコード定義を行う
            // DataTable table = new DataTable();



            if (ErrorCheck())
            {
                nie = GetNyuukinData();
                DataTable table = dtlog = nih.getPrintData(nie);

                try
                {
                    if (table == null)
                    {
                        return;
                    }

                    DialogResult ret;
                    var          Report = new DataSet.Nyuukin_Ichihanyou();

                    switch (PrintMode)
                    {
                    case EPrintMode.DIRECT:
                        ret = bbl.ShowMessage("Q202");
                        if (ret == DialogResult.Cancel)
                        {
                            return;
                        }
                        Report.SetDataSource(table);
                        Report.Refresh();
                        Report.SetParameterValue("txtStoreName", cbo_store.SelectedValue.ToString() + "  " + nie.cbo_store);
                        Report.SetParameterValue("txtDateTime", table.Rows[0]["yyyymmdd"].ToString() + "   " + table.Rows[0]["mmss"].ToString());
                        vr = previewForm.CrystalReportViewer1;
                        if (ret == DialogResult.Yes)
                        {
                            previewForm.CrystalReportViewer1.ShowPrintButton = true;
                            previewForm.CrystalReportViewer1.ReportSource    = Report;
                            previewForm.ShowDialog();
                        }
                        else         /// //Still Not Working because of Applymargin and Printer not Setting up  (PTK Will Solve)
                        {
                            CrystalDecisions.Shared.PageMargins margin = Report.PrintOptions.PageMargins;
                            margin.leftMargin   = DefaultMargin.Left;     // mmの指定をtwip単位に変換する
                            margin.topMargin    = DefaultMargin.Top;
                            margin.bottomMargin = DefaultMargin.Bottom;   //mmToTwip(marginLeft);
                            margin.rightMargin  = DefaultMargin.Right;
                            Report.PrintOptions.ApplyPageMargins(margin); /// Error Now
                            // プリンタに印刷
                            System.Drawing.Printing.PageSettings ps;
                            try
                            {
                                System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument();

                                CrystalDecisions.Shared.PrintLayoutSettings PrintLayout = new CrystalDecisions.Shared.PrintLayoutSettings();

                                System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();

                                Report.PrintOptions.PrinterName = "\\\\dataserver\\Canon LBP2900";
                                System.Drawing.Printing.PageSettings pSettings = new System.Drawing.Printing.PageSettings(printerSettings);

                                Report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;

                                Report.PrintOptions.PrinterDuplex = PrinterDuplex.Simplex;

                                Report.PrintToPrinter(printerSettings, pSettings, false, PrintLayout);
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                        break;

                    case EPrintMode.PDF:
                        bbl.ShowMessage("I202");

                        break;
                    }
                    var dt = new DataTable();
                    dt.Columns.Add("StoreCD");
                    for (int i = 0; i < dtlog.Rows.Count; i++)
                    {
                        if (!String.IsNullOrWhiteSpace(dtlog.Rows[i]["StoreCD"].ToString()) && !dtlog.Rows[i]["StoreCD"].Equals(null))
                        {
                            dt.Rows.Add(dtlog.Rows[i]["StoreCD"].ToString());
                        }
                    }
                    dt.AcceptChanges();
                    nih.L_Log_Insert_Print(new string[] { InOperatorCD, InPcID, InProgramID }, dt);
                }
                finally
                {
                    paymentstart.Focus();
                }
            }
        }