excel|js|word| Report Printing because both MS Word and Excel's documents support HTML text formatting, you can use Word or Excel to do the template, save as a Web page, and then change the HTML to a JSP, filling the data part dynamically, No, it's hard. Adjust format
The word page simply sets the following instruction in the JSP header:
<% @page contenttype= "APPLICATION/MSWORD;CHARSET=GBK"%>
Excel is as follows:
<% @page contenttype= "APPLICATION/VND.MS-EXCEL;CHARSET=GBK"%>
In this way the client must have Office software installed and the page will be opened directly in IE with Word or Excel when the user accesses it.
This method advantage is the template design, the adjustment is convenient, does not need to use the complex poi or the JXL technology on the server side, also does not need to use the ActiveX control technology in the client, is more safe, convenient, easy to achieve the good printing effect.
Microsoft information about server-side dynamic creation of Office documents (ASP example):
http://support.microsoft.com/default.aspx?scid=kb;en-us;301044&
Simple example:
Use Word to create a document, drawing the following table:
----------------------------
| User name | Real name | sex |
----------------------------
| Guest | Passerby A | Male |
----------------------------
Save as a Web page test.htm, test.htm renamed to Test.jsp, modify the guest, passers-by a, male from the database dynamic query, as follows:
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.