|
使用java操作Excel文件(8) } System.out.println(" "); } } //----------------------------------------------------------- public void outputXlsContent(String[][] xls) { String[][] content = xls; JFileChooser chooser = new JFileChooser(); int result = chooser.showSaveDialog(chooser); File testfile1 = chooser.getSelectedFile(); if (result == chooser.CANCEL_OPTION) { System.exit(0); } try { DataOutputStream out = new DataOutputStream(new FileOutputStream( testfile1)); String fileName = testfile.getName(); String sql1 = fileName + "\n <table border=\"1\"> "; for (int i = 0; i < content.length; i++) { sql1 = sql1 + " <tr> "; for (int j = 0; j < content[i].length; j++)
|