Sunday, February 19, 2012

Generate A Report Via Login

To all you experts out there, I have one hurdle I need help on.
I've created a SQL report which has 3 parameters asking for a from_date, a
to_date & an employee. The report then returns all projects, tasks,
yadda-yadda, for the employee, within the date range from a time tracking
database. Very usefull come performance review time.
My intention is to make this report available on Sharepoint via a link (or
Report Manager), where whoever logs into sharepoint (or Report Manager) can
access this report for themselves and no one else, meaning they click on the
report and get prompted for the date range parameters but not the employee
parameter. The report should recongize who is accessing the report by virtue
of their login & find the corresponding employee information in the database
& display the report for that employee.
Should this functionality be implemented in the SQL report or should it be
implemented within Sharepoint? Based on that question, how can this
functionality be implemented?
Thank you very much for the help.I assume you want to have the manager get all of his employees. You would
need a table somewhere with this relationship. Then use the global variable
User!UserID. This is the user running the report. Your query parameter does
not have to be mapped to a report parameter. Click on the ... for the
dataset, parameters tab, right side of list select expression which takes
you to the expression builder. Note that User!UserID returns the user with
the domain i.e. domain\userid
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"JDArsenault" <JDArsenault@.discussions.microsoft.com> wrote in message
news:A0AC7950-2EB1-4DE8-A466-B6A34CE5ACB6@.microsoft.com...
> To all you experts out there, I have one hurdle I need help on.
> I've created a SQL report which has 3 parameters asking for a from_date, a
> to_date & an employee. The report then returns all projects, tasks,
> yadda-yadda, for the employee, within the date range from a time tracking
> database. Very usefull come performance review time.
> My intention is to make this report available on Sharepoint via a link (or
> Report Manager), where whoever logs into sharepoint (or Report Manager)
> can
> access this report for themselves and no one else, meaning they click on
> the
> report and get prompted for the date range parameters but not the employee
> parameter. The report should recongize who is accessing the report by
> virtue
> of their login & find the corresponding employee information in the
> database
> & display the report for that employee.
> Should this functionality be implemented in the SQL report or should it be
> implemented within Sharepoint? Based on that question, how can this
> functionality be implemented?
> Thank you very much for the help.|||A manager can get to his employees (individually) as the report exists (with
a report parameter for the emp_name).
I completely forgot about the userid. Good news is I can match up the userid
to the substring of a field already being returned (emp_name), but I don't
quite follow how to set it up as a query parameter. Do I create a new dataset
or create this query parameter on the dataset for my existing result set
details(where emp_name exists)? Can you give me a hint on what the syntax
would look like?
Thanks
"Bruce L-C [MVP]" wrote:
> I assume you want to have the manager get all of his employees. You would
> need a table somewhere with this relationship. Then use the global variable
> User!UserID. This is the user running the report. Your query parameter does
> not have to be mapped to a report parameter. Click on the ... for the
> dataset, parameters tab, right side of list select expression which takes
> you to the expression builder. Note that User!UserID returns the user with
> the domain i.e. domain\userid
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "JDArsenault" <JDArsenault@.discussions.microsoft.com> wrote in message
> news:A0AC7950-2EB1-4DE8-A466-B6A34CE5ACB6@.microsoft.com...
> > To all you experts out there, I have one hurdle I need help on.
> >
> > I've created a SQL report which has 3 parameters asking for a from_date, a
> > to_date & an employee. The report then returns all projects, tasks,
> > yadda-yadda, for the employee, within the date range from a time tracking
> > database. Very usefull come performance review time.
> >
> > My intention is to make this report available on Sharepoint via a link (or
> > Report Manager), where whoever logs into sharepoint (or Report Manager)
> > can
> > access this report for themselves and no one else, meaning they click on
> > the
> > report and get prompted for the date range parameters but not the employee
> > parameter. The report should recongize who is accessing the report by
> > virtue
> > of their login & find the corresponding employee information in the
> > database
> > & display the report for that employee.
> >
> > Should this functionality be implemented in the SQL report or should it be
> > implemented within Sharepoint? Based on that question, how can this
> > functionality be implemented?
> >
> > Thank you very much for the help.
>
>|||Thanks Bruce...Got It. I created the UserID parameter as @.EmployeeName &
refered to that parameter in the data set as;
WHERE pe_date between @.FromDate AND @.ToDate
AND ('DOMAIN\' + Substring(descr,3,25)) = @.EmployeeName
OR ('DOMAIN\' + Substring(descr,1,1) + Substring(descr,3,25)) = @.EmployeeName
and it works just great. Thanks for shaking the cobwebs loose.
JD
"Bruce L-C [MVP]" wrote:
> I assume you want to have the manager get all of his employees. You would
> need a table somewhere with this relationship. Then use the global variable
> User!UserID. This is the user running the report. Your query parameter does
> not have to be mapped to a report parameter. Click on the ... for the
> dataset, parameters tab, right side of list select expression which takes
> you to the expression builder. Note that User!UserID returns the user with
> the domain i.e. domain\userid
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "JDArsenault" <JDArsenault@.discussions.microsoft.com> wrote in message
> news:A0AC7950-2EB1-4DE8-A466-B6A34CE5ACB6@.microsoft.com...
> > To all you experts out there, I have one hurdle I need help on.
> >
> > I've created a SQL report which has 3 parameters asking for a from_date, a
> > to_date & an employee. The report then returns all projects, tasks,
> > yadda-yadda, for the employee, within the date range from a time tracking
> > database. Very usefull come performance review time.
> >
> > My intention is to make this report available on Sharepoint via a link (or
> > Report Manager), where whoever logs into sharepoint (or Report Manager)
> > can
> > access this report for themselves and no one else, meaning they click on
> > the
> > report and get prompted for the date range parameters but not the employee
> > parameter. The report should recongize who is accessing the report by
> > virtue
> > of their login & find the corresponding employee information in the
> > database
> > & display the report for that employee.
> >
> > Should this functionality be implemented in the SQL report or should it be
> > implemented within Sharepoint? Based on that question, how can this
> > functionality be implemented?
> >
> > Thank you very much for the help.
>
>

No comments:

Post a Comment