Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

QRCode is not generated in SSRS Report

(0) ShareShare
ReportReport
Posted on by 15

I made SSRS Report with DP Class. 

I need to generate QR Code in this SSRS Report. 

So I wrote the code like this two ways. 

1. pastedimage1614229651971v3.png

In this way, it did well before. 

But at some point, the error occurred. 

pastedimage1614229728882v4.png

So I debugged. 

pastedimage1614229903563v5.png

The error occurred at the line "filename = qrCode.GetTempFile("TEST");".

2.  pastedimage1614229461409v1.png

In this way, the error occurred like this. 

pastedimage1614230687127v7.png

///

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: The file exists. 

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
at Microsoft.Dynamics.QRCode.Encoder.GetTempFile(String input)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Dynamics.AX.ManagedInterop.ClrBridgeImpl.InvokeClrInstanceMethod(ClrBridgeImpl* , ObjectWrapper* objectWrapper, Char* pszMethodName, Int32 argsLength, ObjectWrapper** arguments, Boolean* argsAreByRef, Boolean* isException)
Error executing code: CLRObject object not initialized.

Stack trace

(S)\Classes\CLRObject\generateQRCode
(S)\Classes\EFDocQRCode_BR\generateQRCode - line 8
(S)\Classes\CBO_KSV_PrintLabelsDP\insertIntoTmp - line 112
(S)\Classes\CBO_KSV_PrintLabelsDP\processReport - line 41
(S)\Classes\SrsReportProviderQueryBuilder\initialize - line 59
(S)\Jobs\

(S)\Classes\xInfo\add
(S)\Classes\Info\add - line 94
(S)\Classes\Global\error - line 3
(S)\Classes\EFDocQRCode_BR\callQRCodeEncoder - line 26
(S)\Classes\EFDocQRCode_BR\generateQRCode - line 8
(S)\Classes\CBO_KSV_PrintLabelsDP\insertIntoTmp - line 112
(S)\Classes\CBO_KSV_PrintLabelsDP\processReport - line 41
(S)\Classes\SrsReportProviderQueryBuilder\initialize - line 59
(S)\Jobs\

///

pastedimage1614230098653v6.png

The error occurred in this line "qrCodeReturn = method.Invoke(qrCodeEncoder, methodArgs);".

The most weird this is that QRCode generating code is working very well in the Job or other Class or Form. 

The error occurred in only DP class. 

pastedimage1614230848267v8.png(It did well in Form.)

So I made a Class with QRCode generating codes and called the Class in DP Class. 

And the error occured at same point. 

So what I have to do?

  • Martin Dráb Profile Picture
    231,760 Most Valuable Professional on at
    RE: QRCode is not generated in SSRS Report

    Regarding the first exception, check if there is an inner exception.

    Regarding the other, there is a null reference somewhere. I would first check if qrCodeEncoder is filled in. If there is no problem there, it would help if you can debug GetTempFile(). If you have source code, it's easy, if not, you could generate with a C# decompiler.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans