I'm working on a project involving the .NET ReportViewer, and I'm having issues connecting to the Report Server.
I'm a .NET newbie so bear with me. I can't put up the code but hopefully someone will be able to give me a little guidance here. I dragged the ReportViewer control from the toolbox onto a newly created page. Eleventy billion issues later, I got to the point where it looks like it's connecting to the appropriate server.
Now, I don't have any C# code in here. It's all in these fustrating tags.
So, I have a tag. Nested within, a tag. The ServerReport tag has 2 attributes, ReportPath and ReportServerUrl. I added a second, ReportServerCredentials, but do not know how to format it. Every example I've seen has been using C# code to create the object, but I'd like to do this without going down that route.
Is there a way to pass a user and password using the ReportServerCredentials="" attribute?
Default authentication provider for reporting services is windows authentication. So, if you want to connect to reporting services via reporviewer you should use a windows credential. on the other hand you have options to implement forms authentication or use custom authentication you have developed.
If you are using the WinForms version you may set the credential easily as follows:
ReportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = System.Net.CredentialCache.DefaultCredentials;
Unfortunately that property is read only for the ASP.NET version, so I suggest you to look at SSRS ReportServerCredentials thread. If it doesn't meet your requirements then you may need to implement IReportServerCredentials to send your username and password to the report server.
Hope this help.
Related
We develop an ASP.NET application that displays tabular data to users. The data comes from stored procedure in a database. We developed a custom control to display this data in HTML table. However lately, we discovered the beauty of using Report Server and migrated all of our reports there.
The situation is that we offer this application to both users with Report Server and without Report Server installed. We would like to offer old-reports style to users without RS and embed RS controls to those who have RS installed --- but both solutions integrated into one application.
How should we handle assembly references? Is namespace Microsoft.Reporting.WebForms always available? If not can we use .NET library file as part of our application and distribute it with it? Are there any problems that might arise?
The fact that RS is or is not installed (and its address) would be handled via configuration file.
Could you please help me? Thanks all in advance.
You can deploy/distribute the appropriate ReportViewer DLL's with your own application/code, for websites I don't think you specifically need to install the ReportViewer on the server. The web.config will need to be adjusted, there's this MSDN article which describes all the different aspects.
As far as I can tell from your question, you'll allow users of your code to switch between a control that does or doesn't use a ReportViewer, based on an AppSetting (or something akin). This should be perfectly possible with the above setup.
I have configured ASP user database. I can create users/roles either programmatically or by going to Project -> ASP.Net configuration in Visual Studio IDE.
Server this database is running on doesn't have VS installed. Is there a way to add users/roles through command line or IIS settings?
Thank you
If you set the connection string properly you can use VisualStudio running locally to configure your remote asp.net membership database.
I do that all the time.
Make sure your connections strings are right on your Web.Config file.
This is the easiest unless you want to code it yourself.
*Edit *
Just to be clear, you are not required to have Visual Studio installed on the server which hosts the membership database.
However this only works if you are not storing any additional data per user which is not part of asp.net's MembershipUser class.
In most cases you would implement a register page where you would collect the additional info. On submit you create a new MembershipUser (using MembershipProvider API) and then persist the additional information as best suits your needs. I typically use the MembershipProvider and have an store my custom info in an AppUsers table, (with the asp.net userId as a FK).
Hope this helps ;-)
Using MembershipProvider and RoleProvider is very, very easy. Ask if you need some sample snippets.
You can create a simple site or an admin only page on your current site and use the CreateUserWizard control. A Guide to customizing this control can be found here: https://web.archive.org/web/20211020103243/https://www.4guysfromrolla.com/articles/070506-1.aspx
Documentation here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.aspx
You can also use the membership objects to do this through code if you want to create your own console application to do it from the command line.
Do not try and do this in the database directly.
you can just add them manually to the database tables, there not that hard to deduce, just apply insert commands using your favorite sql client
Hai,
i am trying to store the user permissions for my web site.But I am little bit confused with xml and Database. For each user in site have different permissions. Have u ever faced this issue? for Example , if my site is a shopping site , for a local user , the report menu need not to display. A sales man need not to display the purchase page. and so on ..
I think you understood my problem .I have done this user management using a xml file . For each user a new node will create according to the menu and keep in the xml file . Next time the user login ,checks the permissions and and show only the allowed menus.
My boss tell me to do the same thing using the Database. by using XmlDataSource it is quite simple to bind data to the treeview (for setting permission) and binding to the menustrip also.
He is pointing the security problem . i don't think like so.
Which is better ? DB or XML
http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx
My advice would be to use asp.net membership and roles (written by Microsoft). It is a very good security solution - login security, roles (permissions) and is stored in a SQLServer database (not sure if it can be stored elsewhere).
I use it on my site and you can use membership controls straight out of the box (login forms, change password, etc.) or you can roll your own.
The only tricky bit I found was setting up the membership tables, views and stored procs in my dB (you download a dB script), but really it was fairly straightforward to implement.
Here's a link to asp.net membership and roles
ASP .NET Membership and Roles (part of the Provider Model introduced on ASP .NET 2) is (IMHO) nice only when you need some basic stuff. The issue is that you need to use the whole system using SQL Server, but if you are planning to move to a different DB provider (MySQL, SQLite, etc..) then you'd have to implement your own provider (which is at best painful), and learn how the whole pieces fit each other. Granted, finding a custom implementation it's quite easy, but is not a copy & paste thing.
Another bad thing of the default provider model is that you will get a ton of SQL stored procedures, also called maintainance nightmares. The issue is that if your site scales, then these SP's will make your life a living hell (been there) and if you even dare to change hostings then you're in for a treat, so my advice would be make your own permissions hierarchy and use it the way you wish. Also, look for advices and some pre-existing solutions to the permissions problem which is quite common.
Website security can be split up into to distinct parts.
Authentication: Logging in
Authroization: Roles/Permissions.
The ASP.NET Forms Authentication Provider is a great way to implement authentication. I recently created a custom provider that communicates with our companies X500 directory (LDAP). It was very straight forward.
For Authorization, we implemented the entlib security application block. It allows you to keep Roles/Permissions in a separate location that can be accessed by your UI as well as your service layers (assuming your developing a scale-able solution). You may also want to look at the Windows Itentity Foundation which is slated to supersede entlib security application block, however it is only available for .NET 4.0.
I need to create a subscription for my SSRS reports in an asp.net page.
I can show the reports in a reportviewer using Reporting.WebForms.
SSRS is on the another computer in my network. For reportviewer, I use "admin" and "pass" for credentials which is the SSRS machine's admin username and password and it's ok. And admin has all the roles for SSRS reports.
But when I try to createSubscription via ReportingService2006 web service I can't make it.
I'm not a professional nor amateur. searched the web a lot.
tried this and the odetocode version of this:
1. technet - something similar 1
But couldn't make it happen. Really appriciate any help. thx in advance.
An alternative would be to setup some of your reports using "Data driven subscriptions". I find its pretty easy to manage this if your going to be doing alot of updates to your report subscriptions. It will allow you to interact with user subscriptions via a custom SQL table.
You can find a MSDN tutorial on setup for Data driven subscriptions here
There is a good article and source code here, it's the best info on this topic I've found so far.
http://www.codeproject.com/Articles/36009/Programmatically-Playing-With-SSRS-Subscriptions
There is also a class reference here
http://msdn.microsoft.com/en-us/library/ms165967%28v=sql.90%29
I'd like to be able to view the event log for a series of asp.net websites running on IIS. Can I do this externally, for example, through a web interface?
No, but there are two solutions I would recommend:
Adiscon EventLogger is a third-party product that will send your Windows EventLog to a SQL database. You can either send all events or create filters. Of course, once the events are in a SQL database, you can use any of the usual tools to create a web interface.
You can use ASP.NET's HealthMonitoring configuration section to configure .NET to send all ASP.NET-related events directly to a SQL database. This covers exceptions, heartbeats, and a host of other event types. The SqlWebEventProvider is a cinch to setup.
Do you want to know if you can home-roll something or are you looking for an app you can get off the shelf?
I'm not a Windows guy, but I think Microsoft's MOM/SCOM solution will probably let you view the event log over a web UI - probably really heavy and expensive if that's all you need though.
A quick google found http://www.codeproject.com/KB/XML/Event_Logger.aspx which shows that you can get in if you want to roll your own... also an MS tool on msdn
Sorry I can't be more help