ASP.NET Report server conditional (if available) use - asp.net

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.

Related

Windows Forms vs ASP.NET to create a Data Maintenance program

I am creating a application which is mainly used inside a office for data maintenance. It will be used to store data like work list, future works, reminders etc .All data will be presented to user in the form of grids. So it's all about data stored in SQL server database. There will be number of users accessing it and they modify data frequently. Also there will be so many options like an ERP program.There is no connection to internet is required for this program.
So in this case which programming language is better? Should I choose WinForms or ASP.NET? The main concentration to choose between this will be performance, ease of use, also it should support more function for grid controls etc. So which one should I choose? And what will be the advantage and disadvantage of both?
Some pointers:
WinForms
Good
No webserver to install, setup and secure
Bad
Installation of some kind required on each machine e.g .NET framwork, exe, assemblies, etc.
More difficult to rollout updates to the application
ASP.NET
Good
No installation on clients required
Can run on machines other than windows including mobile devices
Updates to the application can be published instantly to all clients
Bad
Have to use IIS or UltiDev Web Server to serve up pages
File system is more secure so reading and writing to files can be time consuming to configure
Unless you want to use jQuery and Javascript to add additional functionality to the Standard ASP.NET GridView I would say a Windows Form would be more suited, depending on the size of the data it will most likely offer better performance and you have much more control over the actual functionality of the program, rather than dealing with browser related restraints.
Not really a question for this forum... VB.Net is a Language and ASP.Net is a Framework. Do you mean should I create a client windows app or a web (intranet) app then this would depend on your strengths as the intranet option would also require HTML and possibly CSS/Javascript.

Simple web form that writes to a database... access web form or custom ASP.NET?

I am working in a school and we recently installed a new server running WinServer 2008R2. I want to be able to point people to a URL on our intranet and have them fill out a simple registration form and have this data written to a database. It would also be nice to have some data auto-populate (such as their name).
Is it overkill to set up a sharepoint server and try to do this with Access Webforms?
Could I use something like dotnetnuke and find a module that works? Or how about options for writing custom forms?
Personally, I would definately not go with sharepoint for such a simple task. Besides money issues sharepoint is difficult to properly set up. Even with custom ECT's within sharepoint administration is a nightmare.
I would personally create a simple asp.net web form with some standard fields and you could use SQL Server or mySQL to push this data into a database. As for default values, that depends on how you want to set the fields, you could use windows authentication and set their user name to their NT login.
Creating a web form to fill in and collect data is not too difficult.
Have a look at http://www.asp.net/get-started. It is something you will find a lot of tutorials for. You might like to consider MySQL or SQL Server Express for your database. A Sharepoint server would definitely be overkill, unless you have some large ideas about sharing documents.
Sharepoint is way too overkill for something like this. Same for DotNetNuke or any other platform. Just do a simple ASP.NET page with an Access back end. I doubt you'll need anything bigger like SQL Server Express, although that might be a good learning experience.

Sharing Data Between Two Web Applications in ASP.NET

I have a web application (MainApplication) where many of the pages contain a custom Web Control that looks for some content in a cache. If it can't find any data within the cache, then it goes out to a database for the content. After retrieving the content, the Control displays the content on the page.
There is a web application (CMS) in a subdirectory within the aforementioned web application. Users use this CMS to update the content pulled in by the MainApplication.
When a user updates some content using the CMS, I need the CMS to clear the relevant portion of the cache used by the MainApplication. The problem is that, as two different web applications, they can't simply interact with the same static cache object.
The ideal solution would be to somehow share an instance of a cache object between both web applications.
Failing that, what would be the best (performance-wise) way of communicating between the two web applications? Obviously, writing/reading to a database would defeat the purpose. I was thinking about a flat file?
Update
Thank you all for your help. Your wonderful answers actually gave me the right search terms to discover that this was a duplicate question (sorry!): Cache invalidation between two web applications
We had the exact same setup in a previous project i worked on, where we had one ASP.NET Web Application (with MCMS Backing), and another ASP.NET Web Application to display data.
Completely different servers (same domain though).
However, when a "editor" updated content in the CMS application, the UI was automatically refreshed.
How? Glad you asked.
We stored the content in SQL Server, and used Replication. :)
The "frontend" Web Application would read the data from the database (which was replicated by the CMS system).
Now - we don't cache this data, because in the database, we actually stored the markup (the HTML) for the control. Therefore we dynamically re-rendered the HTML.
Why is that "defeating the purpose"?
You can't get one application to "invalidate" the cache on another application.
If you're going down this path, you need to consider a distributed caching engine (e.g Velocity).
One option that comes to my mind in such scenario is using Velocity distributed cache mechanism. Do read about it and give it a try if possible http://msdn.microsoft.com/en-us/magazine/dd861287.aspx
In ASP.NET there is the notion of Cache Dependency. You can have a look here: http://www.codeproject.com/KB/web-cache/CachingDependencies.aspx or http://www.devx.com/dotnet/Article/27865/0/page/5.
There is also the Enterprise Library Caching Block available here that adds some feature to the standard stuff: http://msdn.microsoft.com/en-us/library/ff649093.aspx
Now, if you're running on .NET 4, there is a new System.Runtime.Caching namespace that you should definitely use: http://msdn.microsoft.com/en-us/library/system.runtime.caching.aspx
This article here "Caching in ASP.NET with the SqlCacheDependency Class" is quite interesting: http://msdn.microsoft.com/en-us/library/ms178604.aspx

SQL Server Reporting Services ReportViewer authentication

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.

ASP.NET Web App Distribution

What is the simplest way to distribute an asp.net web application? I tried to look at some of the open source asp.net projects out there to see how they distribute their apps and how they do updates and they seem rather complicated to me (not for myself to perform but for non-technical users). A lot of them entail backing up the entire installed project, deleting specific folders and save parts of their web.config. I am hoping to find a solution that will make the update process specifically as simple as possible.
Thanks.
I am working on a project with a similar requirement now. We decided to use WiX to create an installer that can be run on the server or machine where the site is installed. WiX is incredibly powerful, but takes a bit to get the hang of.
There are plenty of other open source, and paid installer technologies as well. Here is a post with some info on a few.
CommunityServer provides a setup msi that will create a virutal directory, generate the SQL database and populate it with default data. Updating for point releases though is still a manual process involving an update.sql file and having everyone download then merge binary and static file changes.
They probably could have created an update msi too, but because so many people customize CommunityServer, it is probably better to let people merge changes themselves.
Do you mean in terms of breaking up the functionality into tiers that could be handled on separate machines, e.g. having 3 servers for a 3-tier architecture where one is the DB server, one handles middleware and the other handles the requests in ASP.Net? Another point here would be in going from a web server to multiple web servers in terms of scaling up.
Or are you referring to deployment?
It's a web application, man. Serve it publicly, require registration, and move on. Isn't that the point of the web application?

Resources