Recent

Author Topic: I need to print labels (Form) with 1xLabel and 1xBarcodeQR [SOLVED]  (Read 14162 times)

tmac1959

  • New Member
  • *
  • Posts: 22
Hi all,

have all day to read this forum but unfortunately can not find the answer.

I need to print labels (Form) with 1xLabel and 1xBarcodeQR thermal printer on a network. How to realize this with Lazarus? plus a defined label dimensions are 68x45 mm?

Thank you so much for any advice and sorry my bad English.

Thomas
« Last Edit: July 15, 2013, 03:31:40 pm by tmac1959 »
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

paweld

  • Hero Member
  • *****
  • Posts: 1434
Best regards / Pozdrawiam
paweld

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #2 on: July 13, 2013, 04:29:12 pm »
errors in translation - broken under IDE version 1.0.10 fortesreport-3.24-LCL-R2: (
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #3 on: July 13, 2013, 05:07:46 pm »
SVN version is okay but it does not support QR Codes!!
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #4 on: July 13, 2013, 07:03:54 pm »
Fortes report is good but do not know how to get him to QR Barcode?
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 261
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #5 on: July 13, 2013, 08:50:31 pm »
I have never doing this, but I hope you will succeed and let us know :

1. http://wiki.lazarus.freepascal.org/LazBarcodes
2. http://sourceforge.net/projects/zint/ (this one is writen in C/C++)
3. http://www.matthewhipkin.co.uk/codelib/qr-code-generator-in-delphi-and-lazarus/

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1272
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #6 on: July 14, 2013, 10:41:09 am »
hello,
what kind of QrCode do you want ?
With lazreport and lazbarcodes i can do what you can see in attachment.


Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #7 on: July 14, 2013, 11:33:40 am »
LazBarcode I use, this is great but how to insert into LazReport same as Fortes report. If I put there LazBarcode LCL, the output is a black square.

Appendix 1 is the appearance of the generated form, Annex 2 results
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #8 on: July 14, 2013, 11:49:16 am »
1. Would be helpful if you could specify OS, FPC, Lazarus version - see link in my signature
2. Having the actual sourcecode of that project would also be a big help to people trying to help you. Could you upload a zip with that (using Project/Publish project so you only zip up the source file, not any .ppu, .o, .a, .exe etc files)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #9 on: July 14, 2013, 03:24:10 pm »
Windows 7 Pro /64Bit info about lazarun in attachments
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1272
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #10 on: July 14, 2013, 04:59:13 pm »
tips and tricks    ;D :
How to add Qrcode barcode in the sample project barcode (cb.lpi)  of lazreport  ( the value of the qrcode is the Author field from the database disco.dbf).

1 - Install the packages lazreport and lazbarcodes in your lazarus ide.
2 - In the main form of the sample project barcode add a TbarcodeQR component.
3 - In the report add a picture where you want to display the barcode/
4 - Add this code on the event OnEnterRect of the frReport1 component :
Code: [Select]
procedure TForm1.frReport1EnterRect(Memo: TStringList; View: TfrView);
var
tmp : TBitmap;
w,h : integer;
r : TRect;
begin
  if (View.Name='Picture1')  then
  begin
    // Fields[0] --> Author
    BarCodeQR1.Text := frDBDataSet1.DataSet.Fields[0].AsString;
    BarCodeQR1.Update;
    w := BarCodeQR1.Width;
    h:= BarCodeQR1.Height;
    r:= Rect(0,0,w,h);
    tmp:=TBitmap.Create;
    tmp.Width:=w;
    tmp.Height:=h;
    // copy the qrcode bitmap  in the picture Picture1
    tmp.Canvas.CopyRect(r, BarCodeQR1.Canvas, r);
    TFrPictureView(View).Picture.Bitmap.Assign(tmp);
    tmp.free;
  end;
end;
in attachment the modified project ( the name of the report is qrcodebar.lrf )

Friendly, J.P

« Last Edit: July 14, 2013, 05:28:50 pm by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #11 on: July 14, 2013, 07:56:46 pm »
Thank you, example works but I need the following:

how to insert a bitmap object in TRLImage Fortes Report.

I tried to insert as an example but the result is again a black square :)
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #12 on: July 14, 2013, 08:26:22 pm »
I can not even insert a bitmap QR code According to the example of such Images:



procedure TForm2.Image1Paint(Sender: TObject);
var
tmp : TBitmap;
w,h : integer;
r : TRect;
begin

    BarCodeQR1.Text := Form1.Edit1.Text;
    BarCodeQR1.Update;
    w := BarCodeQR1.Width;
    h:= BarCodeQR1.Height;
    r:= Rect(0,0,w,h);
    tmp:=TBitmap.Create;
    tmp.Width:=w;
    tmp.Height:=h;
    tmp.Canvas.CopyRect(r, BarCodeQR1.Canvas, r);
    Image1.Picture.Bitmap.Assign(tmp);
    Image1.Show;
    tmp.free;

end;                                     
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #13 on: July 14, 2013, 08:32:50 pm »
So the following works!! Now just to get it to Fortes Report :(




procedure TForm2.Image1Paint(Sender: TObject);
var
tmp : TBitmap;
w,h : integer;
r : TRect;
begin

    BarCodeQR1.Text := Form1.Edit1.Text;
    BarCodeQR1.Update;
    w := BarCodeQR1.Width;
    h:= BarCodeQR1.Height;
    r:= Rect(0,0,w,h);
    tmp:=TBitmap.Create;
    tmp.Width:=w;
    tmp.Height:=h;
    tmp.Canvas.CopyRect(r, BarCodeQR1.Canvas, r);
    Image1.Proportional:=true;
==========================
    Image1.Picture.Bitmap.Assign(tmp);
    Image1.Show;
    tmp.free;

end;                           
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

tmac1959

  • New Member
  • *
  • Posts: 22
Re: I need to print labels (Form) with 1xLabel and 1xBarcodeQR
« Reply #14 on: July 15, 2013, 08:45:15 am »
tips and tricks    ;D :
How to add Qrcode barcode in the sample project barcode (cb.lpi)  of lazreport  ( the value of the qrcode is the Author field from the database disco.dbf).

1 - Install the packages lazreport and lazbarcodes in your lazarus ide.
2 - In the main form of the sample project barcode add a TbarcodeQR component.
3 - In the report add a picture where you want to display the barcode/
4 - Add this code on the event OnEnterRect of the frReport1 component :
Code: [Select]
procedure TForm1.frReport1EnterRect(Memo: TStringList; View: TfrView);
var
tmp : TBitmap;
w,h : integer;
r : TRect;
begin
  if (View.Name='Picture1')  then
  begin
    // Fields[0] --> Author
    BarCodeQR1.Text := frDBDataSet1.DataSet.Fields[0].AsString;
    BarCodeQR1.Update;
    w := BarCodeQR1.Width;
    h:= BarCodeQR1.Height;
    r:= Rect(0,0,w,h);
    tmp:=TBitmap.Create;
    tmp.Width:=w;
    tmp.Height:=h;
    // copy the qrcode bitmap  in the picture Picture1
    tmp.Canvas.CopyRect(r, BarCodeQR1.Canvas, r);
    TFrPictureView(View).Picture.Bitmap.Assign(tmp);
    tmp.free;
  end;
end;
in attachment the modified project ( the name of the report is qrcodebar.lrf )

Friendly, J.P


From your example, I can not open qrcodebar.lrf, says that it is an invalid format of the report (LazReport editor)
OS : Windows 7 32 bit or Windows XP 32 bits
Laz: Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64

 

TinyPortal © 2005-2018