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

Datasource not updating

4 Answers 360 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
DGraham
Top achievements
Rank 1
DGraham asked on 26 Mar 2009, 12:06 PM
Hi I have an asp .net application, on my page is a reportviewer, I also have created a report (rptSummary)

below is the Page_load event of my page

 

 

 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        If Me.IsPostBack Then 
 
 
            If Me.RadDatePickerStartDate.SelectedDate.HasValue = True And Me.RadDatePickerEndDate.SelectedDate.HasValue = True Then 
 
                Dim newrpt As New rptSummary(CDate(Me.RadDatePickerStartDate.SelectedDate.Value), CDate(Me.RadDatePickerEndDate.SelectedDate.Value))  
                Me.ReportViewer1.Report = newrpt  
 

                Response.Write(

CType(CType(Me.ReportViewer1.Report, rptSummary).DataSource, svcDailyStats.clsDailyStatistics).intTotalCalls)

 

 

            End If 
        End If 
 
 
    End Sub 


 And here we see some code from my report

 

Imports System.ComponentModel  
Imports System.Drawing  
Imports System.Windows.Forms  
Imports Telerik.Reporting  
Imports Telerik.Reporting.Drawing  
 
Partial Public Class rptSummary  
    Inherits Telerik.Reporting.Report  
 
    Private objDailyStats As svcDailyStats.DailyStats  
    Private DailyStats As svcDailyStats.clsDailyStatistics  
 
    Public Sub New()  
        InitializeComponent()  
        objDailyStats = New svcDailyStats.DailyStats  
        DailyStats = objDailyStats.GetDailyStatsEmpty()  
        Me.DataSource = DailyStats  
    End Sub 
 
    Public Sub New(ByVal startDate As DateByVal enddate As Date)  
 
 
        InitializeComponent()  
 
        objDailyStats = New svcDailyStats.DailyStats  
        DailyStats = objDailyStats.GetDailyStats(startDate, enddate)  
        Me.DataSource = DailyStats  
 
 
    End Sub 
End Class 

Now as an example lets assume I submit my page with the values of RadDatePickerStartDate = '01/03/2009' and RadDatePickerEndDate = '02/03/2009'

The report runs, the datasource is set with the newly created business object using these 2 dates as expected.

Now lets suppose I change those 2 dates and submit the page again, for some reason the report doesn't change. You'll see the response.write in the above code, intTotalCalls is a property of my business object that I am setting as a datasource for my report. This value will change and display on my page as expected for the response.write but it will not change in my visible report and always remains the same as the first time the report was run as do all other fields in the report.

 

4 Answers, 1 is accepted

Sort by
0
DGraham
Top achievements
Rank 1
answered on 26 Mar 2009, 12:18 PM
0
DGraham
Top achievements
Rank 1
answered on 26 Mar 2009, 01:12 PM
Rolling back to Q3 2008 fixed the issue, I'll stick with that version for now.
0
Accepted
Chavdar
Telerik team
answered on 26 Mar 2009, 01:52 PM
Hi DGraham,

Indeed, there is a problem with the new version of the Report viewer. To workaround it you have to set the EnableViewState property of the viewer to false. This should fix the issue.

We are sorry for the inconvenience.

Greetings,
Chavdar
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
DGraham
Top achievements
Rank 1
answered on 26 Mar 2009, 03:28 PM
Thanks for this, I'll await a patch and then try the upgrade again.
Tags
General Discussions
Asked by
DGraham
Top achievements
Rank 1
Answers by
DGraham
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or