Dear Experts,
I have done the following procedure.
1- VISUAL STUDIO 2010
---------------------------
Create a class library to convert the string into QR Code with the help of ZXING.
public Bitmap EncodeQR(string _qrValue)
{
ZXing.QrCode.QrCodeEncodingOptions _options = new ZXing.QrCode.QrCodeEncodingOptions();
_options = new ZXing.QrCode.QrCodeEncodingOptions()
{
DisableECI = true,
CharacterSet = "UTF-8",
Width = 250,
Height = 250,
};
var qrCode = new ZXing.BarcodeWriter();
qrCode.Format = ZXing.BarcodeFormat.QR_CODE;
qrCode.Options = _options;
var _result = new Bitmap(qrCode.Write(_qrValue.ToString()));
return _result;
}
2- MS Dynamics AX 2012 R2 CU7
-------------------------------------
- Export the VS project to AOT
- Copy the dll file to the client
- Add the dll to the AOT reference
Create a job to call the dll with string.
public static container Generate_QRZXING(str 1000 _QRDataString)
{
QRCoder.Encoder _qrEncoder = new QRCoder.Encoder();
System.Drawing.Bitmap _result;
str 1000 _TempFileName;
real _value;
BinData _binData;
Microsoft.Dynamics.QRCode.Encoder qrCode = new Microsoft.Dynamics.QRCode.Encoder();
FileIOPermission perm;
;
_result = _qrEncoder.EncodeQR(_QRDataString); /////////////////////// ERROR HERE /////////////////////////////////
_TempFileName = qrCode.GetTempFile(_QRDataString);
perm = new FileIOPermission(_TempFileName,'r');
perm.assert();
_binData = new BinData();
_binData.loadFile(_QRDataString);
return _binData.getData();
}
I am unable to understand when the code reach to "ERROR HERE". System didn't show any error message or nothing just close the process.
While I have created another VS2010 form based project to test the dll and it's working perfectly fine.