乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>java</em> 怎样解析 <em>excel</em>生成的

<em>java</em> 怎样解析 <em>excel</em>生成的

作者:乔山办公网日期:

返回目录:excel表格制作


1.用Excel 2003打开xml文档,点“确定”。
2..Excel菜单数据”--“列表”--“转换为区域”,点“确定”。
3.Excel菜单“文件”--“另存为...”--存储为XLS格式就可以了。

java解析excel生成的xml文件的方法是使用dom4j实现的。
dom4j是一个简单的开源库,用于处理XML、 XPath和XSLT,它基于Java平台,使用Java的集合框架,全面集成了DOM,SAX和JAXP。
1、excel生成的xml样例文件:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http:///TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Created>2006-09-16T00:00:00Z</Created>
<LastSaved>2016-07-25T03:26:50Z</LastSaved>
<Version>14.00</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<AllowPNG/>
<RemovePersonalInformation/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>7956</WindowHeight>
<WindowWidth>14808</WindowWidth>
<WindowTopX>240</WindowTopX>
<WindowTopY>168</WindowTopY>
<ActiveSheet>2</ActiveSheet>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font ss:FontName="宋体" x:CharSet="134" ss:Size="11" ss:Color="#000000"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s16" ss:Name="好">
<Font ss:FontName="宋体" x:CharSet="134" ss:Size="11" ss:Color="#006100"/>
<Interior ss:Color="#C6EFCE" ss:Pattern="Solid"/>
</Style>
<Style ss:ID="s17">
<Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:Indent="1"
ss:WrapText="1"/>
<Font ss:FontName="宋体" x:CharSet="134" ss:Size="8" ss:Color="#686868"/>
<NumberFormat ss:Format="@"/>
</Style>
<Style ss:ID="s18" ss:Parent="s16">
<Alignment ss:Vertical="Bottom"/>
</Style>
<Style ss:ID="s19">
<NumberFormat ss:Format="yyyy/m/d\ h:mm:ss"/>
</Style>
</Styles>
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedColumnCount="6" ss:ExpandedRowCount="3" x:FullColumns="1"
x:FullRows="1" ss:DefaultRowHeight="14.4">
<Row>
<Cell><Data ss:Type="String">工号</Data></Cell>
<Cell><Data ss:Type="String">姓名 </Data></Cell>
<Cell ss:Index="5"><Data ss:Type="String">工号</Data></Cell>
<Cell><Data ss:Type="String">姓名</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="Number">111</Data></Cell>
<Cell><Data ss:Type="String">张三</Data></Cell>
<Cell ss:Index="5"><Data ss:Type="Number">111</Data></Cell>
<Cell ss:Formula="=VLOOKUP(R2C5:R3C5,RC[-5]:R[1]C[-4],2)"><Data
ss:Type="String">张三</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="Number">112</Data></Cell>
<Cell><Data ss:Type="String">李四</Data></Cell>
<Cell ss:Index="5"><Data ss:Type="Number">112</Data></Cell>
<Cell ss:Formula="=VLOOKUP(R2C5:R3C5,RC[-5]:R[1]C[-4],2)"><Data
ss:Type="String">李四</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Header x:Margin="0.3"/>
<Footer x:Margin="0.3"/>
<PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
</PageSetup>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>7</ActiveRow>
<ActiveCol>5</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
2、java解析代码:
import java.io.File;
import java.util.Iterator;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class Demo {
public static void main(String[] args) throws Exception {
SAXReader reader = new SAXReader();
Document document = reader.read(new File("person.xml"));
Element root = document.getRootElement();

Iterator it = root.elementIterator();
while (it.hasNext()) {
Element element = (Element) it.next();

//未知属性名称情况下7a686964616fe78988e69d83336
/*Iterator attrIt = element.attributeIterator();
while (attrIt.hasNext()) {
Attribute a = (Attribute) attrIt.next();
System.out.println(a.getValue());
}*/

//已知属性名称情况下
System.out.println("id: " + element.attributeValue("id"));

//未知元素名情况下
/*Iterator eleIt = element.elementIterator();
while (eleIt.hasNext()) {
Element e = (Element) eleIt.next();
System.out.println(e.getName() + ": " + e.getText());
}
System.out.println();*/

//已知元素名情况下
System.out.println("title: " + element.elementText("title"));
System.out.println("author: " + element.elementText("author"));
System.out.println();
}
}
}
package com.asima;

import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

/**
*
* @author asima
* @data 2006-10-18
*/
public class XlsToAccess
{
HSSFSheet globalSheet = null;

/*读取一个指定单元格内容*/
public String readCellValue(String pos)
{
int xpos;
short ypos;
int cellType; /*取得此单元格的类型 0-Numeric,1-String,3-null*/
String result; /*返回取得的单元格的值*/

ypos = (short) (pos.toUpperCase().charAt(0) - 65);
xpos = Integer.parseInt(pos.substring(1, pos.length())) - 1;

HSSFRow row = null; /* 定义excel中的行 */
HSSFCell cell = null; /* 定义excel中的单元格 */

/* 根据xPos和yPos取得单元格 */
row = globalSheet.getRow(xpos);
cell = row.getCell(ypos);
/** **************此处如果是空需要修改********************************** */

cellType = cell.getCellType();
switch (cellType)
{
case 0: /* 0-Numeric */
result = String.valueOf(cell.getNumericCellValue());
break;
case 1: /* 1-String */
result = cell.getStringCellValue();
break;
case 3: /* 3-null */
result = "";
break;
default:
result = "";
break;
}

return result;
}

/*读取excel文件并把内容插入到access表中*/
public void insertIntoTable() throws Exception
{
// 创建对Excel工作簿文件的引用
HSSFWorkbook workbook =
new HSSFWorkbook(new FileInputStream("D:/temp/test.xls"));
// 获得一个sheet
globalSheet = workbook.getSheetAt(0);

String value1 = readCellValue("c1");
String value2 = readCellValue("c2");
String value3 = readCellValue("c3");
String value4 = readCellValue("c4");

System.out.println(value1);
System.out.println(value2);

/* 插入数据库 */
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:asima";

Connection conn = DriverManager.getConnection(url);
PreparedStatement stmt =
conn.prepareStatement("insert into custom values(?,?,?,?)");
// 定义查询的SQL语句
stmt.setString(1, value1);
stmt.setString(2, value2);
stmt.setString(3, value3);
stmt.setString(4, value4);
stmt.executeUpdate();

stmt.close(); // 关闭statement
conn.close(); // 关闭连接
}
}

8. 编写代码AccessToXml.java

package com.asima;

import java.io.FileOutputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;

/**
*
* @author asima
* @data 2006-10-18
*/
public class AccessToXml
{
public void buildXML() throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:asima";

// Connection conn = DriverManager.getConnection(url,"","");
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();

// 创建一个statement
String sql = "select * from custom"; // 定义查询的SQL语句
ResultSet rs = stmt.executeQuery(sql); // 执行查询
// 创建文档
Document document = new Document(new Element("联系人列表"));
ResultSetMetaData rsmd = rs.getMetaData(); // 获取字段名
int numberOfColumns = rsmd.getColumnCount(); // 获取字段数
int i = 0;

while (rs.next())
{ // 将查询结果取出
Element element0 = new Element("联系人");
//创建元素 生成JDOM树
document.getRootElement().addContent(element0);
for (i = 1; i <= numberOfColumns; i++)
{
//xml编码转换
String date = rs.getString(i);
Element element =
new Element(rsmd.getColumnName(i)).setText(date);
element0.addContent(element);
}
}
rs.close(); // 关闭结果集
stmt.close(); // 关闭statement
conn.close(); // 关闭连接
XMLOutputter outp = new XMLOutputter();
Format fm = org.jdom.output.Format.getPrettyFormat();
fm.setEncoding("GB2312");
outp.setFormat(fm);

// 输出XML文档
outp.output(document, new FileOutputStream("d:/temp/test2.xml"));
System.out.print("XML 文档生成完毕!");
}
}

9. 编写代码XlsToXml.java

package com.asima;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

/**
*
* @author asima
* @data 2006-10-18
*/
public class XlsToXml
{
/**
* Launch the application
* @param args
*/
public static void main(String[] args)
{
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("excel文件转化成xml文件");
shell.open();

final Label label = new Label(shell, SWT.NONE);
label.setText("参数内容");
label.setBounds(15, 25, 67, 16);

final Text text = new Text(shell, SWT.BORDER);
text.setBounds(88, 22, 175, 20);

final Button button = new Button(shell, SWT.NONE);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e)
{
XlsToAccess aa = new XlsToAccess();
try
{
aa.insertIntoTable();
}
catch(Exception ex)
{
System.out.println(ex);
}
MessageDialog.openInformation(null,"","导入Access数据库成功!e79fa5e98193e59b9ee7ad94330");
}
});
button.setText("Excel到access");
button.setBounds(50, 105, 125, 55);

final Button button_1 = new Button(shell, SWT.NONE);
button_1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e)
{
AccessToXml bb = new AccessToXml();
try
{
bb.buildXML();
}
catch(Exception ex)
{
System.out.println(ex);
}
MessageDialog.openInformation(null,"","生成XML文件成功!");
}
});
button_1.setText("从access到xml");
button_1.setBounds(195, 110, 140, 50);
shell.layout();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
}
}

import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.jws.WebParam;

import jetsennet.common.PathUtil;
import jetsennet.contentmanage.CmDataAccess;
import jetsennet.contentmanage.CmObjHelper;
import jetsennet.net.UserAuthHeader;
import jetsennet.net.WSResult;
import jetsennet.sqlclient.ConnectionInfo;
import jetsennet.sqlclient.DbConfig;
import jetsennet.sqlclient.ISqlExecutor;
import jetsennet.sqlclient.QueryTable;
import jetsennet.sqlclient.SqlClientObjFactory;
import jetsennet.sqlclient.SqlCondition;
import jetsennet.sqlclient.SqlLogicType;
import jetsennet.sqlclient.SqlParamType;
import jetsennet.sqlclient.SqlQuery;
import jetsennet.sqlclient.SqlRelationType;
import jetsennet.sqlclient.TableJoinType;
import jetsennet.util.StringUtil;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

