JSP export Excel format settings __js

Source: Internet
Author: User
Mso-number-format: "0" NO Decimals
Mso-number-format: "0\.000" 3 decimals
Mso-number-format: "\#\,\#\ #0 \.000" Comma with 3 Dec
Mso-number-format: "Mm\/dd\/yy" Date7
Mso-number-format: "Mmmm\ d\,\ yyyy" Date9
Mso-number-format: "M\/d\/yy\ h\:mm\ am\/pm" D-t AMPM
Mso-number-format: "Short Date" 01/03/1998
Mso-number-format: "Medium Date" 01-mar-98
Mso-number-format: "D\-mmm\-yyyy" 01-mar-1998
Mso-number-format: "Short Time" 5:16
Mso-number-format: "Medium Time" 5:16 am
Mso-number-format: "Long Time" 5:16:21:00
Mso-number-format: "Percent" Percent-two Decimals
Mso-number-format: "0%" Percent-no Decimals
Mso-number-format: "0\." E+00 " Scientific notation
Mso-number-format: "\@" Text
Mso-number-format: "\#\??? \/???" Fractions-up to 3 digits (312/943)
Mso-number-format: "\0022£\0022\#\,\#\ #0 \.00" £12.76
Mso-number-format: "\#\,\#\ #0 \.00_ \;\[red\]\-\#\,\#\ #0 \.00\"

2 decimals, negative numbers in red and signed
(1.56-1.56)

Use examples:

When we use <% @page contenttype= "application/vnd.ms-excel; Charset=utf-8 "%> method to export a JSP file as Excel, if the exported data has a number starting with 0, then the 0 will be omitted, in order to keep the first 0, you can add in the table style:

Style= ' Mso-number-format: "\@";

In this case, the number of the first 0 in the table that is exported will retain the 0.

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.