简体   繁体   中英

SQL Server Reporting Services - error running a report (Azure web site deployment issue?)

I have a ASP.NET MVC front-end which lists reports held on SQL Azure Reporting Services. The user chooses a report to run and that report is loaded in another browser window. The problem is that when the report runs on some browsers (IE10 on Win7, for instance) all that is displayed is the following message:

Method not found: 'Boolean Microsoft.ReportingServices.Common.DateTimeUtil.TryParseDateTime(System.String, System.IFormatProvider, System.DateTimeOffset ByRef, Boolean ByRef)'.

Using Chrome on Win7 the report 'half-works' - I get the top bar with a datetime box and another drop-down, and when I click the Run button I get the report nav bar but not the body of the report. I don't get the message above.

The web site is published to an Azure web site. I've referenced the following DLLs and set CopyLocal to true:

Microsoft.ReportViewer.Common
Microsoft.ReportViewer.WebForms
Microsoft.ReportViewer.DataVisualization
Microsoft.ReportViewer.ProcessingObjectModel

The published report works fine on my dev machine where I have the ReportViewer 2012 redistributable installed (version 11 of the control).

So, questions:

What other redistributable dlls am I missing from my published site? What is Microsoft.ReportingServices.Common? The 'ByRef' seems to imply this is VB - is this a client script component? Is there something I need to have installed on client machines to view reports?

The same issue happened where a method not found error on IE and Firefox after deployment occured, while running locally everything worked fine.

 Method not found: 'Boolean Microsoft.ReportingServices.Common.DateTimeUtil.TryParseDateTime(System.String, System.IFormatProvider, System.DateTimeOffset ByRef, Boolean ByRef)'.

what was happening is that in our local bin file there's a newer version of the Microsoft.ReportViewer dlls than the deployment server. When the deployment server added the dll's it selected a different version from the GAC than being used locally. Version 11.0.2 instead of 11.0.33 causing the miss match. After updating the dll's to the same version on the local machine it fixed the issue. there is a chance that after you re-deployed the correct dll was used, fixing your problem.

To verify the version of the dlls in your bin folder and deployment folder you can just use a simple power shell script after navigating to the folder holding the dlls.

dir *.dll | %{ $_.VersionInfo }

crackhaus's answer pointed me in the right direction.

Here is the full sequence of steps I followed:

  1. Used the following PowerShell command to check the version numbers of the assemblies in the bin folder:

     dir *.dll | %{ $_.VersionInfo } 
  2. Discovered that one of the ReportViewer assemblies had a different version number from the other two.

  3. I checked the version number for that DLL in my local GAC, and found that the GAC DLL matched versions with the other two DLLs in my bin folder.

    I used Option 2 described here to access the GAC (basically: PowerShell to c:\\WINDOWS\\assembly\\GAC_MSIL\\<Assembly Name>\\<Assembly Major Version>), and the command above to check version numbers.

  4. Using PowerShell ( copy-item command), I extracted the DLL, and placed it into the site's BIN folder.

转到Nuget并安装,从那里获得Micorsoft.ReportViewer运行时2012和ReportViewer.Common 10.0

This has fixed the problem for me, though I have to admit I don't know why...

Just add the SizeToReportContent="true" attribute to the tag in the aspx page, eg:

<rsweb:ReportViewer ID="ReportViewer1" runat="server" SizeToReportContent="true" Font-Names="Verdana" Font-Size="8pt" Height="100%" ProcessingMode="Remote" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
    <ServerReport />
</rsweb:ReportViewer>

Magically, it all seems to be working.

We had the same issue. I want add that you need to copy all 4 dlls to the server:

Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.DataVisualization.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll

We had the same issue. We used the dlls from the redistributable: http://www.microsoft.com/en-us/download/confirmation.aspx?id=35747

I decided to install Microsoft System CLR Types for Microsoft SQL Server 2012 and Microsoft Report Viewer 2012 Runtime to the server according the MSDN article . After that I removed wrong assemblies from the site bin directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM