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.