July 17, 2009 at 5:40 am
I want to add a row number at the bottom of my table on SSRS
what is the code for it?
July 17, 2009 at 5:49 am
Are you trying to add a field to your table which will indicate the "row number" of the row? In that case, what you want to do is add an identity field to the table, like this:
ALTER TABLE [TableName] ADD [FieldName] INT IDENTITY (1,1)
If you're trying to add a row number to your query result set, then what you want is this:
SELECT
[Criteria],
ROW_NUMBER() OVER (ORDER BY [ColumnName])
FROM
[Table]
WHERE
[WhereClauses]
July 17, 2009 at 5:54 am
Not clear buddy you want to add a row number or a page number??
July 17, 2009 at 6:01 am
i want to add a row number to the bottom of the table in SSRS.... so it count how many rows i have
July 17, 2009 at 6:04 am
Well, this isn't really the right forum for SSRS questions, but you've got several ways you could accomplish this. One of them is to use the ROW_NUMBER function that I mentioned above as part of your query, and then do a MAX() call against the ROW_NUMBER field to get the number of rows.
July 17, 2009 at 6:21 am
Use this SSRS function:
RowNumber(scope)
Parameters
scope
(String) The name of a dataset, data region, or group, or null (Nothing in Visual Basic), that specifies the outermost context, usually the report dataset.
July 17, 2009 at 7:05 am
how do i set the scope to 'String'?
July 17, 2009 at 7:14 am
joseph_smithy (7/17/2009)
how do i set the scope to 'String'?
The scope isn't String, the scope's type is String. The value is the data set in your case.
July 17, 2009 at 7:21 am
Got it now...
The name of my dataset it 'DrillThru'
So if i enter the following on the bottom row of my table.
=RowNumber(DrillThru)
I get the following error -
Error1[rsInvalidAggregateScope] The Value expression for the textbox ‘textbox8’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set.00
July 17, 2009 at 12:35 pm
Did you try =RowNumber(Nothing)
October 26, 2009 at 3:54 am
Try this =RowNumber("DrillThru")
October 26, 2009 at 3:55 am
Try this
=RowNumber("DrillThru")
October 27, 2009 at 9:20 am
joseph_smithy-1130150 (7/17/2009)
i want to add a row number to the bottom of the table in SSRS.... so it count how many rows i have
You could also use "=count(Fields!?????????.Value)" as the expression if the rownumber(nothing) doesn't work for you.
May 24, 2011 at 5:38 pm
Thanks! "Nothing" fixed it.
May 2, 2012 at 5:16 am
you can use dataset name with ", see below example
=RowNumber("DrillThru")
you can also use nothing, if you want sequence number and not reset on specific field.
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply