翻譯|使用教程|編輯:凌霄漢|2022-03-02 15:46:20.313|閱讀 664 次
概述:本文主要介紹如何使用報表開發(fā)工具FastReprt創(chuàng)建Code-128 條形碼
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
CODE 128 是 Computer Identics Corporation (USA) 于 1981 年開發(fā)的條形碼。CODE 128 可以表示所有 128 個 ASCII 碼字符(數(shù)字、大寫/小寫字母、符號和控制碼)。由于它可以表示所有可以與計算機鍵盤一起使用的字符(除了日文漢字、平假名和片假名),它是一種計算機友好的條形碼。Code-128 由于數(shù)據(jù)的“雙密度壓縮”,可以非常緊湊,當兩個數(shù)字寫入一個條形碼模數(shù)時。
Code-128 條碼包含 107 個字符,其中 103 個是數(shù)據(jù)字符,3 個起始字符和 1 個終止字符。要對所有 128 個 ASCII 字符進行編碼,有三組 Code128 條碼字符 - A、B 和 C,可在單個條碼中使用。
Code-128 條碼符號系統(tǒng)、符號系統(tǒng)指示器、數(shù)據(jù)字符編碼、大小、解碼算法、應用參數(shù)、前綴字符串和符號系統(tǒng)標識符的技術要求在全球范圍內由 ISO/IEC 15417: 2007 “信息技術 - 自動識別和數(shù)據(jù)采集技術 - Code 128 條碼符號規(guī)范”。
// Create a report object Report report = new Report(); // Create a report page ReportPage page = new ReportPage(); // add a unique identifier page.CreateUniqueName(); //Add it to the collection of report pages report.Pages.Add(page); // Create a data band DataBand dataBand = new DataBand(); //with a unique identifier dataBand.CreateUniqueName(); //and add it to the band collection page.Bands.Add(dataBand); //Create a barcode object FastReport.Barcode.BarcodeObject barcode = new FastReport.Barcode.BarcodeObject(); //Set the barcode type barcode.Barcode = new FastReport.Barcode.Barcode128(); //Set a numeric combination for encoding barcode.Text = "(02)14611234567890(37)24"; //Place the barcode on the page barcode.Parent = dataBand; //Set the size of the object barcode.Bounds = new RectangleF(0, 0, Units.Centimeters * 10, Units.Centimeters * 3); //Display the report report.Show();
{ Add the "Data" page } DataPage := TfrxDataPage.Create(frxReport1); { Add a page } Page := TfrxReportPage.Create(frxReport1); { Create a unique name } Page.CreateUniqueName; { Set the default margins, paper sizes and orientation } Page.SetDefaults; { Change the orientation of the paper } Page.Orientation := poLandscape; { Add report title } Band := TfrxReportTitle.Create(Page); Band.CreateUniqueName; { For a band, it is enough to set the Top coordinate and height } { Both coordinates are in pixels } Band.Top := 20; Band.Height := 40; { Create a barcode object } Barcode := TfrxBarcodeView.Create(Band); { Set the barcode type } Barcode.BarType := bcGS1Code128; { Set a numeric combination for encoding } Barcode.Text := '(02)14611234567890(37)24'; { Set the position and size of the object } Barcode.Top := 0; Barcode.Left := 10; Barcode.Height := 40; { Set the display of the text at the bottom of the barcode } Barcode.ShowText := True; { Display the report } frxReport1.ShowReport; end;
現(xiàn)在,您應該了解了如何使用Fastreport創(chuàng)建Code-128 條形碼了
FastReport 技術交流群:702295239 歡迎一起進群討論
本站文章除注明轉載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn