private void AddBarcodeObject()
        {
            if (!CheckLicense())
            {
                return;
            }

            if (SelectedLabelView != null && SelectedLabelView.DataContext is LabelViewModel)
            {
                var newBarcode = new BarcodeObject();
                newBarcode.Name = "NewBarcode";

                var optionViewModel = new OptionBarcodeViewModel(newBarcode, true);
                var optionView      = new OptionBarcodeView();
                optionView.DataContext = optionViewModel;

                if (DialogService.ShowSelectDialog(Application.Current.MainWindow, optionView, "Create New Barcode") == true)
                {
                    var thisViewModel = SelectedLabelView.DataContext as LabelViewModel;
                    thisViewModel.ObjectList.Add(newBarcode);
                    newBarcode.IsChanged = true;

                    foreach (var obj in thisViewModel.ObjectList)
                    {
                        obj.IsSelected = false;
                    }

                    newBarcode.IsSelected = true;
                }
            }
        }
Esempio n. 2
0
        private Stream CreateBarcodeImageStream(PrintElementBuildContext buildContext, dynamic elementMetadata, PrintElementSize imageSize)
        {
            string textSting = BuildHelper.FormatValue(buildContext, elementMetadata.Text, elementMetadata.SourceFormat);

            textSting = PrepareText(textSting);

            if (textSting != null)
            {
                bool showText;
                showText = !ConvertHelper.TryToBool(elementMetadata.ShowText, out showText) || showText;

                // Для генерации штрих-кода используется функциональность FastReport

                try
                {
                    var barcode = new BarcodeObject
                    {
                        Barcode  = CreateBarcode(elementMetadata),
                        ShowText = showText,
                        Text     = textSting,
                        Height   = 64
                    };

                    // Для получения размеров штрих-кода рисуем его первый раз
                    using (var codeBmp = new Bitmap(1, 1))
                        using (var graphics = Graphics.FromImage(codeBmp))
                            using (var graphicCache = new GraphicCache())
                            {
                                barcode.Draw(new FRPaintEventArgs(graphics, 1, 1, graphicCache));
                            }

                    // Теперь, зная размеры штрих-кода, рисуем его второй раз
                    if (barcode.Width > 0 && barcode.Height > 0)
                    {
                        using (var codeBmp = new Bitmap((int)barcode.Width, (int)barcode.Height))
                            using (var graphics = Graphics.FromImage(codeBmp))
                                using (var graphicCache = new GraphicCache())
                                {
                                    graphics.Clear(Color.White);
                                    barcode.Draw(new FRPaintEventArgs(graphics, 1, 1, graphicCache));

                                    imageSize.Width  = codeBmp.Width;
                                    imageSize.Height = codeBmp.Height;

                                    var codeStream = new MemoryStream();
                                    codeBmp.Save(codeStream, ImageFormat.Png);
                                    codeStream.Seek(0, SeekOrigin.Begin);

                                    return(codeStream);
                                }
                    }
                }
                catch
                {
                }
            }

            return(null);
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a BarcodeObject instance with specified name and parent.
        /// </summary>
        /// <param name="name">The name of the BarcodeObject instance.</param>
        /// <param name="parent">The parent of the BarcodeObject instance.</param>
        /// <returns>The BarcodeObject instance.</returns>
        public static BarcodeObject CreateBarcodeObject(string name, Base parent)
        {
            BarcodeObject barcode = new BarcodeObject();

            barcode.Name   = name;
            barcode.Parent = parent;
            return(barcode);
        }
        private void DrawBarcode(
            string sysName, string sysCode, ref PrintConfigSystemBarcode c)
        {
            DrawString(c.Graphics, c.Font, sysName, c.AlignCenter - 12, c.DrawHeightPosition);
            c.DrawHeightPosition += c.LineHeight - 3;

            var barcode = new BarcodeObject(sysCode).GetBitmap();

            c.Graphics.DrawImage(barcode, c.AlignCenter - 13, c.DrawHeightPosition, barcode.Width * 0.34f, barcode.Height * 0.14f);
            c.DrawHeightPosition += c.LineHeight + 10;
        }
        /// <summary>
        /// Creates a BarcodeObject instance with specified name and parent.
        /// </summary>
        /// <param name="name">The name of the BarcodeObject instance.</param>
        /// <param name="parent">The parent of the BarcodeObject instance.</param>
        /// <returns>The BarcodeObject instance.</returns>
        public static BarcodeObject CreateBarcodeObject(string name, Base parent)
        {
            BarcodeObject barcode = new BarcodeObject();

            barcode.Name = name;
            if ((parent as IParent).CanContain(barcode))
            {
                barcode.Parent = parent;
            }
            return(barcode);
        }
        private void LoadBarCode(string name, Base parent)
        {
            string        description = GetObjectDescription(name);
            BarcodeObject barcode     = ComponentsFactory.CreateBarcodeObject(name, parent);

            LoadComponent(description, barcode);
            LoadSize(description, barcode);
            LoadBorder(description, barcode.Border);
            barcode.FillColor = UnitsConverter.ConvertBackColor(GetPropertyValue("BackColor", description));
            UnitsConverter.ConvertBarcodeSymbology(GetPropertyValue("Symbology", description), barcode);
            barcode.Style = GetPropertyValue("StyleName", description).Replace("\"", "");
        }
Esempio n. 7
0
        public void GenerateBarcode_WithCode39_ShouldReturnBase64String()
        {
            // Arrange
            const string codabarType = "code39";
            const string value       = "A123*";

            // Act
            Barcode       barcode    = new Barcode();
            BarcodeObject calculated = barcode.GenerateBarcode(codabarType, value);

            // Assert
            Assert.That(calculated.ImageBytes.Length, Is.EqualTo(4307));
        }
Esempio n. 8
0
        public void GenerateBarcode_WithEan8_ShouldReturnBase64String()
        {
            // Arrange
            const string codabarType = "ean8";
            const string value       = "12435689";

            // Act
            Barcode       barcode    = new Barcode();
            BarcodeObject calculated = barcode.GenerateBarcode(codabarType, value);

            // Assert
            Assert.That(calculated.ImageBytes.Length, Is.EqualTo(5962));
        }
Esempio n. 9
0
        /// <summary>
        /// WXY扩展-设置二维码对象-指定条码类型
        /// </summary>
        /// <param name="report"></param>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="borcodetype"></param>
        public static BarcodeObject SetBarcodeObject_Text(this Report report, string key, string value, BarcodeBase borcodetype)
        {
            BarcodeObject barcode = null;
            var           obj     = report.FindObject(key);

            if (obj != null)
            {
                if (obj is BarcodeObject)
                {
                    barcode         = obj as BarcodeObject;
                    barcode.Barcode = borcodetype;
                    barcode.Text    = value;
                }
            }
            return(barcode);
        }
Esempio n. 10
0
        private void LoadBarcode(XmlNode node, Base parent)
        {
            BarcodeObject barcode = ComponentsFactory.CreateBarcodeObject(node.Name, parent);

            AddLocalizationItemsAttributes(node);
            barcode.AutoSize = false;
            LoadComponent(node, barcode);
            LoadSize(node, barcode);
            LoadBorder(node, barcode.Border);
            barcode.FillColor = UnitsConverter.ConvertBackColor(GetAttribute(node, "BackColor"));
            string symbology = GetAttribute(FindChildNoteByName(node, "symbology"), "Name");

            UnitsConverter.ConvertBarcodeSymbology(symbology, barcode);
            barcode.Text = GetAttribute(node, "Text");
            ApplyStyle(node, barcode);
            barcode.ShowText = !AttributeExist(node, "ShowText");
        }
Esempio n. 11
0
        /// <summary>
        /// Converts to base64 string.
        /// </summary>
        /// <param name="img">The img.</param>
        /// <returns></returns>
        public BarcodeObject ConvertToBase64String(Image img)
        {
            BarcodeObject barcodeObject = new BarcodeObject();

            using (var memoryStream = new MemoryStream())
            {
                using (var image = img)
                {
                    image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Png);
                }

                barcodeObject.Base64Image = Convert.ToBase64String(memoryStream.ToArray());
                barcodeObject.ImageBytes  = memoryStream.ToArray();
            }

            return(barcodeObject);
        }
 public PrintItemObject(string barcode, string itemName, string storeName)
 {
     Barcode   = new BarcodeObject(barcode);
     ItemName  = itemName;
     StoreName = storeName;
 }
