admin 管理员组文章数量: 1086019
2024年4月19日发(作者:evaluation的同义词)
import edOutputStream;
import tputStream;
import ;
import tFoundException;
import tputStream;
import ption;
public class javaxml {
/*
* java大数据导出xml或excel
* */
public static void main(String[] args) {
StringBuffer sb = new StringBuffer();
try {
DataOutputStream rafs = new DataOutputStream(
new BufferedOutputStream(new FileOutputStream(new File(
"d://"))));
("");
("n");
("");
("n");
(" xmlns="urn:schemas-microsoft-com:office:spreadsheet""); ("n"); (" xmlns:o="urn:schemas-microsoft-com:office:office""); ("n"); (" xmlns:x="urn:schemas-microsoft-com:office:excel""); ("n"); (" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet""); ("n"); (" xmlns:html="/TR/REC-html40">"); ("n"); (" (" n"); (" n"); int sheetcount = 0; int recordcount = 60000;//每个sheet的数据 int currentRecord = 0; int total = 600000;//总记录 int col = 5;//列数 (" ("n"); (" + "" ss:ExpandedRowCount="" + total + "" x:FullColumns="1" x:FullRows="1">"); ("n"); for (int i = 0; i < total; i++) { if ((currentRecord == recordcount || currentRecord > recordcount || currentRecord == 0) && i != 0) {// 一个sheet写满 currentRecord = 0; (ng().getBytes()); gth(0); ("
");
(" xmlns="urn:schemas-microsoft-com:office:excel">"); ("n"); (" ("n"); (" ("n"); ("
("n");
("");
("
("n");
("
(" xmlns="urn:schemas-microsoft-com:office:excel">"); ("n"); } } (" ("n"); (" ("n"); ("
("n");
("");
("");
("n");
(ng().getBytes());
();
();
} catch (FileNotFoundException e) {
tackTrace();
} catch (IOException e) {
tackTrace();
}
版权声明:本文标题:java导出excelxml 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/b/1713506342a638070.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论