public class xmlToExcel
{

private static jetsennet.logger.ILog logger =
jetsennet.logger.LogManager.getLogger("JetsenNet.JCMP");
private static String XSD_FILE_PATH = "jcmp/schemafiles";
private static ConnectionInfo cmpConnectionString = new
ConnectionInfo(DbConfig.getProperty("cmp_driver"),
DbConfig.getProperty("cmp_dburl"),
DbConfig.getProperty("cmp_dbuser"),
DbConfig.getProperty("cmp_dbpwd"));
static jxl.write.WritableFont titleFont = new
jxl.write.WritableFont(WritableFont.createFont(" 宋 体 "), 10,
WritableFont.BOLD, false);
static WritableCellFormat titleFormat = new
jxl.write.WritableCellFormat(titleFont);

private static ConnectionInfo mccConnectionString = new
ConnectionInfo(DbConfig.getProperty("mcc_driver"),
DbConfig.getProperty("mcc_dburl"),
DbConfig.getProperty("mcc_dbuser"),
DbConfig.getProperty("mcc_dbpwd"));
private static ISqlExecutor sqlExecutor =
SqlClientObjFactory.createSqlExecutor(mccConnectionString);
static int celltitlenow = 0;// 当前列表头列号
static int cellvaluenow = 0;// 当前内容列号
static int rowtitlenow = 0;// 当前列表头行号
static boolean addcelltitle = true;
static String OldObjtype = "";

public static void main(String[] args)
{
File file = new File("C:/temp/test.xls");
WritableWorkbook workbook;
try
{
workbook = Workbook.createWorkbook(file);

//processActivity(workbook, "4023,4025,4007,4024,4026",
"200101,200103,200101,200102,200104");
processActivity(workbook, "4023,4025,4007",
"200101,200101,200101");
workbook.write();
workbook.close();
}
catch (Exception e)
{

// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("OK?");
}

public static void processActivity(WritableWorkbook workBook, String
obj_id, String obj_subtype) throws Exception
{
OldObjtype = "";
celltitlenow = 0;
addcelltitle = true;
rowtitlenow =0;
WritableSheet sheet = workBook.createSheet("sheet1", 0);
/****/
/** 导出ID **/
String[] ids = obj_id.split(",");
/** 导出类型 **/
String[] idt = obj_subtype.split(",");
/** 导出个数 **/
int idsl = ids.length;
/** 定义列宽 **/
int cellwihth = 20;
xExcelType xt = new xExcelType();
xt.exShowType = 1;
if (xt.exShowType == 1)
{
addcelltitle = true;
}
else
{
addcelltitle = false;
}
// ******************主表/结构定义
// 200101
xmlStruct mainXmlStruct1 = new xmlStruct();
mainXmlStruct1.tableName = "CM10_OBJECT";
mainXmlStruct1.tableCName = "活动信息";
mainXmlStruct1.tableCalssField = "OBJ_SUBTYPE";
mainXmlStruct1.tableCalssCName.put("200101", "院团大事");
mainXmlStruct1.tableCalssCName.put("200102", "院团出访");
mainXmlStruct1.tableCalssCName.put("200103", "院团专家交流");
HashMap test1 = new HashMap ();
test1.put("0", "新建");

test1.put("100", "完成");
mainXmlStruct1.tableFilesClassValue.put("OBJ_STATE", test1);
mainXmlStruct1.tableFiles = new String[][] { { "OBJ_NAME", "活
动名称" }, { "FIELD_1", "活动内容简介" }, { "FIELD_2", "活动开始时间" },
{ "FIELD_3", "活动结束时间" } };
xt.alltables.put("200101", mainXmlStruct1);
xt.alltables.put("200102", mainXmlStruct1);
xt.alltables.put("200103", mainXmlStruct1);
// 200104
xmlStruct mainXmlStruct2 = new xmlStruct();
mainXmlStruct2.tableName = "CM10_OBJECT";
mainXmlStruct2.tableCName = "活动信息";
mainXmlStruct2.tableCalssField = "OBJ_SUBTYPE";
mainXmlStruct2.tableCalssCName.put("200104", "院团演出");
mainXmlStruct2.tableFiles = new String[][] { { "OBJ_NAME", "活
动名称" }, { "FIELD_2", "活动开始时间" }, { "FIELD_3", "活动结束时间" } };
xt.alltables.put("200104", mainXmlStruct2);
// 20010401
xmlStruct mainXmlStruct3 = new xmlStruct();
mainXmlStruct3.tableName = "CM10_OBJECT";
mainXmlStruct3.tableCalssField = "OBJ_SUBTYPE";
mainXmlStruct3.tableCalssCName.put("20010401", "演出日志");
// HashMap showType_hm =
getHMctroWord("20010401");
// mainXmlStruct1.tableFilesClassValue.put("FIELD_3",
showType_hm);
mainXmlStruct3.tableFiles = new String[][] { { "FIELD_1", "演出
时间" }, { "FIELD_2", "演出场次" }, { "FIELD_3", "演出类型" }, { "NUM_VAL2",
"观众人数" } };
xt.alltables.put("20010401", mainXmlStruct3);
// ********************从表/结构定义
//
xmlStruct son1Struct1 = new xmlStruct();
son1Struct1.tableName = "CM10_MULTIINFO";
son1Struct1.tableCName = "动信息";
son1Struct1.tableCalssField = "INFO_TYPE";
son1Struct1.tableCalssFieldValue = "1";
// HashMap test2 = new HashMap ();
// test2.put("1", "新建1");
// test2.put("2", "完成2");
// test2.put("3", "完成3");
// xs2.tableFilesClassValue.put("INFO_TYPE", test2);
son1Struct1.tableFiles = new String[][] { { "FIELD_1", "活动地点
" } };

xt.alltables.put("200101-1", son1Struct1);
xt.alltables.put("200102-1", son1Struct1);
xt.alltables.put("200103-1", son1Struct1);
//
xmlStruct son1Struct2 = new xmlStruct();
son1Struct2.tableName = "CM10_MULTIINFO";
son1Struct2.tableCName = "人员信息";
son1Struct2.tableCalssField = "INFO_TYPE";
son1Struct2.tableCalssFieldValue = "2";
son1Struct2.tableFiles = new String[][] { { "FIELD_1", "参与人员
" } };
xt.alltables.put("200101-2", son1Struct2);
xt.alltables.put("200102-2", son1Struct2);
xt.alltables.put("200103-2", son1Struct2);
//
xmlStruct son1Struct3 = new xmlStruct();
son1Struct3.tableName = "CM10_MULTIINFO";
son1Struct3.tableCName = "剧目信息";
son1Struct3.tableCalssField = "INFO_TYPE";
son1Struct3.tableCalssFieldValue = "3";
son1Struct3.tableFiles = new String[][] { { "FIELD_1", "剧目名称
" } };
xt.alltables.put("200101-3", son1Struct3);
xt.alltables.put("200102-3", son1Struct3);
xt.alltables.put("200103-3", son1Struct3);

xmlStruct son2Struct1 = new xmlStruct();
son2Struct1.tableName = "CM10_MULTIINFO";
son2Struct1.tableCalssField = "INFO_TYPE";
son2Struct1.tableCalssFieldValue = "1";
son2Struct1.tableFiles = new String[][] { { "FIELD_1", "节目单" } };
xt.alltables.put("200104-1", son2Struct1);
xmlStruct son2Struct2 = new xmlStruct();
son2Struct2.tableName = "CM10_MULTIINFO";
son2Struct2.tableCalssField = "INFO_TYPE";
son2Struct2.tableCalssFieldValue = "2";
son2Struct2.tableFiles = new String[][] { { "FIELD_1", "剪报" } };
xt.alltables.put("200104-2", son2Struct2);
xmlStruct son2Struct3 = new xmlStruct();
son2Struct3.tableName = "CM10_MULTIINFO";
son2Struct3.tableCalssField = "INFO_TYPE";
son2Struct3.tableCalssFieldValue = "3";
son2Struct3.tableFiles = new String[][] { { "FIELD_1", "海报" } };
xt.alltables.put("200104-3", son2Struct3);

// 演出的日志多关联
xmlStruct son3Struct1 = new xmlStruct();
son3Struct1.tableName = "CM10_MULTIINFO";
son3Struct1.tableCalssField = "INFO_TYPE";
son3Struct1.tableCalssFieldValue = "1";
son3Struct1.tableFiles = new String[][] { { "FIELD_1", "演出单位
" } };
xt.alltables.put("20010401-1", son3Struct1);
xmlStruct son3Struct2 = new xmlStruct();
son3Struct2.tableName = "CM10_MULTIINFO";
son3Struct2.tableCalssField = "INFO_TYPE";
son3Struct2.tableCalssFieldValue = "2";
son3Struct2.tableFiles = new String[][] { { "FIELD_1", "演剧目名
称" } };
xt.alltables.put("20010401-2", son3Struct2);
xmlStruct son3Struct3 = new xmlStruct();
son3Struct3.tableName = "CM10_MULTIINFO";
son3Struct3.tableCalssField = "INFO_TYPE";
son3Struct3.tableCalssFieldValue = "3";
son3Struct3.tableFiles = new String[][] { { "FIELD_1", "演出地点
" } };
xt.alltables.put("20010401-3", son3Struct3);
xmlStruct son3Struct4 = new xmlStruct();
son3Struct4.tableName = "CM10_MULTIINFO";
son3Struct4.tableCalssField = "INFO_TYPE";
son3Struct4.tableCalssFieldValue = "4";
// son3Struct4.tableFilesClassValue.put("FIELD_2",
getHMctroWord("200104011"));
son3Struct4.tableFiles = new String[][] { { "FIELD_1", "参演人员
" }, { "FIELD_2", "责任方式" } };
xt.alltables.put("20010401-4", son3Struct4);
// //////////////下面是统一生成处理
int rowid = 0;
int cellid = 0;

for (int idi = 0; idi < idsl; idi++)
{

rowid = createcell(rowid, ids[idi], idt[idi], xt, sheet);
// 额外加e68a84e799bee5baa6e997aee7ad94333入xml 结构
String objtype = idt[idi];
HashMap sonMainIdTypes = null;
if (objtype.equals("200101") || objtype.equals("200102") ||

objtype.equals("200103"))// 院团活动 常用
{

}
else if (objtype.equals("200104"))// 院团活动 演出
{
sonMainIdTypes = getMainSonIDAndType(ids[idi],
"20010401");
}
else if (objtype.equals("300201"))// 比赛声乐
{

}
else if (objtype.equals("400101") || objtype.equals("400201")
|| objtype.equals("400301") || objtype.equals("400401")
|| objtype.equals("400501"))// 通用比赛
{

}
else if (objtype.equals("500301"))// 优秀剧目展演
{

}
else if (objtype.equals("500101") ||
objtype.equals("500201"))
{

}
if (sonMainIdTypes != null)
{
Iterator iter = sonMainIdTypes.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
Object key = entry.getKey();
Object val = entry.getValue();
rowid = createcell(rowid, key.toString(),
val.toString(), xt, sheet);
}
}

}

}

相关阅读

  • <em>java</em> 怎样解析 <em>excel</em>生成的

  • 乔山办公网excel表格制作
  • 1.用Excel 2003打开xml文档,点“确定”。2..Excel菜单抄“袭数据”知--“列表”--“转换为区域”,点“确定”。3.Excel菜单“文件”--“另存为...”--存储为道XLS格式就可以了。java将xml转为
  • <em>java</em>将<em>xml</em>转为xls文件-ja

  • 乔山办公网excel表格制作
  • java解析excel生成的xml文件的方法是使用dom4j实现的。dom4j是一个简单的开源库,用于处理XML、 XPath和XSLT,它基于Java平台,使用Java的集合框架,全面集成了DOM,SAX和JAXP。1、excel生成的xm
关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网