all groups > sql server reporting services > october 2006 >
You're in the

sql server reporting services

group:

Possible to grab Report Authors name to use in report?


Possible to grab Report Authors name to use in report? JH
10/20/2006 8:31:03 AM
sql server reporting services: Hi all,

We would like to put the Report Authors name in the footer of our reports. I
know there is a global "User!UserID" that picks up whoever runs the report,
but is it possible to pick up the windows logon, or something to
automatically fill in a field for report author?

Thanks
JH

Re: Possible to grab Report Authors name to use in report? msnews.microsoft.com
10/20/2006 1:12:16 PM
There are two ways to do it...
:)

Of course, what you are asking, I have to make an assumption:
"The user that uploads the report or deploy's the report is the user that
created it"

Use the following T-SQL and have a dataset in your report get the author:
select * from reportserver.dbo.[catalog] cat

inner join reportserver.dbo.users usr

on (cat.createdbyid = usr.userid)

where name = @ReportName

In the dataset properties - bind @ReportName to the global property for the
report name.

The second way is if you want the TRUE author of the report and that they
have FILLED IN the author name field in report properties in the designer
AND then if you are using an application (as we are) to render the reports
instead of the web interface, you can get the report author by loading the
report properties for Author, then return the author name to pass it as a
parameter to your reports to be displayed:
Note: I have left out code -> I just wanted to show you how it is done to
give you just the necessary points:
' Create the property to retrieve.

Dim retrieveProp As New RSPolarisReports.[Property]

retrieveProp.Name = "Author"

Dim props(0) As RSPolarisReports.[Property]

props(0) = retrieveProp

Try

Dim properties As RSPolarisReports.[Property]() = rs.GetProperties(sPath,
props)

Catch e As Exception

bExists = False

End Try

=-Chris

[quoted text, click to view]

AddThis Social Bookmark Button