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

ReportViewer, doesn't refresh correctly

3 Answers 198 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 1
Javier asked on 28 Jun 2012, 04:54 PM
Hi,
I have a page where i have to load a list of reports, when i click on a button i go to the next report and change the datasource from the viewer but when the postback returns the page shows the reportviewer toolbar on the center of the page, and I have to click the refreshbutton to show the report correctly.
Here is an example of my code

Protected Sub rToolBarMain_ButtonClick(sender As Object, e As Telerik.Web.UI.RadToolBarEventArgs) Handles rToolBarMain.ButtonClick
        Dim button As RadToolBarButton = e.Item
        Select Case button.CommandName
            Case "NextRep"
                If selectedIDs.Count > 0 Then
                    'Selecting next item of the list
                    Dim id1 As Integer
                    id1 = selectedIDs(nextIndex)
                    If id1 > 0 Then                        
                        fvrID = id1
                        nextIndex += 1
                        If nextIndex >= selectedIDs.Count Then
                            nextIndex = 0
                        End If                                             
                        Dim dt As New DataTable                        
dt = GetReportDT(fvrid)

                        If dt.Rows.Count > 0 Then  
                            Dim report As New RepTest()
                            report.DataSource = dt
                            report.Report.DataSource = dt
                            ReportViewer1.Report = report
                        End If
                        ReportViewer1.RefreshReport()
                    End If
                End If
        End Select

3 Answers, 1 is accepted

Sort by
0
Elliott
Top achievements
Rank 2
answered on 28 Jun 2012, 09:00 PM
are you using the Q2 2012 version?  Telerik deprecated setting the ReportViewer Report property to a report object
see
http://www.telerik.com/help/reporting/winforms-report-viewer-embedding.html for the new way to do it

they "charged" me one day of support because they changed their software - and broke mine....
0
Steve
Telerik team
answered on 29 Jun 2012, 07:57 AM
Hi,

@Javier: the code looks correct excluding the unnecessary report.Report.DataSource = dt line i.e. the Report property of a report is the object itself. You say "change the datasource from the viewer", but you do not get the report from the viewer, rather create a new report (New RepTest()). We do not understand what you mean by
"the page shows the reportviewer toolbar on the center of the page" - can you elaborate or show a screenshot. Do you set height of the viewer in percentage, if so have you applied height to all other elements in the DOM tree containing the viewer?
If you're still having problems, it would be best if you open a support ticket and attach a runnable project that exhibits the problem.

@Marianne - changes are needed in order to become more flexible and introduce new functionality, they are never intentional because we want to "break your software". All of the changes we have made are listed as breaking changes in the release notes and the documentation has been updated to comply with the new changes.

Regards,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM PST for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. You may even win a free Telerik Ultimate Collection license! Register today >>

0
Javier
Top achievements
Rank 1
answered on 30 Jun 2012, 12:48 AM
Thanks for the replies, but I found the problem, it was related to a JS function that i am using to set the height of the div that contains the reportviewer, I was using a RadAjaxPanel with this property calling the JS function ClientEvents-OnResponseEnd="setDivHeight", but when I changed the panel to a RadAjaxManager with the same property it worked fine.
I'm sending you a screenshot for your information. and Im using this version Q2 2012 .



Tags
General Discussions
Asked by
Javier
Top achievements
Rank 1
Answers by
Elliott
Top achievements
Rank 2
Steve
Telerik team
Javier
Top achievements
Rank 1
Share this question
or