I have a SSRS report with chart, which chart can not be viewed recently. Error message 'Bad IL Range'

Qun Lu 0 Reputation points
2023-06-25T14:23:43.0966667+00:00

I have a SSRS report with chart, in which chart can not be viewed recently.

Error message 'Bad IL Range'.

I have no idea what this error mean.

Any idea how to fixed it?

User's image

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | .NET | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Talan Westby 0 Reputation points
    2023-07-14T14:37:06.06+00:00

    Hi,

    I've been working with Qun to investigate this issue. A reinstall of .NET Framework 3.5 and 4.8 has been carried out on the Windows Server and after some additional digging I've found the following error in the SSRS logs:

    reportrendering!ReportServer_0-1!15b4!07/14/2023-15:01:18:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: , Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: Bad IL range. ---> System.BadImageFormatException: Bad IL range.
       at Microsoft.Reporting.Chart.WebForms.Borders3D.BorderTypeRegistry..ctor(IServiceContainer container)
       at Microsoft.Reporting.Chart.WebForms.Chart..ctor()
       at Microsoft.ReportingServices.OnDemandReportRendering.ChartMapper.InitializeChart()
       at Microsoft.ReportingServices.OnDemandReportRendering.ChartMapper.RenderChart()
       --- End of inner exception stack trace ---;
    

    Any guidance would be most welcome as looking online there really doesn't seem to be much in terms of what to look for.

    0 comments No comments

  2. Anonymous
    2023-06-29T07:04:15.3366667+00:00

    Hi @Qun Lu

    I don't know much about .NET/C#. I found this similar thread for you and hope it can help you: https://stackoverflow.com/questions/13416240/what-does-bad-il-range-exception-mean.

    Best regards,

    Aniya


  3. Limitless Technology 45,181 Reputation points
    2023-06-26T16:52:04.6633333+00:00

    Hello Qun,

    Thank you for your question and for reaching out with your question today.

    The "Bad IL Range" error message in SSRS (SQL Server Reporting Services) indicates an issue with the Intermediate Language (IL) code that is generated by the .NET compiler when processing the report. This error typically occurs when there is a problem with the compiled code.

    Here are a few steps you can try to resolve the "Bad IL Range" error:

    1. Clear the temporary files: Sometimes, the issue can be caused by corrupted or outdated temporary files. Try clearing the temporary files related to SSRS on the server. The temporary files are typically located in the following directory: C:\Windows\Microsoft.NET\Framework\vX.X.XXXXX\Temporary ASP.NET Files\.
    2. Restart the SSRS service: Restarting the SSRS service can help refresh the system and resolve any temporary glitches. Go to the Services console, locate the SQL Server Reporting Services service, and restart it.
    3. Republish the report: If the error persists, try republishing the report to ensure that the compiled code is regenerated correctly. Publish the report again and check if the issue is resolved.
    4. Check the .NET framework version: Ensure that the correct version of the .NET framework is installed and configured for SSRS. Verify that the .NET framework version used for compiling the report matches the version configured in the SSRS environment.
    5. Review the report and chart configuration: Double-check the configuration of your report and chart. Make sure there are no errors or inconsistencies in the chart properties, data sources, expressions, or parameters that could be causing the issue.
    6. Check the event logs: Examine the SSRS logs or event logs for any additional error messages or details that could provide more insight into the cause of the issue.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    If the reply was helpful, please don’t forget to upvote or accept as answer.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.