【问题标题】:web report viewer input stringWeb 报表查看器输入字符串
【发布时间】:2013-05-09 06:46:30
【问题描述】:

开始: 我在用户控件中使用了 ASP.NET 报表查看器。我有以下用户控制:(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 秒..

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

附:该错误仅在 Web 应用程序处于生产状态而不是在开发服务器 (Cassini) 中时显示

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

 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自动生成的,并且控件没有像工具背景图像这样的属性来改变这个......所以相对路径或绝对路径问题

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

    • 我使用的是 .net 4.0 但不是 IE,问题出在所有浏览器上
    【解决方案2】:
    • 验证在生产服务器和开发服务器中使用相同的框架。
    • 验证要调用的报告是否没有特定颜色的格式。

    据我所知,他在“% 23ECE9D8”中抱怨 我不明白为什么它会出现百分比符号。错误可能在那里。

    【讨论】:

      【解决方案3】:

      问题是我们使用的是反向代理。现已修复。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-10-02
        • 1970-01-01
        • 2011-07-14
        • 2010-12-20
        • 2014-12-21
        • 1970-01-01
        • 2011-09-09
        相关资源
        最近更新 更多