Ejemplo n.º 1
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            AojPrint aojPrint = new AojPrint();
            aojPrint.Parse(TemplatesPath);

            aojPrint.Preview();
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            DataTable dt = new DataTable();

                DataColumn dcol = new DataColumn();
                dcol.ColumnName = "No";
                dt.Columns.Add(dcol);

                dcol = new DataColumn();
                dcol.ColumnName = "Jno";
                dt.Columns.Add(dcol);

                dcol = new DataColumn();
                dcol.ColumnName = "Name";
                dt.Columns.Add(dcol);

                dcol = new DataColumn();
                dcol.ColumnName = "Ukeymd";
                dt.Columns.Add(dcol);

                dcol = new DataColumn();
                dcol.ColumnName = "Kaijyo";
                dt.Columns.Add(dcol);

                dcol = new DataColumn();
                dcol.ColumnName = "Bikou";
                dt.Columns.Add(dcol);

                for (int n = 0; n < 13; n++)
                {
                    DataRow drNew = dt.NewRow();
                    drNew[0] = "No" + n.ToString();
                    drNew[1] = "Jno" + n.ToString();
                    drNew[2] = "Name" + n.ToString();
                    drNew[3] = "Ukeymd" + n.ToString();
                    drNew[4] = "Kaijyo" + n.ToString();
                    drNew[5] = "Bikou" + n.ToString();
                    dt.Rows.Add(drNew);
                }
                AojPrint aojprint = new AojPrint();
                AojPrintSettings settings = AojPrintSettings.CreateInstance();
                // settings.AojdPath = @"c:\Aojtest\as.aojd";
                string[] strpath = new string[]{
                  @"d:\Aojtest\Label.aojx"
                 //,@"c:\Aojtest\Label1.aojx"
                };
                aojprint.Parse(strpath);
                aojprint.PrintDataTable("G1", "paper1", dt, true);
                aojprint.Preview();
        }
Ejemplo n.º 3
0
        public void PrintTest()
        {
            AojPrint target = new AojPrint(); // TODO: Initialize to an appropriate value
            DataTable dt = new DataTable();

            DataColumn dcol = new DataColumn();
            dcol.ColumnName = "No";
            dt.Columns.Add(dcol);

            dcol = new DataColumn();
            dcol.ColumnName = "Jno";
            dt.Columns.Add(dcol);

            dcol = new DataColumn();
            dcol.ColumnName = "Name";
            dt.Columns.Add(dcol);

            dcol = new DataColumn();
            dcol.ColumnName = "Ukeymd";
            dt.Columns.Add(dcol);

            dcol = new DataColumn();
            dcol.ColumnName = "Kaijyo";
            dt.Columns.Add(dcol);

            dcol = new DataColumn();
            dcol.ColumnName = "Bikou";
            dt.Columns.Add(dcol);

            for (int n = 0; n < 13; n++)
            {
                DataRow drNew = dt.NewRow();
                drNew[0] = "No" + n.ToString();
                drNew[1] = "Jno" + n.ToString();
                drNew[2] = "Name" + n.ToString();
                drNew[3] = "Ukeymd" + n.ToString();
                drNew[4] = "Kaijyo" + n.ToString();
                drNew[5] = "Bikou" + n.ToString();
                dt.Rows.Add(drNew);
            }
            //AojPrint aojprint = new AojPrint();
            string[] strpath = new string[]{
                  @"d:\Aojtest\Label.aojx"
                };
            target.Parse(strpath);
            target.PrintDataTable("G1", "paper1", dt, true);
            target.Preview();
            Assert.AreEqual<int>(2, target.TotalPage);
        }
Ejemplo n.º 4
0
 public PreviewForm(PrintDocument printdocument,AojPrint aojprint)
 {
     InitializeComponent();
     this.InitControl();
     this.aojPrint = aojprint;
     this.aojPrintPreviewControl.Document = printdocument;
     this.tlsbZoom.SelectedIndexChanged += new EventHandler(tlsbZoom_SelectedIndexChanged);
     this.tlsbPrint.Click += new System.EventHandler(this.tlsbtnPrint_Click);
     this.tlsbPrv.Click += new EventHandler(tlsbtnPre_Click);
     this.tlsbPrvStart.Click += new EventHandler(tlsbPrvStart_Click);
     this.tlsbNext.Click += new EventHandler(tlsbtnNext_Click);
     this.tlsbNextEnd.Click += new EventHandler(tlsbNextEnd_Click);
     this.lblCurrentPage.Text = (aojprint.CurrentPage+1).ToString();
     this.lblAllPage.Text = aojprint.TotalPage.ToString();
 }