Esempio n. 13
0
        private void reportShow()
        {
            this.Invoke(new setStatusDelegate1(setStatus));
            int i = 0, j = 0;
            dbHepler db = new dbHepler();

            string sql = this.Invoke(new getsql(generatesql)) as string;
            MessageBox.Show(sql);
            // string sql = "select * from [20028] where XH='128590'";
            DataSet Student = db.LoadData(sql);
            report.Pages.Clear();
            //report.Load("Untitled.frx");
            ;

            //DataBand data = (DataBand)report.FindObject("data1");

            for (i = 0; i < Student.Tables[0].Rows.Count / 10; i++)
            {
                ReportPage page1 = new ReportPage();

                report.Pages.Add(page1);

                DataBand data = new DataBand();
                page1.Bands.Add(data);
                for (j = 0; j < 10; j++)
                {

                    TextObject text1 = new TextObject();
                    if (j % 2 == 0)
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 4, Units.Centimeters * 3 * j, Units.Centimeters * 5, Units.Centimeters * 0.6f);
                    }
                    else
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 4, Units.Centimeters * 3 * (j - 1), Units.Centimeters * 5, Units.Centimeters * 0.6f);

                    }

                    text1.Text = Student.Tables[0].Rows[10 * i + j]["name"].ToString();
                    data.Objects.Add(text1);

                    PictureObject pic = new PictureObject();
                    if (j % 2 == 0)
                    {
                        pic.Bounds = new RectangleF(0, Units.Centimeters * 3 * j, Units.Centimeters * 2, Units.Centimeters * 2);
                    }
                    else
                    {
                        pic.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (j - 1), Units.Centimeters * 2, Units.Centimeters * 2);

                    }
                    if (File.Exists("./" + "20"+Student.Tables[0].Rows[10 * i + j]["XH"].ToString().Substring(0,2) + "/" + Student.Tables[0].Rows[10 * i + j]["XH"].ToString()+ ".jpg"))
                        pic.Image = Image.FromFile("./" +"20"+ Student.Tables[0].Rows[10 * i + j]["XH"].ToString().Substring(0,2) + "/" + Student.Tables[0].Rows[10 * i + j]["XH"].ToString() + ".jpg");
                    data.Objects.Add(pic);

                    BarcodeObject bar = new BarcodeObject();
                    if (j % 2 == 0)
                    {
                        bar.Bounds = new RectangleF(0, Units.Centimeters * 3 * j + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);
                    }
                    else
                    {
                        bar.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (j - 1) + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);

                    }
                    //pic.Image = Image.FromFile("100001.jpg");
                    bar.Text = Student.Tables[0].Rows[10 * i + j]["ZKZH"].ToString();
                    data.Objects.Add(bar);

                }

            }

            if (Student.Tables[0].Rows.Count % 10 != 0)
            {
                Console.WriteLine((10 * i + j).ToString());
                ReportPage page2 = new ReportPage();

                report.Pages.Add(page2);

                DataBand data2 = new DataBand();
                page2.Bands.Add(data2);

                for (int k = 10 * (i - 1) + j; k < Student.Tables[0].Rows.Count; k++)
                {

                    TextObject text1 = new TextObject();
                    if (k % 2 == 0)
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 4, Units.Centimeters * 3 * (k % 10), Units.Centimeters * 5, Units.Centimeters * 0.6f);
                    }
                    else
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 4, Units.Centimeters * 3 * (k % 10 - 1), Units.Centimeters * 5, Units.Centimeters * 0.6f);

                    }

                    text1.Text = Student.Tables[0].Rows[k]["name"].ToString();
                    data2.Objects.Add(text1);

                    PictureObject pic = new PictureObject();
                    if (k % 2 == 0)
                    {
                        pic.Bounds = new RectangleF(0, Units.Centimeters * 3 * k % 10, Units.Centimeters * 2, Units.Centimeters * 2);
                    }
                    else
                    {
                        pic.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (k % 10 - 1), Units.Centimeters * 2, Units.Centimeters * 2);

                    }
                    if (File.Exists("./" + "20" + Student.Tables[0].Rows[k]["XH"].ToString().Substring(0,2) + "/" + Student.Tables[0].Rows[k]["XH"].ToString() + ".jpg"))
                        pic.Image = Image.FromFile("./" + "20"+Student.Tables[0].Rows[k]["XH"].ToString().Substring(0,2) + "/" + Student.Tables[0].Rows[k]["XH"].ToString()+ ".jpg");
                    data2.Objects.Add(pic);

                    BarcodeObject bar = new BarcodeObject();
                    if (k % 2 == 0)
                    {
                        bar.Bounds = new RectangleF(0, Units.Centimeters * 3 * (k % 10) + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);
                    }
                    else
                    {
                        bar.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (k % 10 - 1) + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);

                    }
                    //pic.Image = Image.FromFile("100001.jpg");
                    bar.Text = Student.Tables[0].Rows[k]["ZKZH"].ToString();
                    data2.Objects.Add(bar);

                }
            }
            this.Invoke(new setStatusDelegate1(setStatus2));
            this.Invoke(new setStatusDelegate1(reportShow1));
        }
