Follow on Google News News By Tag Industry News News By Location Country(s) Industry News
Follow on Google News | Export HTML to Excel – component for .NETElerium Software has introduced a new version of Elerium HTML to Excel .NET component.
By: Elerium Software If a small amount of data, it can be moved in the Excel spreadsheet manually. But what if it is needed to convert a lot of HTML documents inside C#/VB.NET/ASP.NET project? The best and the fastest way is a using of different .Net libraries. One of these libraries is introduced by Elerium Software. Elerium HTML to Excel .NET component offers full support for HTML formatting, including tables, CSS, graphics, tables, borders and is able to convert HTML to Excel files (XLS, XLSX, CSV). First of all, a developer must install HTML to Excel .NET component to the project: 1. Download the latest version of the component from this link: http://www.eleriumsoft.com/ 2. Extract the downloaded archive and put the Excel.dll component into /bin folder of the project. 3. Add the component to the “using” section: using Docs.Html; using Docs.Converting; using Docs.Spreadsheet; When the component is connected to the project, a developer can convert HTML to Excel spreadsheet. This code will display how simple it is to convert HTML file to Excel workbook with formatting: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Docs.Html; using Docs.Converting; using Docs.Spreadsheet; namespace PreserveFormatting { class Program { static void Main(string[] { // Read the specified html file. HtmlDoc html = HtmlDoc.ReadHTML(@" // Convert Html table to Excel with formatting preservation HtmlToExcel htmlexcel = new HtmlToExcel(); htmlexcel.PreserveFormatting = true; ExcelWorkbook excel = htmlexcel.Convert( //Add text and save Excel file as XLSX format. excel.WriteXLSX(@" //Open specified file in MS Excel. System.Diagnostics.Process.Start(@" } } } Also the component allows editing the resulting Excel file and placing the resulting table to a certain place on the page: using System; using System.Collections.Generic; using System.Text; using Docs.Html; using Docs.Converting; using Docs.Spreadsheet; namespace SetPositionTable { class Program { static void Main(string[] { // Read the specified html file. HtmlDoc html = HtmlDoc.ReadHTML(@" // Set position Row 2, Column 1 HtmlToExcel htmlexcel = new HtmlToExcel(); htmlexcel.RowStart = 2; htmlexcel.ColumnStart = 1; // Convert Html table to Excel starting from cell "B3" ExcelWorkbook excel = htmlexcel.Convert( //Add text and save Excel file as XLSX format. excel.Worksheets[ excel.Worksheets[ excel.WriteXLSX(@" //Open specified file in MS Excel. System.Diagnostics.Process.Start(@" } } } About Elerium Software Elerium Software develops professional solutions for use in .NET projects (C#, VB.NET, ASP.NET) that aimed to read/write/convert different office/web documents and formats. Elerium Software components are based on the unique design and fast algorithms that allow being independent from the third-party applications and libraries. For more information about the component please visit the product page: http://www.eleriumsoft.com/ If you have any questions or concerns about component, let us know: http://eleriumsoft.com/ End
Account Email Address Account Phone Number Disclaimer Report Abuse
|
|