0

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

Monic
  • 726
  • 10
  • 31
  • All if this is possible but, is there a reason you aren't using the actual SSRS server which has these features already? – Steven V Dec 06 '13 at 12:28
  • What features do you mean? – Monic Dec 06 '13 at 12:36
  • I want to have different layout than Report Manager has. For example on the top of site there will be information about logged user, under this there will be main report and below links to the others reports which are associated with the user. – Monic Dec 06 '13 at 12:41
  • 1
    maybe you should try a reportviewer. I can already tell you that every possible function on ssrs can be made with c#, the downsize is that it will become very complex. http://msdn.microsoft.com/en-us/library/ms251671(v=vs.110).aspx – Schuere Dec 06 '13 at 12:50

1 Answers1

1

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...

Schuere
  • 1,579
  • 19
  • 33
  • 1) I was talking about this: "But every user will have different links which he can see". One user can see reports A,B and another B,C. So first user will have links to reports A,B and by analogy the second user will see links to B,C reports. I don't have any coding example yet, becouse for now I have only such an idea, how it will look like. – Monic Dec 06 '13 at 13:35
  • I'm sorry for my not replying - I was busy with another project. I have another question - as far as I learned, these var q and l I should use in Controllers in VS, right? Could you tell me, where or how I can change needed parameters (depending on the user who is logged in)? – Monic Dec 18 '13 at 10:42
  • This comment states 2 more questions: 1) yes this logic needs to be placed in a controller unless you want the welknown spaghetti-Code; 2) this depends on where you want to place the report logic. on the website or on the report. I know it is both possible but i would suggest you keep the report logic in the report. If you know how to create a report with Parameters, you also will know you can create parameters based on parameters. see to this topic for the how part http://stackoverflow.com/questions/1053396/updating-report-parameters-based-on-perameter-selection-ssrs; – Schuere Dec 18 '13 at 11:16
  • Lastly, it's possible to pass parameters throught the reportviewer: http://stackoverflow.com/questions/1916924/how-do-i-pass-parameters-to-aspnet-reportviewer – Schuere Dec 18 '13 at 11:19