Issue: Leveraging SrsResources.dll using ConfigMgr Reporting Services Reports used to work... but after an upgrade or reconfiguration any reports using the expression "=SrsResources.Localization.GetErrorMessage(Fields!ErrorCode.Value, User!Language) " in the report just says #Error
I'll give the quick resolution here, and the long explanation later.
- Get the absolute latest version of SrsResources.dll you have, by looking at any CM Administration Console installation, in the \bin folder.
- On the Server which has your ConfigMgr Reporting Services Role, on the same drive where you have that role, make a directory (call it whatever you like, but for this example, I'm calling it CMSrsResources, and for me, the drive was S:. Copy that latest SrsResources.dll to S:\CMSrsResources folder.
- On the Server which has your ConfigMgr Reporting Services role, you will have had to install SQL Reporting Services. Find that installed location, it might be on C:, D:, or elsewhere. The folder will likely be "something like" ....\MSRS13.MSSQLServer\Reporting Services\ReportServer. In that location will be a rssrvpolicy.config file. Edit rssrvpolicy.config in notepad, and look for the reference to SrsResources.dll. It is most likely pointing to ...\MSRS13.MSSQLServer\Reporting Services\ReportServer\bin\SrsResources.dll. CHANGE that to point instead to what you did in Step 2. In my case, it would be S:\CMSrsResources\SrsResources.dll. Save the config file. (if it won't LET you save the config file, go to Services, and stop the SQL Reporting Services 'service', then save it.)
- Restart the service for SQL Reporting Services, or Restart the Server.
The long Explanation...
We have multiple custom reports, especially for Application Deployments, where knowing what an errorcode number means in a localized language (in our case, usually English) is very handy, instead of looking at that information in the console. SQL reports are preferred in many instances. In order to get that localization, according to multiple sources, the way to do that using ConfigMgr is 3 steps:
- rssrvpolicy.config for your SQL Reporting Services needs to have the SCCM Assembly referenced, pointing to the location of the SrsResources.dll file.
- that SrsResources.dll file has to exist in that location identified in the .config file.
- for any individual Report for ConfigMgr, for the report properties, on the 'References' tab, add the SrsResources assembly. Inside that report, presuming an error code is one of the values of your dataset, you can use the expression =SrsResources.Localization.GetErrorMessage(Fields!ErrorCode.Value, User!Language to get that information displayed in legible english (if you are english speaking, french if you're french, etc. etc.)
I noticed after CM 1610, and then again after CM 1702, apparently what is done "for me" is either permissions are reset, or something else fun is happening--maybe it's only when you are using SQL 2016, I don't know (all my labs and production are SQL 2016 latest). But the .config file, if it's pointing to the Reporting Services\ReportServer\Bin location... It just won't read it and use it. What the report displays instead of a nice handy english-y message is just #Error . If I instead copy the .dll elsewhere, and edit the .config file to say "go find it over here" -- it uses it just fine.
Here's hoping this might help others if they like leveraging the SrsResources.dll within ConfigMgr reports, and they are doing everything by the book... and yet it still doesn't work. You might just need to copy the .dll elsewhere and edit the config file.