SSRS reports, exporting to EXCEL gives rrRenderingError error - The type initializer for 'MS.Utility.EventTrace' threw an exception
Asked Answered
C

6

11

I'm running SQL Server 2016 and have local reporting services running. I can run my SSRS reports up fine and display them to screen. I can also export them to PDF or to CSV but if I try to export to Word, PP or EXCEL I get:

Reporting Services Error
An error occurred during rendering of the report. (rrRenderingError)
An error occurred during rendering of the report.
The type initializer for 'MS.Utility.EventTrace' threw an exception.
Requested registry access is not allowed.

the same report works fine on other peoples machines in the office so I know it's not to do with the report itself. I've tried Has anyone else had this issue or know how I can shift it?

Counterattraction answered 24/8, 2017 at 14:55 Comment(1)
hi benb, i'm having the exact same issue, with ssrs 2017. Did you solve the issue?Insincere
G
15

I just spent hours troubleshooting this in a fresh install of SSRS 2019 using an updated database from a prior version.

I'm using an execution account with low permissions and did not want to make it a full Local Admin permanently but I tried adding it, unsuccessfully.

I removed the account from unattended execution in Report Services Configuration Manager and suddenly was able to export to XLSX. I was not sure what the fallout would be for existing reports, so I was not satisfied with this solution either.

Elsewhere I saw a recommendation to use Process Monitor (procmon) to watch for registry key access denials, you can download it here procmon. It was difficult to search all of the output but you can filter by registry key access, then look for the RS executables or the result ACCESS DENIED.

In my case, it was HKU\%service account sid%\Software\Microsoft\Avalon.Graphics, and granting the execution account (not the account that runs the service) Read access to this key resolved the issue.

Gunderson answered 23/9, 2020 at 14:48 Comment(4)
Spot on! Same error, exact fix. I'm now able to export ExcelOpen format (true, XLSX) after setting reg key ref'd above w/ the account that runs as my Execution Account - though I had to explicitly give the reg-read-rights, even tho the account was in the local admin group.Mcavoy
Using procmon, I was unable to find the ACCESS DENIED entry. However, the posted solution worked for me. Using regedit, I searched for "Avalon.Graphics" and numerous entries showed up. For each one of them, I right-clicked on the registry folder, selected "Permissions..." -> Add button. Typed in "Everyone" as the obejct name. Then used the "Everyone" username to allow Read access.Carrier
Went down a rabbit hole trying procmon (my own ineptness) but went back to what you said about the sid: I was running reporting services as the network service so once I decoded which sid that was, I went to Computer\HKEY_USERS\S-1-5-20\Software\Microsoft\Avalon.Graphics (that's the network service sid) and granted [the domain user execution account I was using] read rights to that key. Just had to bounce SSRS service after that, and it worked immediately. Thanks for saving my bacon!Sholokhov
I struck this same issue just now, with SSRS 2022 clean install, exporting to Word. I just went straight for the regedit fix (Avalon.Graphics permissions) and it seems to have resolved it. Bizarre and random bug in their installer?Av
I
4

I got the same issue. Check in the URL (once you click on excel) whether the format is EXCELOPENXML. If yes change it to EXCEL.

Then it will download and work correctly.

You can enable it to 'EXCEL' by default by changing the 'rsserverconfig' file under reporting services. It will download in 'xls' format not 'xlsx'

NOTE: This solution is a common workaround when rendering extensions fail to work due to your deployment configuration or environment.

RSServerConfig
C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\rsreportserver.config

Look for the Render section, enable or disable the export formats that you want your users to have access to. see Rendering Extensions Overview on SQLDocs for more information on individual extensions.

    <Render>
        <Extension Name="WORDOPENXML" Type="Microsoft.ReportingServices.Rendering.WordRenderer.WordOpenXmlRenderer.WordOpenXmlDocumentRenderer,Microsoft.ReportingServices.WordRendering"/>
        <Extension Name="WORD" Type="Microsoft.ReportingServices.Rendering.WordRenderer.WordDocumentRenderer,Microsoft.ReportingServices.WordRendering" Visible="false"/>
        <Extension Name="EXCELOPENXML" Type="Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.ExcelOpenXmlRenderer,Microsoft.ReportingServices.ExcelRendering" Visible="false"/>
        <Extension Name="EXCEL" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering" Visible="true"/>
        …
    <Render>
Interdictory answered 21/1, 2019 at 9:31 Comment(0)
N
1

I had the same issue in SSRS 2019, and the fix was quite easy.

In Report Server Configuration Manager > Service Account, I had it set to "Use built-in account" = "Virtual Service Account".

I changed to "User another account", and selected a local users who is part of the Administrators group.

NOTE: This is NOT the Execution Account. This is for the Service Account.

Needlefish answered 28/11, 2020 at 7:5 Comment(0)
V
1

I set up a new reporting server and had the same issue (this affects Power BI Report Server too) and managed to solve it based on the other answers above but as I had specified specific service accounts the fix did not work so this is what should work no matter which account is used as the service account for running the report server.

First on the server open Report Server Configuration Manager and click on Service Account on the left. Review which account is being used to run this. Next go to Execution account and review which account is set up there as the execution account needs to read that registry key against the Service Account (this is not the generic "Service Account" in Windows).

Now go to Registry Editor still on the server to this key (can be copied and pasted on more recent Windows Server versions):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Click on each SID one by one and look at ProfileImagePath to find the name of the service account so you know which SID it uses.

Now go to the following location:

Computer\HKEY_USERS\[Service Account User SID As Shown in Report Server Configuration Manager]\Software\Microsoft\Avalon.Graphics

Grant read access to the folder to the user set up against the execution account in Report Server Configuration Manager.

Now go back to Reporting Services Configuration Manager and stop and start the service and reports should now export to Excel.

Alternative workarounds as listed, to export to an older .xls format or remove the execution account work as then Avalon Graphics are not used but the option above would seen the better option unless an Execution Account is not needed. Running the service as an elevated user would also work but probably adds more risk.

Vinyl answered 11/6, 2023 at 14:33 Comment(0)
V
0

You could be getting this error in Excel because the maximum number of rows that can be put in an excel sheet is 65536. If your data has more rows than that it will throw that error.

Vins answered 30/8, 2017 at 4:28 Comment(1)
Thanks S.Khan, it's a short report so I don't think this is the issue. To be honest I think, when I get some time, I'm going to have to do some reinstalling.Counterattraction
T
0

I had the same issue in SSRS2016 on a clean install of Windows Server 2016 & SQL 2016 with SSRS with all SP's & CU's and windows updated applied.

To confirm my fix, the execution account was not a member of the local administrators group on the SSRS server, once added and stop/start of SSRS, I am now able to export to Excel & Word, not the most secure way of getting it working but better than enabling the depreciated Excel 2003.

Towland answered 2/3, 2020 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.