Sample Code to Generate QR Code Blob Image File.
report 50100 PrintBarcode
{
UsageCategory = Administration;
ApplicationArea = All;
DefaultLayout = RDLC;
Caption = 'Item Barcodes (BC On-Prime)';
RDLCLayout = 'ItemBarcodes.rdl';
dataset
{
dataitem(Item; Item)
{
DataItemTableView = sorting("No.");
RequestFilterFields = "No.";
RequestFilterHeading = 'Items';
column(No_; "No.")
{
}
column(Description; Description)
{
}
column(QR_BLOB; ComInf_gRecTmp.Picture)
{
}
trigger OnAfterGetRecord()
var
OS_iOS: OutStream;
IS_iIN: InStream;
TempBlob: Codeunit "Temp Blob";
QRBase64String: Text;
QRGenerator: Codeunit "QR Generator";
begin
QRBase64String := Item."No." + '|' + Item."Description";
TempBlob.CreateInStream(IS_iIN);
QRGenerator.GenerateQRCodeImage(QRBase64String, TempBlob);
ComInf_gRecTmp.Reset();
ComInf_gRecTmp.DeleteAll();
ComInf_gRecTmp.Init();
ComInf_gRecTmp.Picture.CreateOutStream(OS_iOS);
COPYSTREAM(OS_iOS, IS_iIN);
ComInf_gRecTmp.Insert(TRUE);
ComInf_gRecTmp.CalcFields(Picture);
end;
}
}
var
ComInf_gRecTmp: Record "Company Information" temporary;
}
RDLC Layout File Design:
Sample Output in BC On-Prime:
Note: you need to add depedancy "QR Generator" in indian localization BC Version
No comments:
Post a Comment