Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

QRBitMap Function not printing the QR Code in Paper or Slip

Posted on by 20

Hi All

I need a Urgent help with Printing QRBitmap function in LS NAV 2013. Below is code:


PrintNdulgeDigitalWalletSlip(GivexLoyaltyLookup : Record "Givex Loyalty Lookup") : Boolean
//PrintNdulgeDigitalWalletSlip Copied from PrintWarrantyHotelSlip
IF NOT(AdvWHSetup.GET) THEN
EXIT(TRUE);

AdvWHSetup.TESTFIELD("N.dulge Digital Wallet");
IF AdvWHSetup."N.dulge Digital Wallet" <> '' THEN BEGIN
Tray := 2;
GivexLoyaltyLookup.CALCFIELDS("QR Code");

IF GivexLoyaltyLookup."QR Code".HASVALUE THEN
IF NOT(POSPrintSetupHeader.GET(AdvWHSetup."N.dulge Digital Wallet")) THEN
EXIT(TRUE);

IF GivexLoyaltyLookup."QR Code".HASVALUE THEN BEGIN
QRPath := TEMPORARYPATH;
IF (QRPath <> '') THEN BEGIN
QRPath := QRPath + 'QrBmpExp.bmp';
BLOBRef.Blob := GivexLoyaltyLookup."QR Code";
RBAutoMgt.BLOBExport(BLOBRef,QRPath,FALSE);
END;
END;

DontPrintSubHeader := TRUE;

IF NOT PrintNdulgeDigitalWalletExtraSlip(POSPrintSetupHeader,GivexLoyaltyLookup) THEN
EXIT(FALSE);

EXIT(TRUE);
END;


PrintNdulgeDigitalWalletExtraSlip(Header : Record "POS Print Setup Header";GivexLoyaltyLookup : Record "Givex Loyalty Lookup") : Boolean
//PrintNdulgeDigitalWalletExtraSlip Copied fromPrintWHExtraSlip
Tray := 2;
IF NOT OpenReceiptPrinter(Tray) THEN
EXIT(FALSE);

Len := LineLen;

PrintBuffer.INIT;
PrintBuffer."Transaction No." := PrintBufferTransNo;
PrintBuffer."Buffer Index" := PrintBufferIndex;
PrintBuffer."Station No." := Tray;
PrintBuffer."Page No." := PageNo;
PrintBuffer."Printed Line No." := LinesPrinted;
PrintBuffer.LineType := PrintBuffer.LineType::Rotation;
PrintBuffer.Width := Header.Rotation; //NOTE Use Width for Rotation value
PrintBuffer.INSERT;
PrintBufferIndex += 1;

IF Header."Print Header" THEN BEGIN
PrintHeader(Transaction,FALSE,Tray);
IF NOT DontPrintSubHeader THEN //Doc SNK443 AGS 07/12/15 -+
PrintSubHeader(Transaction,Tray,Transaction.Date,Transaction.Time);
END;

FieldName[1] := 'QRCODE';
FieldValue[1] := '';
FieldName[2] := 'CARDNO';
FieldValue[2] := GivexLoyaltyLookup."Givex Card No";
FieldName[3] := 'MEMBER';
FieldValue[3] := GivexLoyaltyLookup.Title + ' ' + GivexLoyaltyLookup.FirstName + ' ' + GivexLoyaltyLookup.LastName;
FieldName[4] := 'STORENO';
FieldValue[4] := GivexLoyaltyLookup."Store No.";
FieldName[5] := 'EMAIL';
IF GivexLoyaltyLookup.Email = '' THEN
FieldValue[5] := TNP001
ELSE
FieldValue[5] := GivexLoyaltyLookup.Email;
FieldName[6] := 'MOBILE';
FieldValue[6] := GivexLoyaltyLookup.Mobile;

