
Hii,
There is Fixed assets bar codes report. It is showing barcodes but want to generate and show QR codes.
There is a post explaining how to generate QR code.
https://community.dynamics.com/ax/f/33/t/137647
Anyone know how to take it to the SSRS report?
Thanks
*This post is locked for comments
I have the same question (0)Got it. Here is the code.
Add a field to your temp table of type Container.
In your SSRS report place image and set Source Database, Your new container field and MIME type image/bmp.
AssetBarCodeDP -> processReport()
public void processReport()
{
AssetTable assetTable;
QueryRun queryRun;
Filename filename;
FileIOPermission perm = null;
AssetBarCodeContract contract;
contract = this.parmDataContract() as AssetBarCodeContract;
barcodeSetup = BarcodeSetup::find(contract.parmBarCodeSetUpId());
barcode = barcodeSetup.barcode();
queryRun = new QueryRun(this.parmQuery());
qrCode = new Microsoft.Dynamics.QRCode.Encoder();
binData = new BinData();
while (queryRun.next())
{
assetTable = queryRun.get(tableNum(AssetTable)) as AssetTable;
assetBarCodeTmp.AssetId = assetTable.AssetId;
assetBarCodeTmp.AssetName = assetTable.Name;
assetBarCodeTmp.BarCode = this.barCode(assetTable.Barcode + assetTable.Name);
netBitmap = qrCode.Encode(assetTable.Barcode +' '+ assetTable.Name);
filename = qrCode.GetTempFile(assetTable.Barcode +' '+ assetTable.Name);
perm = new FileIOPermission(filename, 'RW');
perm.assert();
binData.loadFile(filename);
assetBarCodeTmp.QRCode = binData.getData();
assetBarCodeTmp.insert();
//if(WinAPI::fileExists(filename))
//{
//WinAPI::deleteFile(filename);
//}
CodeAccessPermission::revertAssert();
}
}
SSRS QR Code Image
Final