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
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