Solved

SSRS Column Header Number

Posted on 2013-01-17
3
1,101 Views
Last Modified: 2013-01-28
I have a report from ssrs and now I want to place the number on top of the column name.Is it possible w/o doing hardcoding as I have 200 columns.

Lets say--I have a report that displays name,lastname,class and age.So on top of the field name I want to autogenerate this number without typing in like 1 ,2, 3, 4.Thanks in advaance

 1                2                       3                         4    
name     lastname            class                 age
0
Comment
Question by:Josh2442
3 Comments
 
LVL 12

Expert Comment

by:Saurabh Bhadauria
ID: 38792380
0
 

Author Comment

by:Josh2442
ID: 38793611
@Saurv I already checked that link,before posting this forum.But That only implies to the rows not the columns.

Thanks
0
 
LVL 6

Accepted Solution

by:
liija earned 200 total points
ID: 38800213
Hi,

Add a small custom code on the report:

Public columnNumber As Integer = 0
Public Function ColNumber(ByVal colNo) AS Integer
Dim retColNo As Integer
columnNumber =columnNumber + colNo
retColNo = columnNumber
return retColNo
End Function

Then call the code from every column header like
=Code.ColNumber(1)

It simply just adds 1 to the variable in the code on each column.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now