Hi guys, Today we see how to Generate QR codes using x++ in D365FO SSRS reports. We can generate QR codes. Please check below.
Steps :
1. Need to create container filed in Temp table.
2. Add Below code in DP class and calling that method while inserting data into temp table. Like below.
headerTmp.Image = this.QRCode('TEST');// Your method.
headerTmp.insert();
3.click restore on report
4. Add image field in design
5. Image Properties :
- Select the image source : Database
- Use this field : Field from Table
- Use this MIME type : image/bmp
Code:
private container QRCode(str _value)
{
Microsoft.Dynamics.ApplicationSuite.QRCode.Encoder qrCode = new Microsoft.Dynamics.ApplicationSuite.QRCode.Encoder();
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
System.Drawing.Bitmap bitmap;
bitmap = qrCode.Encode(_value);
bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat::Png);
return Binary::constructFromMemoryStream(memoryStream).getContainer();;
}
No comments:
Post a Comment