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
JHThere 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
"JH" <JH@.discussions.microsoft.com> wrote in message
news:58E724E9-12A4-4F95-B83E-578E9E9D64CA@.microsoft.com...
> 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
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment