Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
In Power Bi Report Builder i have to generate a QR Code using a base64 string which holds e invoice data.
Successfully generated QR code using available api services ,But after scanning the QR Code with e invoice QR Code Scanner Application it is throwing as error like-"Unable to verify QR Code as Digital Signature is wrongly signed".
Can anyone help with solution to achieve this?
Solved! Go to Solution.
While the API may successfully return a QR code image, it does not generate it using the required TLV-structured Base64 encoding and digital signing as mandated by e-invoice standards (e.g., ZATCA in Saudi Arabia or GSTN in India). This leads to validation failure when scanned using official apps.
Standard QR code APIs (like Google Chart API, QRCode Monkey, etc.) only encode raw strings into QR codes and do not apply the proper TLV format or embed a valid digital signature required by the tax authorities.
You should construct the TLV string and convert it to Base64 before generating the QR code. Here's a sample in C#:
public static string GenerateTLV(string sellerName, string vatNumber, string timestamp, string invoiceTotal, string vatTotal) { List<byte> tlvBytes = new List<byte>(); tlvBytes.AddRange(EncodeTLV(1, sellerName)); tlvBytes.AddRange(EncodeTLV(2, vatNumber)); tlvBytes.AddRange(EncodeTLV(3, timestamp)); tlvBytes.AddRange(EncodeTLV(4, invoiceTotal)); tlvBytes.AddRange(EncodeTLV(5, vatTotal)); return Convert.ToBase64String(tlvBytes.ToArray()); } private static byte[] EncodeTLV(int tag, string value) { byte[] valueBytes = Encoding.UTF8.GetBytes(value); List<byte> tlv = new List<byte>(); tlv.Add((byte)tag); tlv.Add((byte)valueBytes.Length); tlv.AddRange(valueBytes); return tlv.ToArray(); }
After implementing your own TLV + Base64 encoding logic, validate the output using the official government QR scanner (e.g., ZATCA or GSTN apps).
In summary: do not rely on third-party QR code APIs for compliant e-invoice QR code generation. Use your own TLV encoding logic to meet the regulatory standards.
✔️ If my message helped solve your issue, please mark it as Resolved! 👍 If it was helpful, consider giving it a Kudos! |
Hi @Sravan_mahindra,
Just a gentle reminder has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.
This not only closes the loop on your query but also helps others in the community solve similar issues faster.
Thank you for your time and feedback!
Best,
Prasanna Kumar
Hi @Sravan_mahindra,
We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.
If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution it helps others who might face a similar issue.
Warm regards,
Prasanna Kumar
Hi @Sravan_mahindra,
Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.
If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful — this will benefit others in the community as well.
Best regards,
Prasanna Kumar
Hi @Sravan_mahindra,
Thanks for reaching out to the Microsoft Fabric Forum Community.
And aslo Thanks to @SolomonovAnton for useful and prompt response.
To generate a valid e-invoice QR code in Power BI Report Builder, you must first integrate with the Invoice Registration Portal (IRP) using either a GSP/ASP service provider or your own API setup. Once an e-invoice is successfully submitted, the IRP returns a digitally signed QR code as a base64-encoded string in the SignedQRCode field of the response. This signed code is mandatory, as generating a QR code manually from raw data won't pass verification in the e-invoice scanner. In Power BI Report Builder, you need to include this SignedQRCode value in your dataset and use it to render a QR image. This is done by adding an image control, setting the source to "Database", the MIME type to "image/png", and using an expression to convert the base64 string into an image. This method ensures the QR code meets government verification standards.
If this helped, please mark the response as the accepted solution and give it a thumbs-up so others can benefit too.
Best regards,
Prasanna Kumar
While the API may successfully return a QR code image, it does not generate it using the required TLV-structured Base64 encoding and digital signing as mandated by e-invoice standards (e.g., ZATCA in Saudi Arabia or GSTN in India). This leads to validation failure when scanned using official apps.
Standard QR code APIs (like Google Chart API, QRCode Monkey, etc.) only encode raw strings into QR codes and do not apply the proper TLV format or embed a valid digital signature required by the tax authorities.
You should construct the TLV string and convert it to Base64 before generating the QR code. Here's a sample in C#:
public static string GenerateTLV(string sellerName, string vatNumber, string timestamp, string invoiceTotal, string vatTotal) { List<byte> tlvBytes = new List<byte>(); tlvBytes.AddRange(EncodeTLV(1, sellerName)); tlvBytes.AddRange(EncodeTLV(2, vatNumber)); tlvBytes.AddRange(EncodeTLV(3, timestamp)); tlvBytes.AddRange(EncodeTLV(4, invoiceTotal)); tlvBytes.AddRange(EncodeTLV(5, vatTotal)); return Convert.ToBase64String(tlvBytes.ToArray()); } private static byte[] EncodeTLV(int tag, string value) { byte[] valueBytes = Encoding.UTF8.GetBytes(value); List<byte> tlv = new List<byte>(); tlv.Add((byte)tag); tlv.Add((byte)valueBytes.Length); tlv.AddRange(valueBytes); return tlv.ToArray(); }
After implementing your own TLV + Base64 encoding logic, validate the output using the official government QR scanner (e.g., ZATCA or GSTN apps).
In summary: do not rely on third-party QR code APIs for compliant e-invoice QR code generation. Use your own TLV encoding logic to meet the regulatory standards.
✔️ If my message helped solve your issue, please mark it as Resolved! 👍 If it was helpful, consider giving it a Kudos! |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
6 | |
3 | |
2 | |
2 | |
1 |
User | Count |
---|---|
6 | |
4 | |
4 | |
3 | |
3 |