web
You’re offline. This is a read only version of the page.
close
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?

I have the same question (0)
  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans