SAP Business One 10 come with so many updates, one of them is to allow us to print QR Codes in Crystal Report. SAP Business One provides a new field in Marketing Document labeled “Create QR Code From”, placed in Accounting Tab. We can fill anything to be generated as QR Code, for example in a picture below, we fill with information of Document Number and Document Date.
As we fill field Create QR Code From, it will save a record in the database and stored it in Table OQRC, with the detail needed field :
- SrcObjType: Source Object Type Document which we fill the QR Code information. In this example, we use the Sales Order Document, so the value is 17.
- SrcObjAbs: Source Document Internal Number. In this example, we use the Sales Order Document, so it will link to the field “DocEntry” in ORDR Table.
- FieldName: Source Document Field ID in Screen. In this example, we use the Sales Order Document, the field ID is “QRCodeSrc”.
- FileContnt : QR Code Image Content.
To print the QR Code in Crystal Report, we can add a command query in Crystal Report like below :
SELECT T1."FileContnt" FROM ORDR T0 LEFT JOIN OQRC T1 ON T1."SrcObjAbs" = T0."DocEntry" AND T1."SrcObjType" = T0."ObjType" WHERE T1."FieldName" = 'QRCodeSrc' AND T0."DocEntry" = 2;
Drag the field “FileContnt” from Database Fields into the report designer and QR Code will be showed in Crystal Report.