below is the Page_load event of my page
Protected Sub Page_Load(ByVal sender As Object, ByVal 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 Date, ByVal 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.