Esempio n. 14
0
 /// <summary>
 /// Converts the DevExpress Barcode.Symbology to Barcode.Barcode.
 /// </summary>
 /// <param name="symbology">The DevExpress Barcode.Symbology value as string.</param>
 /// <param name="barcode">The BarcodeObject instance.</param>
 public static void ConvertBarcodeSymbology(string symbology, BarcodeObject barcode)
 {
     symbology = symbology.ToLower();
     if (symbology.Contains("codabar"))
     {
         barcode.Barcode = new BarcodeCodabar();
     }
     else if (symbology.Contains("code128"))
     {
         barcode.Barcode = new Barcode128();
     }
     else if (symbology.Contains("code39"))
     {
         barcode.Barcode = new Barcode39();
     }
     else if (symbology.Contains("code39extended"))
     {
         barcode.Barcode = new Barcode39Extended();
     }
     else if (symbology.Contains("code93"))
     {
         barcode.Barcode = new Barcode93();
     }
     else if (symbology.Contains("code9eextended"))
     {
         barcode.Barcode = new Barcode93Extended();
     }
     else if (symbology.Contains("codemsi"))
     {
         barcode.Barcode = new BarcodeMSI();
     }
     else if (symbology.Contains("datamatrix"))
     {
         barcode.Barcode = new BarcodeDatamatrix();
     }
     else if (symbology.Contains("ean128"))
     {
         barcode.Barcode = new BarcodeEAN128();
     }
     else if (symbology.Contains("ean13"))
     {
         barcode.Barcode = new BarcodeEAN13();
     }
     else if (symbology.Contains("ean8"))
     {
         barcode.Barcode = new BarcodeEAN8();
     }
     else if (symbology.Contains("industrial2of5"))
     {
         barcode.Barcode = new Barcode2of5Industrial();
     }
     else if (symbology.Contains("interleaved2of5"))
     {
         barcode.Barcode = new Barcode2of5Interleaved();
     }
     else if (symbology.Contains("matrix2of5"))
     {
         barcode.Barcode = new Barcode2of5Matrix();
     }
     else if (symbology.Contains("pdf417"))
     {
         barcode.Barcode = new BarcodePDF417();
     }
     else if (symbology.Contains("postnet"))
     {
         barcode.Barcode = new BarcodePostNet();
     }
     else if (symbology.Contains("qrcode"))
     {
         barcode.Barcode = new BarcodeQR();
     }
     else if (symbology.Contains("upca"))
     {
         barcode.Barcode = new BarcodeUPC_A();
     }
     else if (symbology.Contains("upce0"))
     {
         barcode.Barcode = new BarcodeUPC_E0();
     }
     else if (symbology.Contains("upce1"))
     {
         barcode.Barcode = new BarcodeUPC_E1();
     }
     else if (symbology.Contains("upcsupplemental2"))
     {
         barcode.Barcode = new BarcodeSupplement2();
     }
     else if (symbology.Contains("upcsupplemental5"))
     {
         barcode.Barcode = new BarcodeSupplement5();
     }
 }
Esempio n. 15
0
        public void PrintReceipt(ListView itemList, string deposit, PrintPageEventArgs e, string accountCode)
        {
            var marginMin   = 3;
            var marginMax   = 70;
            var alignCenter = 27;
            var lineHeight  = 7;

            var drawHeightPosition = 0;

            var graphics = e.Graphics;

            graphics.PageUnit = GraphicsUnit.Millimeter;
            var font    = new Font("MS UI Gothic", 10);
            var fontBig = new Font("MS UI Gothic", 13);

            graphics.DrawImage(Image.FromFile(@"Kids.jpg"), 3, 3, 67, 20);
            drawHeightPosition += lineHeight + 22;

            DrawString(graphics, fontBig, "<レシート>", alignCenter, drawHeightPosition);
            drawHeightPosition += lineHeight + 3;

            DrawString(graphics, font, DateTime.Now.ToString("yyyy年MM月dd日 HH時mm分ss秒"),
                       marginMin,
                       drawHeightPosition);
            drawHeightPosition += lineHeight;

            graphics.DrawLine(new Pen(Brushes.Black),
                              new Point(marginMin, drawHeightPosition),
                              new Point(marginMax, drawHeightPosition));
            drawHeightPosition += lineHeight;

            for (var i = 0; i < itemList.Items.Count; i++)
            {
                var lvi = itemList.Items[i];
                DrawString(graphics, fontBig, lvi.SubItems[0].Text + "  " + lvi.SubItems[1].Text, marginMin, drawHeightPosition);
                DrawString(graphics, fontBig, "\t\t\\" + lvi.SubItems[3].Text, marginMin + 15, drawHeightPosition);
                drawHeightPosition += lineHeight;
            }
            graphics.DrawLine(new Pen(Brushes.Black),
                              new Point(marginMin, drawHeightPosition),
                              new Point(marginMax, drawHeightPosition));
            drawHeightPosition += lineHeight;

            var sum = 0;

            foreach (ListViewItem v in itemList.Items)
            {
                sum += int.Parse(v.SubItems[3].Text);
            }

            DrawString(graphics, fontBig, "ごうけい", marginMin, drawHeightPosition);
            DrawString(graphics, fontBig, "\t\t\\" + sum, marginMin + 15, drawHeightPosition);
            drawHeightPosition += lineHeight;

            DrawString(graphics, fontBig, "おあずかり", marginMin, drawHeightPosition);
            DrawString(graphics, fontBig, "\t\t\\" + deposit, marginMin + 15, drawHeightPosition);
            drawHeightPosition += lineHeight;

            DrawString(graphics, fontBig, "おつり", marginMin, drawHeightPosition);
            DrawString(graphics, fontBig, "\t\t\\" + (int.Parse(deposit) - sum), marginMin + 15, drawHeightPosition);
            drawHeightPosition += lineHeight;
            drawHeightPosition += lineHeight;

            DrawString(graphics, fontBig, "おみせ: " + Config.GetInstance().Store.Name, marginMin, drawHeightPosition);
            drawHeightPosition += lineHeight;

            DrawString(graphics, fontBig, "れじのたんとう: " + PosInformation.GetInstance().GetStaffName(), marginMin, drawHeightPosition);
            drawHeightPosition += lineHeight + 5;


            DrawString(graphics, fontBig,
                       "印字保護のためこちらの面を" + Environment.NewLine +
                       "内側に折って保管してください", marginMin + 3, drawHeightPosition);
            drawHeightPosition += lineHeight;
            drawHeightPosition += lineHeight;

            var barcode = new BarcodeObject(accountCode).GetBitmap();

            graphics.DrawImage(barcode, alignCenter - 13, drawHeightPosition, barcode.Width * 0.34f, barcode.Height * 0.14f);
            drawHeightPosition += lineHeight + 10;

            graphics.DrawLine(new Pen(Brushes.Black),
                              new Point(marginMin, drawHeightPosition),
                              new Point(marginMax, drawHeightPosition));

            e.HasMorePages = false;
        }
