Web报告查看器输入字符串

时间:2013-05-09 06:46:31

标签: c# asp.net reporting-services reportviewer rdlc

开始时间: 我在用户控件中使用了ASP.NET Report Viewer。我有以下用户控件:(aspx)

 <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

    <rsweb:ReportViewer InteractivityPostBackMode="AlwaysAsynchronous" ID="rVControl" ShowRefreshButton="false" SizeToReportContent="true" ShowPrintButton="true"
    Width="50%" Height="100%" runat="server" Font-Names="Verdana" AsyncRendering="true"  ProcessingMode="Remote" 
    Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="12pt">
</rsweb:ReportViewer>

在代码背后我有:

public void LoadRVData() {
            rVControl.ProcessingMode = ProcessingMode.Local;
            rVControl.Visible = true;

            LocalReport report = rVControl.LocalReport;
            report.ReportPath = ReportPath;

            ReportDataSource rvSource = new ReportDataSource(ReportSourceName, ReportSource);            

            report.DataSources.Clear();
            report.DataSources.Add(rvSource);               
        }

一切正常,报告显示正确,但我有elmah,它在邮件中发送给我以下错误:

System.FormatException: Input string was not in a correct format.

Generated: Wed, 08 May 2013 17:15:19 GMT

System.Exception: %23ECE9D8 is not a valid value for Int32. ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
   at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   --- End of inner exception stack trace ---
   at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.Drawing.ColorConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.Drawing.ColorTranslator.FromHtml(String htmlColor)
   at Microsoft.Reporting.WebForms.BackgroundImageOperation.GetResource(String resourceName, String& mimeType, NameValueCollection urlQuery)
   at Microsoft.Reporting.WebForms.EmbeddedResourceOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response)
   at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

我认为错误是关于某种颜色但我没有在rdlc上放任何... 此外,在开发服务器上,报告的加载速度非常快,但在生产过程中它的速度很慢,差不多30秒..

如果有人可以帮助解决这两个问题......,那么

P.S。该错误仅在Web应用程序处于生产状态而非开发服务器(Cassini)

时显示

编辑: 错误地(将这个rv控件的样式与另一个带有firebug的项目的样式进行比较),我找到了问题所在。 RV Control创建一个html表和一个具有工具栏的表的td。这个td有一个带网址的背景图片。现在是:

 url("/myApplicationName/Reserved.ReportViewerWebControl.axd?OpType=BackImage&Version=11.0.3010.3&Color=%23ECE9D8&Name=Microsoft.Reporting.WebForms.Icons.toolbar_bk.png");

查看错误中的数字...。如果我删除“myApplicationName”一切正常,则错误消失。所以必须从那里开始。问题:我没有在任何地方输入这个url,它是由reportviewer自动生成的,并且控件没有像工具背景图像这样的属性来改变这个...所以相对路径或绝对路径问题

3 个答案:

答案 0 :(得分:0)

如果你使用的是asp.net 4.0和IE10,你需要在生产服务器上下载framework 4.5来解决这个问题

答案 1 :(得分:0)

  • 验证在生产和开发服务器中使用相同的框架。
  • 如果报告没有特定颜色的格式,则验证要调用的报告。

从我所看到的,他在“%23ECE9D8”中抱怨 我不明白为什么它出现百分比符号。可能存在错误。

答案 2 :(得分:0)

问题是我们正在使用反向代理。现在修好了。

相关问题