The RowNumber() function will provide the row number for each record in the detail section, but I would like to actually have a record count of all of the records to display in the header of the report. Ex. The report shows that there are 24 pages to the report. I would like to display that there are 24 pages and 192 records total. Is this possible?
I can get the recordcount in the code-behind page, but I can't figure out how to display that on the report. If I use a public shared function, I am unable to reference the record count from the code-behind even if I make the record count a global variable. You can't reference a global variable from a shared function.
Code Below:
-----------------------------------------------------------------------------------------------------
Public iCount As Integer
Private Sub FacilitiesByAO_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
Dim oDBAccess As New cDBAccess 'Custom Class that builds a dataset
oDBAccess.Open(sSQLStatement)
iCount = oDBAccess.RecordCount ' iCount is populated properly with the record count (Number of rows returned)
Dim Report As Telerik.Reporting.Processing.Report = sender
Dim view As DataView
view = oDBAccess.DS.Tables(0).DefaultView
Report.DataSource = view
End Sub
Public Shared Function RecordCount() As String
Return iCount.ToString 'This line will not work because it is referencing a class variable
End Function
-----------------------------------------------------------------------------------------------------
Thanks for your help.