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.
In this way, it did well before.
But at some point, the error occurred.
So I debugged.
The error occurred at the line "filename = qrCode.GetTempFile("TEST");".
2.
In this way, the error occurred like this.
///
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\
///
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.
(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?