Esempio n. 16
0
        private void reportShow()
        {
            this.Invoke(new setStatusDelegate1(setStatus));
            int      i = 0, j = 0;
            dbHepler db = new dbHepler();

            string sql = this.Invoke(new getsql(generatesql)) as string;

            MessageBox.Show(sql);
            // string sql = "select * from [20028] where XH='128590'";
            DataSet Student = db.LoadData(sql);

            report.Pages.Clear();
            //report.Load("Untitled.frx");
            ;

            //DataBand data = (DataBand)report.FindObject("data1");

            for (i = 0; i < Student.Tables[0].Rows.Count / 10; i++)
            {
                ReportPage page1 = new ReportPage();

                report.Pages.Add(page1);

                DataBand data = new DataBand();
                page1.Bands.Add(data);
                for (j = 0; j < 10; j++)
                {
                    TextObject text1 = new TextObject();
                    if (j % 2 == 0)
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 4, Units.Centimeters * 3 * j, Units.Centimeters * 5, Units.Centimeters * 0.6f);
                    }
                    else
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 4, Units.Centimeters * 3 * (j - 1), Units.Centimeters * 5, Units.Centimeters * 0.6f);
                    }

                    text1.Text = Student.Tables[0].Rows[10 * i + j]["name"].ToString();
                    data.Objects.Add(text1);


                    PictureObject pic = new PictureObject();
                    if (j % 2 == 0)
                    {
                        pic.Bounds = new RectangleF(0, Units.Centimeters * 3 * j, Units.Centimeters * 2, Units.Centimeters * 2);
                    }
                    else
                    {
                        pic.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (j - 1), Units.Centimeters * 2, Units.Centimeters * 2);
                    }
                    if (File.Exists("./" + "20" + Student.Tables[0].Rows[10 * i + j]["XH"].ToString().Substring(0, 2) + "/" + Student.Tables[0].Rows[10 * i + j]["XH"].ToString() + ".jpg"))
                    {
                        pic.Image = Image.FromFile("./" + "20" + Student.Tables[0].Rows[10 * i + j]["XH"].ToString().Substring(0, 2) + "/" + Student.Tables[0].Rows[10 * i + j]["XH"].ToString() + ".jpg");
                    }
                    data.Objects.Add(pic);

                    BarcodeObject bar = new BarcodeObject();
                    if (j % 2 == 0)
                    {
                        bar.Bounds = new RectangleF(0, Units.Centimeters * 3 * j + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);
                    }
                    else
                    {
                        bar.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (j - 1) + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);
                    }
                    //pic.Image = Image.FromFile("100001.jpg");
                    bar.Text = Student.Tables[0].Rows[10 * i + j]["ZKZH"].ToString();
                    data.Objects.Add(bar);
                }
            }

            if (Student.Tables[0].Rows.Count % 10 != 0)
            {
                Console.WriteLine((10 * i + j).ToString());
                ReportPage page2 = new ReportPage();

                report.Pages.Add(page2);

                DataBand data2 = new DataBand();
                page2.Bands.Add(data2);

                for (int k = 10 * (i - 1) + j; k < Student.Tables[0].Rows.Count; k++)
                {
                    TextObject text1 = new TextObject();
                    if (k % 2 == 0)
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 4, Units.Centimeters * 3 * (k % 10), Units.Centimeters * 5, Units.Centimeters * 0.6f);
                    }
                    else
                    {
                        text1.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 4, Units.Centimeters * 3 * (k % 10 - 1), Units.Centimeters * 5, Units.Centimeters * 0.6f);
                    }

                    text1.Text = Student.Tables[0].Rows[k]["name"].ToString();
                    data2.Objects.Add(text1);


                    PictureObject pic = new PictureObject();
                    if (k % 2 == 0)
                    {
                        pic.Bounds = new RectangleF(0, Units.Centimeters * 3 * k % 10, Units.Centimeters * 2, Units.Centimeters * 2);
                    }
                    else
                    {
                        pic.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (k % 10 - 1), Units.Centimeters * 2, Units.Centimeters * 2);
                    }
                    if (File.Exists("./" + "20" + Student.Tables[0].Rows[k]["XH"].ToString().Substring(0, 2) + "/" + Student.Tables[0].Rows[k]["XH"].ToString() + ".jpg"))
                    {
                        pic.Image = Image.FromFile("./" + "20" + Student.Tables[0].Rows[k]["XH"].ToString().Substring(0, 2) + "/" + Student.Tables[0].Rows[k]["XH"].ToString() + ".jpg");
                    }
                    data2.Objects.Add(pic);

                    BarcodeObject bar = new BarcodeObject();
                    if (k % 2 == 0)
                    {
                        bar.Bounds = new RectangleF(0, Units.Centimeters * 3 * (k % 10) + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);
                    }
                    else
                    {
                        bar.Bounds = new RectangleF(Units.Centimeters * 9 + Units.Centimeters * 0, Units.Centimeters * 3 * (k % 10 - 1) + Units.Centimeters * 2.5f, Units.Centimeters * 8, Units.Centimeters * 2);
                    }
                    //pic.Image = Image.FromFile("100001.jpg");
                    bar.Text = Student.Tables[0].Rows[k]["ZKZH"].ToString();
                    data2.Objects.Add(bar);
                }
            }
            this.Invoke(new setStatusDelegate1(setStatus2));
            this.Invoke(new setStatusDelegate1(reportShow1));
        }