Data analysis and reporting with Microsoft Excel under ASP.NET

zhaozj2021-02-11  177

The statement is a very powerful tool for data analysis and generating reports. Embedded in VB.NET can do work under Excel. People working in the finance industry know how Excel has been widely used. When working under Excel, business people tend to use Excel more skilled than developers. For a long time, the software will develop into distributed computing and N-layer structures. In the past, when the data was stored in an Access database or a general file, we will enter the data in an Excel file manually, and use this data to do some business operations. Today, this article focuses on how to get the best information.

Excel and asp.nexcel automation objects and use VB Write Excel Macros and are not headings of this article. There are many websites and resources available on the Internet. This article only discusses how to use Excel under the Internet environment (ASP.NET).

The purpose of this article is mainly to introduce the data analysis function application of Excel under ASP.NET. This article will focus on how to get the best Excel template on the Internet and quickly respond to data.

Regarding the examples in this article, the method in the example is not necessarily directly used in the actual product environment. This article is to reveal some methods and concepts when doing ASP.NET and Excel.

Example 1 This method has some shortcomings and where you need to pay attention. Check out this article "Additional Source Code". If the Excel automation object is not properly used for the current web server, it may get a state in which the web server is inconsistent. Please pay attention to these places and as soon as possible.

Notes on Excel 2003: Excel 2003 has a better interface for supporting DOTNET. There are a lot of articles on Excel 2003 and DOTNET on Microsoft website. Some links are also in this article. If you have Excel 2003, this article can only help you understand some concepts.

To quickly browse many of the data libraries for the third part of the third part, can be established to better internet applications in providing graphic / graphs or reports. The methods proposed in this article have extensive use of Excel and reports. Expanded using the existing Excel report template and exactly through the Internet. Subjectively, when there is no better solution being developed, this method is considered as a rapid solution.

Example - Excel Report Demonstration This article provides an existing Excel file establishment report. This example can also generate a pie chart or 3D list chart from an Excelt. The last report can be generated as an Excel or HTML format.

Install and run the following example · Download ? 362 KB) and decompress it locally. http://www.asp101.com/articles/jayram/exceldotnet/excel_reporting_in_aspnet_sample.zip The virtual directory 'ExcelReportDemo' is created with IIS while pointing the directory to the decompressed folder. · Operation "DCMCNFG.EXE" [DCOM Configuration Tool] · You will see the window of 'Distributed Com Configuration Properties' · Double-click' Microsoft Excel Application 'in the' Applications' list box · Select 'Security' Tags · Select ' Use customer access permission 'radio, click' edit 'button • OK in the' Registry Value Permissions' window to add a local 'ASPNET' user or a user who can run the ASP.NET process in this unit. · Add the ASPNET user, click OK • Select 'Use Custom Launch Permission' radio, click 'Edit' button • OK in the 'Registry Value Permissions' window to determine the local 'ASPNET' user or the ASP can be run in this unit. User of the NET process. Note: The DCOMCNFG.EXE tool is to configure DCOM Applications. In this example, ASP.NET is automated with an Excel and calls Excel Application. By default local 'ASPNET' users, unique ASP.NET processes (not the role of the .NET used). Therefore, it is important to give the correct login DCOM 'Microsoft Excel Application' permission to the ASPNET user. Otherwise, run this example, when the Excel Application object is called, the anomaly of 'Access Denied' will be thrown.

Software environmental requirements: · Excel 2000 (Version 9.0) [If you have Excel 2002 (Version 10.0), see the comment section in the example. · ASP.NET / .NET FRMEWORK [Version 1.0 or above]

Examples of operational processes: · Business users give developers to developers using the EXCEL electronic data sheet for the report. • With the help of business users, developers exclude all Direct access to Excel files and then through the worksheet data driver report in Excel files. Developers put this discussion in the 'ReportTemplates' directory of the 'ExcelreportDemo' project. · After understanding the data source, the developer queries the running data and replaces the static data in the Excel worksheet for the actual data. Excel let us get a rest in the work. If the end user please ask the HTML format, the Excel output interface is swaying蒆 TML format report

The technique used in the example · ASP.NET calls Excel with Excel Automation Object to read the data load from a simple XML file. The data may come from the SQL Server or Oracle database. · Since Excel 2002 is used in this example, the data set is copied in the Excel. This is considered to be a very simple element method, which is a very effective way to transmit data. • Automated objects through Excel is all attributes that can access chart objects and chart. This example does not expand with Excel automation objects.

Example 2: Excel Report Demo - Display Report Please show the page test example: (Example 2 Show report information)

· Before the test example, follow the installation instructions for this list. · Enter the address http://localhost/excelreportdemo/runreports.aspx into the address bar. · Select 'Report Format' [Excel or HTML] • Point button 'Run Report' Run Report • Point Button 'Additional Resources', display the additional source code and Excel program describing the server automation object. · Example shows a simple HTML format report. This example will generate several temporary files when generating a temporary file report is requested. Simple code cannot be done with any automatic cleaning Script code. Please delete or write a WMI scripts code or .bat file. These code or files cannot be scheduled to be automated by the Windows scheduler. This code or article cannot be used in a simple part.

Thank I want to thank my wife, Sheela Tallamraju, helping to edit this article. I would also like to thank Tom Montgomery and Praveen Ray that I wrote this file.

Additional resources: • Service automation objects Note http://support.microsoft.com/default.aspx?scid=kb;n-us;q257757 server chart http://support.microsoft.com/default .aspx? scID = Kb; EN-US; 244049 · Excel data from ADO / ASP http://support.microsoft.com/default.aspx?scid=kb;n-us;244049 pageweb page Operating Worksheet Function http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexcl2k/html/webfunc.asp·Office Web Component Application example http://support.microsoft.com/ DEFAULT.ASPX? SCID = KB; EN-US; 258187 · Server Office Web Components Http://support.microsoft.com/default.aspx?scid=kb;n-us; 317316 @ado.net and Excel (2003) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrwlkusingadonettoExchangeDataWithDatabase.asp

About the author Jayram Tallamraju is a software architect, a system analyst, and a master's degree in Boston for Bisys Hedge Fund. He is .NET MCP (Microsoft Certified Expert), MCSD (Microsoft Certified Solution Development Expert) and SCJD (Sun Certified Java Development Expert). He also received a master's degree in electronics, working in software for ten years. He once attacted the construction of a service system and constructing reusable commercial components. Now, his research field is Microsoft technology, there is .NET, C #, Web Services, ASP.NET, VC / VB, COM / DCOM, ASP / IIS. Email: tjayram@yahoo.com

转载请注明原文地址:https://www.9cbs.com/read-5607.html

New Post(0)