This is a migrated thread and some comments may be shown as answers.

Interesting bug causes an infinite loop when report is rendered

2 Answers 187 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 29 Mar 2011, 05:56 AM
Hi Guys (and girls),

I have a super interesting bug.

I'm using the AJAX Telerik Report viewer inside an MVC project.

The parameters of the report are actually set programatically.
I have an AJAX.Form that lets the user set some parameters. This will draw a report by overriding the parameters like so:

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    MyBase.OnLoad(e)
    'Bind the report viewer
    If Model.Report Is Nothing Then
        Throw New Exception("Sorry an error has occured. (The report must be intialized before render attempt)")
    End If
     
    If Model.ReportParameters Is Nothing Then
        Model.ReportParameters = New Telerik.Reporting.ReportParameterCollection()
    End If
     
    For Each existingParam In Model.ReportParameters
        Model.Report.ReportParameters.Add(existingParam)
    Next
     
    modularRptViewer.ParametersAreaVisible() = False
    modularRptViewer.Report = Model.Report
     
End Sub

It never finishes rendering. it just sits there on "Generating report"

The report it is binding using a sql dataSource.  I've put a trace on the sql server and i can see it endlessly hitting the stored procedure the datasource uses. (It also endlessly calls [sp_procedure_params_100_managed] passing_in_the_SP_name)

any idea what is going on?
Could it be caused by having a table sitting in the details section (this always makes me feel weird).

Regards,

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 31 Mar 2011, 04:34 PM
Hello Joseph,

Our suspicion is that the infinite loop could be because of the AJAX thus our suggestion is to turn it off. If this is not the cause you can try to pause the application execution to debug it.

Let us know how it goes and if you need additional assistance we will appreciate if you prepare and send us a sample runnable project to debug locally.

All the best,
Peter
the Telerik team
0
Joseph
Top achievements
Rank 1
answered on 05 Apr 2011, 05:42 PM
Hi Support,

I found the cause, sort of. 
I moved the grid to the report header. Now it only calls the sp once.
Problem solved. Mystery remains.

Regards,
Tags
General Discussions
Asked by
Joseph
Top achievements
Rank 1
Answers by
Peter
Telerik team
Joseph
Top achievements
Rank 1
Share this question
or