When jsp exports the ID card to excel, the format is incorrect, but it can end with X, jspexcel

Source: Internet
Author: User

When jsp exports the ID card to excel, the format is incorrect, but it can end with X, jspexcel

This morning, the customer told me that some of the IDS are correct when I export an excel file. I can see that the original ID card ends with X. Others are incorrect. Identity display:

After searching on the internet, I found that the scientific count is displayed if you have more than 12 digits in excel. The ID card is usually 18 characters, so it is shown as follows.

The solution is to add "single quotation marks" before the ID card column ". For example, '100

The Code is as follows: <td style = "border: 1px solid #000;"> '<s: property value = "id_card"/> </td>

This will solve the problem, but there will be a single quotation mark before the ID card number is exported.

========================================================== ======================================

I always feel that there is still a better way. I searched the internet and can set the td style during export, but it still does not work if I set it.

Wonderful things keep going. I can pass the local test and put it on the server will not work. Finally, we found a method that worked both locally and on the server:

Add the following code to the front of the page:

Copy codeThe Code is as follows:
<Style>
Td {
Mso-number-format :'\@';
}
</Style>


Now I need to export the ID card number from a software system. After export, the ID card number in excel is displayed as 433025E + 17. What should I do?

Find the installation directory of the software used to export the ID card system, and find the EXCEL template in it. There should be a template specifically used to export the ID card, set the format of the "ID card number" column in this template to "text", and adjust the column width to the appropriate width. The above method is only applicable to the software that exports data using templates. Otherwise, you can only modify the code of the software itself, so there is no way to do it.
 
Enter the ID card in Excel. How does one display the ID card in text format when the tail number of the ID card is X?

"There is a green triangle in the upper left corner of the page like the ID card number without X" -- this indicates that you have already set it to text format. No problem

Why does X have no green triangle? The purpose of the green triangle is to remind you: "NOTE: You have set the entered number to the text format. Do you want to change it ?" -- This is the meaning of the green triangle.
Now, the end of your data is x, which is in the text format. By inputting this x, you have already told EXCEL "I Am a text". Of course, EXCEL does not have to remind you of anything. So there is no green triangle.
The green triangle does not represent the text format. It is just a reminder.

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.