QR Code String Size

Hi,

We are facing problem when string to be encoded while string size is more than 110 charters in QR Code.

Using below link we are trying to generate QR Code on Sales Invoice.

Up to 110 charters it’s working fine but if we add more fields then neither getting any output nor error. Is there a string limit. How to resolve this.

Thanks in advance.

community.dynamics.com/…/generating-qr-codes-in-ax-2009

Or is there another way to generate QR code on Sales Invoice?

www.agermark.com/…/create-qr-codes-from-ax.html

Look at the comment section, there is also an example to generate QR in AX 2009.

Thanks for reply Kranthi.

Yes we are also able to generate QR code if string size is less than 110 characters(we have string with approx 150 characters).

If it goes more than that then we are facing problem.

Any solution please.

Hello Kranthi,

Is there another way to achive this.

Amol

I am not sure how your Custom Code/DLL works. So i have given you a link with an alternate approach.

Below is our display method, If i remove fields from SGSTPer (highlighted by orange colour) then it works fine but after inserting these extra fields we are facing the problem.

There is no any error occurs, simply executed without any output.

We are follwing below steps for dll file-

  • Downloaded file MessagingToolkit.QRCode.dll
  • Copied it in client\bin folder
  • Added this dll file in the system references

display container qrcode()
{
Bindata bindata = new Bindata();
Image Imgobj;
System.Drawing.Image img;
System.Drawing.Bitmap obj;
Filepath _path;
container con;
str Qty,InvDate,GRate,NRate,VendCode,GTot,PONo;
MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();
;

PONo = strDel(_custInvoiceJour.CustRefNo,11,20);
Qty = num2str(_CustInvoiceJour.Qty,2,2,1,0);
InvDate = date2str(_CustInvoiceJour.InvoiceDate,123,2,DateSeparator::Dot,2,DateSeparator::Dot,4,0);
GRate = num2str(_custInvoiceTrans.SalesPrice,2,2,1,0);
GTot = num2str((abs(LineAmount) + abs(_value) + Copy),2,2,1,0);
VendCode = DirOrganizationDetail::find(CustTable::find(_CustInvoicejour.OrderAccount).PartyId).OrgNumber;
NRate = num2str((_CustInvoiceTrans.lineAmountInclTax() / _CustInvoiceTrans.Qty),2,2,1,0);

obj = new System.Drawing.Bitmap(encoder.Encode(PONo+","+“10”+","+Qty+","+_custInvoiceJour.InvoiceId+","+InvDate+","+GRate+","+NRate+","+VendCode+","+_custInvoiceTrans.ItemId+","+CGST+","+SGST+","+“0.00”+","+“0.00”+","+CGSTPer+","+SGSTPer+","+“0.00”+","+“0.00”+","+“0.00”+","+GTot+","+_custInvoiceTrans.HSNCode));
obj.Save(@“C:\temp\newPhoto.bmp”,System.Drawing.Imaging.ImageFormat::get_Bmp());
bindata.loadFile(@“C:\temp\newPhoto.bmp”);
con = bindata.getData();
return con;
}

Amol

Hello Kranthi,

Any solution for this.

Amol

We have solved the problem using solution explained under below link

stackoverflow.com/…/net-messagingtoolkit-qrcode-encode-issue

Amol.