Line.SETRANGE("Setup ID",Header."Setup ID");
IF Line.FIND('-') THEN REPEAT
CASE Line.Align OF
Line.Align::Left:
IF Line.Wide THEN
DSTR := '#L' + StringPad('#',ROUND(Len / 2,1,'<') - 2)
ELSE
DSTR := '#L' + StringPad('#',Len - 2);
Line.Align::Center:
IF Line.Wide THEN
DSTR := '#C' + StringPad('#',ROUND(Len / 2,1,'<') - 2)
ELSE
DSTR := '#C' + StringPad('#',Len - 2);
Line.Align::Right:
IF Line.Wide THEN
DSTR := '#R' + StringPad('#',ROUND(Len / 2,1,'<') - 2)
ELSE
DSTR := '#R' + StringPad('#',Len - 2);
END;
TmpStr := Line.Text;
FOR i := 1 TO 6 DO BEGIN
Pos := STRPOS(TmpStr,'%WH_' + FieldName[i]);
IF Pos <> 0 THEN BEGIN
IF Pos = 1 THEN
TmpStr := FieldValue[i] + COPYSTR(TmpStr,Pos + STRLEN(FieldName[i]) + 4)
ELSE
TmpStr := COPYSTR(TmpStr,1,Pos - 1) + FieldValue[i] + COPYSTR(TmpStr,Pos + STRLEN(FieldName[i]) + 4);
END;
END;
IF Line.Align <> Line.Align::Barcode THEN BEGIN
Value[1] := TmpStr;
PrintLine(Tray,FormatLine(FormatStr(Value,DSTR),Line.Wide,Line.Bold,Line.High,Line.Italic));
END
ELSE
PrintQRBitmap(Tray);
UNTIL Line.NEXT = 0;

IF Header."Print Footer" THEN
PrintFooter(Transaction,Tray);

PrintBuffer.INIT;
PrintBuffer."Transaction No." := PrintBufferTransNo;
PrintBuffer."Buffer Index" := PrintBufferIndex;
PrintBuffer."Station No." := Tray;
PrintBuffer."Page No." := PageNo;
PrintBuffer."Printed Line No." := LinesPrinted;
PrintBuffer.LineType := PrintBuffer.LineType::Rotation;
PrintBuffer.Width := Header.Rotation::" "; //NOTE Use Width for Rotation value
PrintBuffer.INSERT;
PrintBufferIndex += 1;

IF NOT ClosePrinter(Tray) THEN
EXIT(FALSE);
EXIT(TRUE);



I am able to view the QR code by debugging and getting the QRPath, and whenever it enters PrintQRBitmap it hits everything it needs to hit, but for some reason(maybe in setup or otherwise), this is not printing the QR Code on the paper. Please help me with this. It does print testing on the receipt.

This is all standard LS Retail Code.

  • RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Thank you Nitin, I have gone through the link and it is not answering my issue or solving it.

    I am able to print the QR code in NAV report. The Printer is printing it in the Test Print in the Printer. But not doing while Printing it through POS Print Utility in LS. I can see the QR bmp file getting created and stored in the path, but not able to see its getting uploaded while printing the Slip in LS.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Hi,

    Please check the below URL link .

    NAVwithNAV: Print QR Code in PaySlip with LS Retail NAV 2016

    Hope it will help.

  • RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Hi Nitin,

    I am using a Thermal Receipt Printer, checked the setting all looks fine. The QR Code is in .bmp format as mentioned in the LS Standard code. The bmp QR code is getting created and saved properly. Its even loaded to file management in the codeunit. But not sure about the setting in LS to tell it to consider the bmp from the file management while printing.

    I will check the formatting in JPG and let you know in case of any success. Please find the PrintQRBitmap standard function below.

    PrintQRBitmap(Tray : Integer) : Code[20]

    //PrintQRBitmap

    PrintBuffer.INIT;

    PrintBuffer."Transaction No." := PrintBufferTransNo;

    PrintBuffer."Buffer Index" := PrintBufferIndex;

    PrintBuffer."Station No." := Tray;

    PrintBuffer."Page No." := PageNo;

    PrintBuffer."Printed Line No." := LinesPrinted;

    PrintBuffer.LineType := PrintBuffer.LineType::PrintBitmapFile;

    PrintBuffer.INSERT;

    PrintBufferIndex += 1;

    EXIT;

  • RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Thank you YUN, the bit map is working fine in NAV2013 Report i have checked and all looks good. My issue is with LS Retail not taking the QR code in the Print Utility codeunit

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Hi,

    First check with printer setting I believe you have Zebra printer or similar. There must be a bitmap setting always also please check with extension JPG format, also please check your bitmap format must be 32 bit not 24 bit.

    Please confirm if above setting works

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,696 Super User 2024 Season 2 on at
    RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Hi, Hope the information below will help you.

       

       

       

    https://www.barcode-soft.com/dynamics-nav-barcode.aspx

    http://navnilesh.blogspot.com/2015/06/qr-code-print-dynamics-nav.html

    Thanks.

    ZHU

  • RE: QRBitMap Function not printing the QR Code in Paper or Slip

    Codes related to QRCode is all standard except the width and Hight. I tried with out it as well

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans