SSRS; ASP.NET - Create site with login system where will be reports

837 views Asked by At

I want to have site in ASP.NET where will be simple login system. After login there will be also links to reports made in SSRS. But every user will have different links which he can see. Nicks and passwords I want to check by Windows Authentication.
1) I'm wondering is it possible to keep these information in another place than database?
2) How I can get similar layout as in Report Manager? I mean, how to display my reports by using ASP.NET?

I'm newbie in ASP.NET (I don't know if it possible to do such things), so I hope I made ​​myself clear.

Thanks in advance,
Monic

1

There are 1 answers

4
Schuere On BEST ANSWER

Question 1: What kind of information are you talking about, give a coding example or something based on your structure where the community can work on.

EDIT: Yes, it is possible to have the reports on a separate place. Moreover this means for each user you must create the rights under SSRS, in your page you then make a reference with the users authentication to SSRS. From there on, you then use SSRS functionality. This means an administrator will need to be around for every single new user to insert which report a user may see. This is an unhandy approach, because it is more easier just to give the SSRS address so all your users work from there. (You however have nothing to say over how the page looks.)

Question 2: ASP.net has a reportviewer control that gives you the ability to watch a certain report that is available on a reportserver. Most of the function of the SSRS reportviewer can be simulated in this control. Beware that you need to understand the control very good when you are using it. http://msdn.microsoft.com/en-us/library/ms251671(v=vs.110).aspx

As a sidenote:

I once created a website who had users with rights on different reports, different parameters based on their userid. I had a user table consisting out of intern (SSO) and Extern users. Also with different roles. Based on all that, different rights were given.

The link through for the reportviewer used a common reportuser instead of the user his own authentication, the userid then was given as an extra parameter were other parameters were based on.

EDIT:

When you want certain users to receive access to a report, create 3 tables: User, Report and UserReportLink

Example:

Userid | Name
1      | user A
2      | user B
3      | user C

Reportid | Name     |ReportLink
1        | report A | 'http://MyReportServer/reports/Report1.aspx'
2        | report B | 'http://MyReportServer/reports/Report2.aspx'
3        | report C | 'http://MyReportServer/reports/Report3.aspx'
4        | report D | 'http://MyReportServer/reports/Report4.aspx'

Userreportid | Userid | Reportid
1            | 1      | 1    
2            | 1      | 2
3            | 2      | 1    
4            | 2      | 2
5            | 2      | 3    
6            | 3      | 2
7            | 3      | 3    
8            | 3      | 4

Your page then will consist out of the following logic for the reports:

=> return the user who is logged in (Session perhaps since it's asp.net)

=> return a list of all reports the user needs to see

var q = (from m in UserReportLinks
         where m.Userid = this.UserId
         select m).ToList();

=> with the above you have your reports for the user.

var l = new List<Report>();
foreach(var item in q)
{
 var r = (from m in Reports
          where m.Reportid = item.Reportid
          return m).ToList();
 l.Add(r);
}
//populate a control so the user can select a report
aControl.DataSource = l;

=> lastly, with the selectedId, return the report into the reportviewer.

=> select parameters etc...