我在'/'应用程序中收到服务器错误。
异常详细信息:
System.ArgumentOutOfRangeException:索引超出范围。一定是 非负面且小于集合的大小。参数名称: 索引
来源错误:
执行期间生成了未处理的异常 当前的网络请求。有关的来源和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。
堆栈追踪:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +67
System.ThrowHelper.ThrowArgumentOutOfRangeException() +16
System.Collections.Generic.List`1.get_Item(Int32 index) +19
Telerik.Reporting.HtmlRendering.HtmlElementRenderer.GetEndElement(ProcessingElement startElement) +267
Telerik.Reporting.HtmlRendering.HtmlElementRenderer.BeginRender(HtmlRenderingContext context) +382
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +17
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.HtmlTextBoxRenderer.RenderInternal(ProcessingElement processingElement, HtmlRenderingContext context) +163
Telerik.Reporting.HtmlRendering.HtmlItemRender.Telerik.Reporting.HtmlRendering.IReportItemRender.Render(ProcessingElement processingElement, RenderingContext context) +92
Telerik.Reporting.HtmlRendering.RenderingContext.Render(ReportItemBase item) +50
Telerik.Reporting.HtmlRendering.Matrix.RenderInternal(HtmlRenderingContext context) +3645
Telerik.Reporting.HtmlRendering.Matrix.Render(HtmlRenderingContext context) +40
Telerik.Reporting.HtmlRendering.ReportSectionBaseRenderer.RenderInternal(ProcessingElement processingElement, HtmlRenderingContext context) +69
Telerik.Reporting.HtmlRendering.HtmlItemRender.Telerik.Reporting.HtmlRendering.IReportItemRender.Render(ProcessingElement processingElement, RenderingContext context) +92
Telerik.Reporting.HtmlRendering.RenderingContext.Render(ReportItemBase item) +50
Telerik.Reporting.HtmlRendering.HtmlPage.RenderReportSections(HtmlWriter bodyWriter) +557
Telerik.Reporting.HtmlRendering.HtmlPage.RenderBody(HtmlWriter bodyWriter) +320
Telerik.Reporting.HtmlRendering.HtmlPage.Render(HtmlTextWriter primaryWriter, HtmlRenderingContext renderingContext) +112
Telerik.Reporting.HtmlRendering.HtmlReport.Render(HtmlTextWriter writer, Int32 startPage, Int32 endPage) +304
Telerik.Reporting.HtmlRendering.HtmlReport.Render(HtmlTextWriter writer) +56
Telerik.Reporting.HtmlRendering.HtmlRenderingExtension.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +134
Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback) +352
Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, CreateStream createStreamCallback, String& documentName) +421
Telerik.ReportViewer.WebForms.ServerReport.Render(HttpResponse response, String format, Int32 pageIndex) in c:\Projects\Reporting\FromSC_scrum\@ReportingBuild\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ServerReport.cs:90
Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperation(NameValueCollection urlQuery, HttpContext context) in c:\Projects\Reporting\FromSC_scrum\@ReportingBuild\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ReportPageOperation.cs:25
Telerik.ReportViewer.WebForms.HttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) in c:\Projects\Reporting\FromSC_scrum\@ReportingBuild\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\HttpHandler.cs:59
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +705
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137
我在Telerik Report查看器中收到此错误。 仅针对特定条件获取此错误,而不是针对所有值。
我错过了什么?
请帮帮我。
答案 0 :(得分:0)
我有同样的问题。我还没有想出它的起源,但我想它来自数据源绑定。在报表上创建新实例时,它会在InitializeComponent()方法中创建默认控件(例如,包含0行的List或不包含文本的TextBox)。当您绑定数据源(例如,List with 3 items)时,它将引用List(Telerik Reporting控件)并尝试将带有3个项目的集合绑定到0行控制。所以在这种情况下你有OutOfRangeException。我猜是这样的。
UPD:实际上,我昨天解决了我的问题。这完全是因为我尝试将空集合绑定为控件的数据源。我刚刚将默认对象(带有空属性)添加到我的集合中,如果它在绑定之前不包含任何元素。答案 1 :(得分:0)
我们间歇性地遇到了一个非常相似的问题。有时候,清除Telerik状态数据库表似乎可以解决该问题。您可以在下面的脚本中将@Condition
翻转到1
以执行删除。
DECLARE @Condition AS BIT = 0;
IF @Condition = 1
BEGIN
DELETE dbo.tr_AppLock;
DELETE dbo.tr_Object;
DELETE dbo.tr_Set;
DELETE dbo.tr_String;
END;
SELECT *
FROM dbo.tr_AppLock AS tal;
SELECT *
FROM dbo.tr_Object AS tob;
SELECT *
FROM dbo.tr_Set AS ts;
SELECT *
FROM dbo.tr_String AS ts;
答案 2 :(得分:0)