Print Page | Close Window

Seri barkod nasıl yazdırılır.

Printed From: C#nedir?com
Category: ASP.NET
Forum Name: ASP.NET
Forum Description: ASP.NET
URL: http://forum.csharpnedir.com/forum_posts.asp?TID=81955
Printed Date: 11 Temmuz 2020 at 07:53
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Seri barkod nasıl yazdırılır.
Posted By: potenza
Subject: Seri barkod nasıl yazdırılır.
Date Posted: 20 Mayıs 2019 at 17:04
Veritabanındaki kayıtlardan seçtiğim ürünün barkodunu yazıcıdan çıktı alabiliyorum (x ayakkabının mavi 36 numarası) gibi

fakat yapmak istediğim dropdownlist ten X ayakkabı seçilince ona ait tüm renk ve bedenleri seri olarak barkod yazıcıdan çıkartmak istiyorum. yazdığım işlemde tek barkoda üst üse basıyor. yardımcı olursanız sevinirim.





protected void BtnTopluYazdir_Click(object sender, EventArgs e)
    {

        PrintDocument pd = new PrintDocument();
        pd.PrinterSettings.PrinterName = "Argox A-200 PPLB";
        pd.PrintPage += new PrintPageEventHandler(yazdirBarkodToplu);
        pd.Print();


    }




public void yazdirBarkodToplu(object sender, PrintPageEventArgs e)

    {

        secilenId = int.Parse(DropUrunler.SelectedItem.Value);

        var barkodlar = from i in db.Barkodlar.ToList()
                            where i.StokKartId == secilenId
                            select i;

            foreach (var item in barkodlar)
            {

          
            BarkodUrunAdi = DropUrunler.SelectedItem.Text;

            var OzellikBul = from i in db.UrunOzellikleri.ToList()
                                 where i.id == item.UrunOzellikId
                                 select i;


               foreach (var item2 in OzellikBul)
               {

                    BarodOzellikAdi = item2.VaryasyonOzellik1Adi + " " + item2.VaryasyonOzellik2Adi;

                    Int32 barcodeHeight = 40, barcodeWidth = 150;
                    Bitmap bmpBarcode;
                    bmpBarcode = new Bitmap(barcodeWidth, barcodeHeight);
                    bmpBarcode.SetResolution(300, 100);

                    StringFormat stringFormat = new StringFormat();
                    stringFormat.Alignment = StringAlignment.Center;
                    stringFormat.LineAlignment = StringAlignment.Center;

                   
                    clsBarCode barcodeGenerator = new clsBarCode();
                    String barcodeReadyData = barcodeGenerator.Code128(item.Barkod.ToString(), false);

                    PrivateFontCollection myFonts;
                    FontFamily family = LoadFontFamily(Server.MapPath("fonts/IDAUTOMATIONSC128XXL.TTF"), out myFonts);
                    using (Font drawFont = new Font(family, 12), readableFont = new Font("Arial", 10, FontStyle.Regular))
                    {
                        using (SolidBrush drawBrush = new SolidBrush(Color.Black))
                        {

                            e.Graphics.FillRectangle(new SolidBrush(Color.White), new RectangleF(0, 0, bmpBarcode.Width, bmpBarcode.Height));
                            e.Graphics.DrawString(BarkodUrunAdi, readableFont, drawBrush, new RectangleF(0, 0, barcodeWidth, 14), stringFormat);
                            e.Graphics.DrawString(BarodOzellikAdi, readableFont, drawBrush, new RectangleF(0, 15, barcodeWidth, 20), stringFormat);
                            e.Graphics.DrawString(barcodeReadyData, drawFont, drawBrush, new RectangleF(0, 50, barcodeWidth, barcodeHeight), stringFormat);
                            e.Graphics.DrawString(BarkodEtiket, readableFont, drawBrush, new RectangleF(0, 85, barcodeWidth, barcodeHeight), stringFormat);
                            e.Graphics.DrawString("Logo", readableFont, drawBrush, new RectangleF(150, 85, barcodeWidth, 20), stringFormat);

                        }


                    }
               }
            }

       
      


    }




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk