Forum > Beginners
How to insert GS1-128 barcode on report?
KaYs3r:
Hi everyone,
I'm trying to insert a GS1-128 barcode on a report for label printing, but it doesn't work.
If I use Laz Barcodes components, I can create the barcode correctly, but it shows a black rectangle on the report.
Can someone point me in the right direction please?
Thanks
dseligo:
Do you use LazReport?
If yes, then you can put bitmap to picture in report like this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- var frQR: TfrObject; Bmp: TBitmap; ... // create and fill bitmap frQR := frReport1.FindObject('Picture1'); // 'Picture1' is name of picture in report where barcode will be shown If frQR = nil then Exit; If not (frQR is TfrPictureView) then Exit; (frQR as TfrPictureView).dx := Bmp.Width; //Width (frQR as TfrPictureView).dy := Bmp.Height; //Height (frQR as TfrPictureView).Picture.Bitmap := Bmp; ... // free bitmap
Ask if you need help with creating bitmap from LazBarcode.
paweld:
Sample (for LazReport and LazBarcodes) in attachment
KaYs3r:
--- Quote from: paweld on June 14, 2024, 07:03:28 am ---Sample (for LazReport and LazBarcodes) in attachment
--- End quote ---
Hey paweld,
Thank you for your sample, but the barcode that is generated is not a valid GS1-128 barcode, it reads as a Code128 type.
KaYs3r:
OK paweld,
I've managed to change your code to make the GS1-128 Code :)
Thanks
Navigation
[0] Message Index
[#] Next page