Thanks!
28 Answers, 1 is accepted
You can use the RowCount() built-in function for this purpose.
Sincerely yours,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Indeed I was referring to the RowNumber function - sorry for the confusion.
Best wishes,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

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.
Actually my idea was to point you to an unique row identifier that can be used as argument in Count() aggregate function, which would give you the record count i.e. =Count(RowNumber()). Your solution can also work, but you would have to make the iCount field Shared as well in order to use it in a shared method.
Best wishes,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Thanks for your help!
Jason

I want to count the number of rows with a certain condition, e.g. =Count(field.status = 'On-Time'). I would expect this would count only the rows that where the expression evaluates to true, however, it does not. It appears that count always returns the number of rows regardless of what column name you use as a parameter, which makes the parameter seem useless. Certainly, I am missing something here.
How can I accomplish this?
TIA
Bob
The Count function returns a count of all non null values from the specified expression. So you can achieve this with a proper expression:
=Count(IIf(Fields.status = 'On-Time', 1, null))
Sincerely yours,
Steve
the Telerik team

Thanks, that does the trick.
Bob

DataSource = ReportItem.Parent.DataObject
function RowNumber() not work. it show number "1" all rows.
As you can see from the documentation, the RowNumber(scope) function returns a running count of all rows in a specified scope. More information about the Expression scope is available in the referenced help article.
All the best,
Steve
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

"Aggregate/RowNumber/ColumnNumber functions cannot be nested."
Is there something I'm missing?
Since the initial implementation of the RowNumber function, we improved it to support scope and now it works as running aggregate and aggregate functions do not allow nesting.
To accomplish your task set an expression using the Count aggregate like:
= Count(Fields.SomeField)
If you need further help, please elaborate on the scenario and what accumulations have to be added to your report definition.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Total Number of Rows: 2
TextField 1: Data
TextField 2: Data
Row Number: 1
TextField 1: Data
TextField 2: Data
Row Number: 2
This is pretty much what I would like to accomplish my report. Can you help?
Try using Data Functions to get the number of records. In the attached example report definition, in a group section is used the Exec data function where the scope is the whole report, and we count how many times there is a certain field in the report.
If you need further help, please open a support ticket and send us mode tails about your report layout and the needed count.
Regards,
Stef
Telerik
Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

I have a data field that I use to group my data by.
In each group I would like to show the group number in a textbox
Group 1
detail section
Group 2
detail section
and so on.
Is there a way to e.g. add a counter that shows the current group?
BR,
Per

I did add a user defined function in my ClassLib for those who might want to know.
Thanks!

Hi, maybe it does not fit the main topic, but I hope to use RowNumber?
I have a groupHeader section, where I display grouped data. After each group member, a pageBreak is used (property pageBreak set to after for this section).
A the same moment, I would like to display a footer, which generally should be not visible (property set to false). I wanted to use Bindings and there set the property Visible to true under condition, after each group member of the groupHeader section.
Do you know any solution for that?
Jola
I am uncertain about the desired report layout., but please check if using conditional page breaks helps you to achieve it
More details about the available data functions can be found here.
Regards,
Stef
Telerik

Hi Stef,
thanx for answer, in fact I want to gain this:
I have section with grouping, after each group member page break appears. Just in this moment, I want the footer to be visible, and only at this page, where the particular group member ends. Nowhere else - just before the moment of the group page-break-after.
Jola
Most probably you have set the group sections' PrintOnEveryPage property to true which causes the sections to appear on each physical page. If I have misunderstood you, please add screenshots with remarks what is illustrated on them and what is the expected result.
Regards,
Stef
Telerik


@ Pushkar:
Tell me more !
- What is the item displaying the data ? ( Table, Textbox , .. )
- Where is the Datasource bound ? is the Data Bound to the report himself ?
To the table ?
- Any filter ?
- Are you using some ReportParam ? Can you display it to be sure you re not getting the default one ?

- it is displaying table
- datasource is bound using inline select query in sql datasource. yes to the table
- no filter is there
- i am using 4 report parameters, from date, to date, dattype (coming from stored procedure) and name(coming from inline query)



try to reproduce the weird behavior with a simple table.
A New one, bound to the same datasource dont recreat the query or anything, the same one.
Use header to display key paramters( Im pretty sure this is the issue)
In the table cell display some random data Owner name.
If the displayed Params give you different result in the new Table and in the Querry builder.
I wont be able to help you. You better open a ticket or wait for Admin here.
Regards,
Pierre LEBON
Double check the filters applied to the table or SqlDataSource component.
To provide you further suggestions we would need to check the report's settings. Please open a support ticket and attach the problematic report with test data if possible.
Regards,
Katia
Telerik by Progress