Goalng export Excel (Excel Format)

Source: Internet
Author: User

I have written an article about how to export the CVS format. If it is just a simple export, it can fully meet the needs. If you want to have complex requirements on time, such as style customization and multiple sheets, you cannot do it. Later, we found that some people have implemented the direct Excel operations. Here we will share with you.
Address: https://github.com/tealeg/xlsx
For specific operations, you can directly look at the examples provided here or directly view the code. The usage is still very simple. Here is a simple test example:

Package mainimport ("FMT" "github.com/tealeg/xlsx") func test1 () {var file * XLSX. filevar sheet * XLSX. sheetvar row * XLSX. rowvar cell * XLSX. cellvar err errorfile = XLSX. newfile () sheet = file. addsheet ("sheet1") Row = sheet. addrow () cell = row. addcell () cell. value = "000101" cell = row. addcell () cell. value = "Chinese" Err = file. save ("myxlsxfile.xlsx") if Err! = Nil {FMT. printf (err. error ()} func Test2 () {var file * XLSX. filevar sheet * XLSX. sheetvar row * XLSX. rowvar cell * XLSX. cellvar err errorfile, _ = XLSX. openfile ("myxlsxfile.xlsx") sheet = file. sheet ["sheet1"] ROW = sheet. addrow () cell = row. addcell () cell. value = "000101" cell = row. addcell () cell. value = "Chinese 1" Err = file. save ("myxlsxfile1.xlsx") if Err! = Nil {FMT. printf (ERR. Error ()} func main () {test1 () Test2 ()}

  

Goalng export Excel (Excel Format)

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.