Web报表查看器输入字符串

本文关键字:输入 字符串 报表 Web | 更新日期: 2023-09-27 18:12:53

开始:我用过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秒..

如果有人能帮助解决这两个问题…, thx

注:该错误仅显示当web应用程序在生产而不是在开发服务器(Cassini)

编辑:由于错误(比较这个rv控件的风格与另一个项目的firebug),我发现了问题所在。RV Control创建一个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自动生成的,并且控件没有像工具背景图像这样的属性来改变这个…相对路径还是绝对路径的问题

Web报表查看器输入字符串

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

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

据我所知,他在"% 23ECE9D8"中抱怨道。我不明白为什么会出现百分比符号。

问题是我们使用的是反向代理。现在固定。