.Net, ADO.NET, ASP.NET, C#, DB Connection Example, Example Connection, Excel, Excel 2003, Excel 2007, JavaScript, JQuery, Programming, Regular Expressions, Web Development

JQuery with ASP.NET: Save Copy / Paste Excel Data to a Database Table

Have you ever wanted to help your users move data from Excel to your Web application? In this article I will give an example in ASP.NET that takes copied Excel spreadsheet rows from the user’s clipboard and saves the information to a SQL Server database table.

Since ASP.NET runs at the server level, you will need to use JavaScript/JQuery to get the Excel information from the user’s clipboard. You will need to use a different command to get the information depending on the user’s browser. In this example, I code specifically for Internet Explorer, but this is just since I am giving an example. In a real-world application you would code for all of the major browsers. Continue reading “JQuery with ASP.NET: Save Copy / Paste Excel Data to a Database Table”

Advertisement
.Net, ASP.NET, Excel, Excel 2003, Excel 2007, Excel 2010, IIS, IIS6, MS Office, Outlook, Security, Web Development, Web Server, WebForms

Configuring a Web Server to Allow Excel File Creation via the Interop.Excel Namespace

In an earlier article I covered how to generate Excel reports on the fly using the Interop.Excel Namespace.

This is a really handy technique that also gives you full control over the minutia of the document you are creating. However the catch in using this technique is that you will need to update the configuration of your Web server to allow Web users to trigger Excel on your Web server. This can mean some pretty drastic security changes and possible loopholes in your Web server’s security so you should do a risk analysis before choosing this method.

In this article I will review the Web server security updates that need to be made to allow using the Interop.Excel Namespace to generate Excel documents for your Web site.

Please note that since I am developing this site for an Intranet, I am not as concerned with locking down the server. If you are working with a server that is exposed to the Web then you will want to review these security changes much more thoroughly.

Continue reading “Configuring a Web Server to Allow Excel File Creation via the Interop.Excel Namespace”

.Net, ADO.NET, ASP.NET, Excel, Excel 2003, Excel 2007, Excel 2010, MS Office, Programming, VB.NET, WebForms

ASP.NET – Generating an Excel Report on the Fly Using the Interop.Excel Namespace

As a developer, a commonly requested feature is the ability to export data from the Web into MS Excel.

Choosing the best way to export your data from an ASP.NET Web page to Excel for your users is never an easy task. There are several ways to generate your reports, with each way having its pros and cons. For starters you’ll have to take into consideration if you are developing a Web based application that needs to enforce strong security, or a more permissive Web-based application that will allow you to write temporary files to your server’s hard drive.

In an earlier article I covered one of the more common ways: how to take an existing report that has already been generated as an HTML table and stream it as Excel to the client browser. This is a great technique, but leaves it up to Excel to interpret the HTML that you are sending its way. Furthermore, Microsoft seems to be deprecating the markup that was previously so amazingly convenient when formatting HTML streamed to Excel. The article also goes into depth about what markup commands are still useful and what markup has been deprecated. It’s definitely worth reading this article if you are considering streaming HTML as an Excel document using the command: Response.ContentType = “application/ms-excel”

Before I go into further details on using the Interop.Excel namespace to generate Excel files, I’d like to point out that I am providing a fully functional example at the end of this article. If you are primarily interested in the code, then you can skip to the bottom of this article and you can copy and paste the code sample into a Visual Studio project where it should run without any problems.

Continue reading “ASP.NET – Generating an Excel Report on the Fly Using the Interop.Excel Namespace”