Export data to Excel and export data to Excel

Source: Internet
Author: User

Export data to Excel and export data to Excel

First, let's look at the figure. This is the data exported to Excel using NPOI a few months ago. It uses hundreds of lines of code and is difficult to control. It is also difficult to export.

 

Excel opening Effect

 

The following is how I export data to Excel using the ExcelReport Class Library:

1. First, reference the ExcelReport class library and use NuGet.

 

2. Now you can write the exported code. ExcelReport provides a good API. If there are no more than 30 lines of code, you can export the code.

 

In comparison, the most important thing is that the customer can independently edit the template font and color.

If NPOI is used to output this format, it may take a few days.

Finally, it should be noted that if the data has a GUID type, it is exported as a null value, as long as GUID. ToString ().

Additional reading

Author Boyuan: http://www.cnblogs.com/hanzhaoxin/p/4472860.html

Another Yuan You based on ExcelReport Extension: http://www.cnblogs.com/zuowj/p/5133935.html (because he provided the API is mostly DataTable, more suitable for WinForm)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.