An error occurred rendering the report. Accessing the report server URL caused an error. The remote server returned an error: (500) Internal Server Error

hello guys,

when i run a report (System admin - record level security) in R2 (6.2.1000.4051) and print to a printer then following error occurs.
“An error occurred rendering the report. Accessing the report server URL caused an error. The remote server returned an error: (500) Internal Server Error.”

Strangely it happens when printing to printer only, report runs fine on Screen. I have tried debuggging the code but i have stuck at the point. please help me.

The following code belongs to Classes\SRSProxy\renderReportToPrinter() . I have found that due to some reason boolean variable success hold “false” value and so unable to execute method setExecutionInformation(). where in other out of the box machine success is true. not sure why it’s getting false value in Success. any guess how to find and fix it.

try
{

methodInfo = SRSProxy::getSharedProxyMethodInfo(‘PrintReportWithPageSettings’, false);

if (methodInfo != null)
{
proxyObject = reportingServicesProxy;
success = proxyObject.PrintReportWithPageSettings(reportPath,
parameterValueArray,
printerName,
overridePrintContractSettings,
deviceInfo,
numberOfCopies,
overridePaperSettings,
pageSettings);
}
else
{
success = reportingServicesProxy.PrintReport(reportPath, parameterValueArray, printerName, deviceInfo, numberOfCopies, overridePaperSettings, pageSettings);
}

if (success)
{
this.setExecutionInformation();
}
}
catch(Exception::CLRError)
{
// We must trap CLRError explicitly, to be able to retrieve the CLR exception later (using CLRInterop::getLastException() )
SRSProxy::handleClrException(Exception::Error);
}

I hope if i can find true value in Success then setExecutionInformation(); will be called and it will print the report to the printer however, Success holds false and there is no condition defined for false, might be a cause of an exception.

Please help, i’m new to AX.

Can’t you find anything useful in SSRS logs?

Please check SSRS log, Event viewer on Report server. Are you using print management to print this report. It might be because printer that you are using in Print management is not accessible to report server.

Hi Martin,

Thank you for your response. I don’t think I have useful information in SSRS log. please take a look at -

webserver!ReportServer_0-1!1bf8!09/17/2014-12:09:47:: i INFO: Processed report. Report=’/DynamicsAX/SysUserLicenseCountReport.Report’, Stream=’’
library!ReportServer_0-1!828!09/17/2014-12:09:47:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.StreamNotFoundException: , Microsoft.ReportingServices.Diagnostics.Utilities.StreamNotFoundException: The stream cannot be found. The stream identifier that is provided to an operation cannot be located in the report server database.;
webserver!ReportServer_0-1!828!09/17/2014-12:09:47:: e ERROR: Reporting Services error Microsoft.ReportingServices.Diagnostics.Utilities.StreamNotFoundException: The stream cannot be found. The stream identifier that is provided to an operation cannot be located in the report server database.
at Microsoft.ReportingServices.Library.StreamRequestHandler.IsFirstRequest(SessionfulClientRequest sessionManager, String imageId, Boolean getNextStream)
at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderReport(SessionfulClientRequest sessionManager)
at Microsoft.ReportingServices.Library.StreamRequestHandler.PerformStreamedOperation(StreamedOperation operation)
at Microsoft.ReportingServices.Library.StreamRequestHandler.RenderItem(ItemType itemType)
at Microsoft.ReportingServices.Library.StreamRequestHandler.ExecuteCommand()
at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderPage()

It happens when I send to printer( also with OneNote), working fine with printing on screen.

This is the event log error -

Event ID error 110 -

Object Server 01: Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ErrorException’ was thrown.

at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)

at Microsoft.Dynamics.Ax.MSIL.Interop.ThrowCQLFuncError(IL_CQL_ERR cqlErr, String typeName, String methodName)

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

at BatchIL.getServerSettings()

at BatchIL.threadFunc(Object threadArg)

Hi Vishal,

First of all, thanks for taking a look at.

I have checked event logs, here it is -

Object Server 01: Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ErrorException’ was thrown.

at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)

at Microsoft.Dynamics.Ax.MSIL.Interop.ThrowCQLFuncError(IL_CQL_ERR cqlErr, String typeName, String methodName)

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

at BatchIL.getServerSettings()

at BatchIL.threadFunc(Object threadArg)

I have tested to print on one note and it gives error. but works on screen.

I’m not sure if I’m able to help you, anyway please tell us more about your system. What’s the version of your SQL Server? Are SSRS integrated to SharePoint?

Does it happen only with the single report? Did it work before? Can you print it from the report server?

Hi Martine,

I regenerated the CIL and it’s working now, I’m not sure how long it will work cause I didn’t find the cause of it.

Could you please tell me if CLRObject is a kernel class or application. Can I debug this class?

thanks for your help.

CLRObject is a kernel classed used by .NET Interop from X++. You can’t debug it.

It’s used only in X++, not in CIL.