Atitit. Design and solutions for exporting Excel features

Source: Internet
Author: User

Atitit. Export Excel design and solution of function

1 . 1. The project originated from the background 1

1 . 2. Js jquery scheme (recommended) Jquery.table2excel 1

1 . 3. Server Scenarios 2

1 . 4. More Information 2

1 . 5. Reference 4

1.1. The project originated from the background

Just our project is also in the study of faster export method. I finally got a conclusion yesterday. In addition to our commonly used backend export excel front-end Span style= "FONT-FAMILY:CALIBRI;" >js export excel 90% Field ... So a better export scenario is js Export ( 90% + 10% ), learn from each other, use

1.2. Js jquery scheme (recommended)jquery.table2excel

The advantage is a fast and simple implementation that moves the logic forward, bringing a more powerful cross-platform across the backend language. And the generated content is really xlsx Excel format (zip compressed XML format).

Generally suitable for 1000 or less

A jquery.table2excel plug-in implementation can be based on your needs to export the contents of the table, the unnecessary rows can not be exported. Friends who need this code can come and download it. This section of the code is compatible with the latest mainstream browsers

Using the Table2excel table plugin requires the introduction of jquery and Jquery.table2excel.js files in the page.

<scripttype="Text/javascript" src="Js/jquery.min.js"></script><scripttype="Text/javascript" src="Js/jquery.table2excel.js"></script>

Rationale:: Use the Traverse table to generate a binary Excel byte group, and then use the h5 API ArrayBuffer blob to trigger the browser to perform the download action

Author :: ★ (Attilax) >>> &NBSP;&NBSP; nickname : old Wow's paw &NBSP; ( &NBSP; full name:: ATTILAX&NBSP;AKBAR&NBSP;AL&NBSP;RAPANUI&NBSP; Attilax &NBSP; Baroque &NBSP; Alpha &NBSP; Rapa Nui &NBSP; ) &NBSP; Kanji name: Ayron, Email:[email protected]

reprint Please indicate source: http://www.cnblogs.com/attilax/

1.3. Server Scenarios

The advantage is performance, especially for more than 1000 records

1.4. More Information

If a row in the table does not need to be exported to Excel, you can add the. Noexl class to this line, which will be specified as data that is not exported when the plug-in is initialized.

Initializing plug-ins

After the page DOM element is loaded, you can initialize the Table2excel plug-in by using the following method.

$ ("#table2excel"). Table2excel ({

/// non-exported table row CSS class

exclude: ". Noexl",

// The name of the exported Excel document

Name: "Excel Document name",

The name of the//Excel file

filename: "myexceltable"

});

Configuration parameters

The available configuration parameters for the Table2excel plugin are:

·

Exclude: CSS class class for table rows that are not exported.

·

·

Name: The names of the exported Excel documents.

·

·

The name of the Filename:excel file.

·

·

EXCLUDE_IMG: Whether to export the picture.

·

·

Exclude_links: whether to export hyperlinks

·

·

Exclude_inputs: Whether to export the contents of the input box.

·

1.5. Reference

table2excel- exporting HTML table content to Excel - push cool . html

Export Html Table to Excel Spreadsheet using Jquery-table2excel _ Free jQuery plugins.html

javascript Span style= "FONT-FAMILY:CALIBRI;" >arraybuffer _javascript tricks _ .htm

web end js export csv ( use a tags )-oscar999 column - blog channel -CSDN.NET.html

[JS advanced ] JS of Blob Object Type -oscar999 's Column - Blog Channel -CSDN.NET.html

Atitit. Design and solutions for exporting Excel features

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.