问题描述
能导出excel,但是没有数据,请大神帮我看下,谢谢,感觉应该是这一段Listlist=newArrayList();//System.out.println(list.size());for(inti=3;i<list.size()+3;i++){Datathplyyvchdata=(Datathplyyvch)list.get(i-3);ws.insertRow(i);ws.addCell(newLabel(0,i,data.getVfdept_code()));ws.addCell(newLabel(1,i,data.getVfdept_name()));有问题,但是不知道该怎么处理。请大神点修改意见。dfd.javapackagecom.jagie.test;importjava.io.File;importjava.io.FileOutputStream;importjava.io.OutputStream;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.text.SimpleDateFormat;importjava.util.ArrayList;importjava.util.List;importjxl.Workbook;importjxl.write.Label;importjxl.write.WritableCellFormat;importjxl.write.WritableFont;importjxl.write.WritableSheet;importjxl.write.WritableWorkbook;publicclassdfd{publicConnectiongetConnection(){Connectionconn=null;try{Class.forName("oracle.jdbc.driver.OracleDriver");conn=DriverManager.getConnection("jdbc:oracle:thin:@10.0.3.6:1521:MSQJGL","msqjgl","msqjgl");}catch(Exceptione){System.out.println("数据库链接异常!");e.printStackTrace();}returnconn;}@SuppressWarnings({"unchecked","rawtypes"})publicListgetData(){ResultSetrs=null;Listlist=newArrayList();try{Stringsql="select*fromjl_verifi_dept";Statementst=this.getConnection().createStatement();rs=st.executeQuery(sql);Datathplyyvchdata=null;while(rs.next()){data=newDatathplyyvch();data.setVfdept_code(rs.getString("vfdept_code"));data.setVfdept_name(rs.getString("vfdept_name"));list.add(data);System.out.println(rs.getString("vfdept_NAME"));}}catch(SQLExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}returnlist;}@SuppressWarnings({"unused","rawtypes"})publicstaticvoidwriteExcel(OutputStreamos)throwsException{try{jxl.write.WritableWorkbookwwb=Workbook.createWorkbook(os);jxl.write.WritableSheetws=wwb.createSheet("TestSheet1",0);SimpleDateFormatdateFormat=newSimpleDateFormat("yyyyMMddHHmmss");SimpleDateFormatdate2Format=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");java.util.Datedate=newjava.util.Date();StringdateStr=dateFormat.format(date);WritableFontwf=newWritableFont(WritableFont.TIMES,16,WritableFont.BOLD,false);WritableCellFormatwcf=newWritableCellFormat(wf);//实例化文字格式化wcf.setAlignment(jxl.format.Alignment.CENTRE);//左右居中wcf.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中//打印日期行格式化WritableFontwf2=newWritableFont(WritableFont.TIMES,10,WritableFont.NO_BOLD,false);WritableCellFormatwcf2=newWritableCellFormat(wf2);//实例化文字格式化wcf2.setAlignment(jxl.format.Alignment.LEFT);//左右居中//wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中//列名格式化WritableFontwf3=newWritableFont(WritableFont.TIMES,13,WritableFont.BOLD,false);WritableCellFormatwcf3=newWritableCellFormat(wf3);//实例化文字格式化wcf2.setAlignment(jxl.format.Alignment.CENTRE);//左右居中//wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中ws.insertRow(0);ws.mergeCells(0,0,1,0);//合并单元格ws.addCell(newLabel(0,0,"部门表",wcf));ws.setRowView(0,800);//设置高度ws.insertRow(1);ws.mergeCells(0,1,1,1);ws.addCell(newLabel(0,1,"导出日期:"+date2Format.format(date),wcf2));ws.insertRow(2);ws.addCell(newLabel(0,2,"编码",wcf3));ws.setColumnView(0,10);//设置列宽度ws.addCell(newLabel(1,2,"名称",wcf3));ws.setColumnView(1,20);//设置列宽度Listlist=newArrayList();//System.out.println(list.size());for(inti=3;i<list.size()+3;i++){Datathplyyvchdata=(Datathplyyvch)list.get(i-3);ws.insertRow(i);ws.addCell(newLabel(0,i,data.getVfdept_code()));ws.addCell(newLabel(1,i,data.getVfdept_name()));}//写入Excel工作表wwb.write();//关闭Excel工作薄对象wwb.close();}catch(Exceptione){//TODOAuto-generatedcatchblocke.printStackTrace();//System.out.println(getVfdept_code());}}//最好写一个这样的main方法来测试一下你的这个class是否写好了。publicstaticvoidmain(String[]args)throwsException{Filef=newFile("kk.xls");f.createNewFile();//OutputStreamos=newFileOutputStream(fileWrite);;writeExcel(newFileOutputStream(f));}}
Datathplyyvch.javapackagecom.jagie.test;publicclassDatathplyyvch{privateStringvfdept_code;privateStringvfdept_name;publicStringgetVfdept_code(){returnvfdept_code;}publicvoidsetVfdept_code(Stringvfdept_code){//TODO自动生成方法存根this.vfdept_code=vfdept_code;}publicStringgetVfdept_name(){returnvfdept_name;}publicvoidsetVfdept_name(Stringvfdept_name){//TODO自动生成方法存根this.vfdept_name=vfdept_name;}}
jsp:<%@pageimport="com.jagie.test.dfd"%><%response.reset();response.setContentType("application/vnd.ms-excel");dfd.writeExcel(response.getOutputStream());%>
解决方案
解决方案二:
打断点跟踪看看;看list中有没值。
解决方案三:
建议使用POI,JXL很久没更新了。
解决方案四:
本帖最后由 defonds 于 2014-11-21 12:50:07 编辑
解决方案五:
那这个LIST我杂写呢。就是不知道呀。请教。
解决方案六:
list中的数据你应该从数据库中得到呀!
解决方案七:
导出excel、word了什么的,你用freemarker非常简单,速度快,出错很容易找到,就跟写html样的。
解决方案八:
apachepoi导入导出是不错的,这个好用点吧
解决方案九:
Listlist=newArrayList();改为Listlist=getData();试试
解决方案十:
引用8楼shixitong的回复:
Listlist=newArrayList();改为Listlist=getData();试试
因为publicstaticvoidwriteExcel(OutputStreamos)throwsException是静态的,没法用getData(),我把所有的都改成静态的,也会报别的错
解决方案十一:
不一定要把所有都改为静态的,可以把list作为参数传到writeExcel方法中这样你在main方法中先获得这个list然后把list传到writeExcel中就行了
解决方案十二:
看看例子吧。jxl是java用来操纵excel表格的一个包。里面提供了各种操作excel的类和方法。类似的还有PIO也可以实现这些功能下面是实现读取excel的一个简单示例,里面含有注释。packagecom.foolfish.jxl;importjava.io.File;importjava.io.IOException;importjxl.Workbook;importjxl.write.WritableSheet;importjxl.write.WritableWorkbook;importjxl.write.WriteException;importjxl.write.biff.RowsExceededException;publicclassJxlWrite{publicstaticvoidmain(String[]args){WritableWorkbookworkbook;try{//创建工作簿workbook=Workbook.createWorkbook(newFile("E:/eclipseproject/Jxl/bin/test.xls"));//创建sheetWritableSheetsheet1=workbook.createSheet("测试用excel",0);WritableSheetsheet2=workbook.createSheet("测试excel",1);//开始创建cell//WritableCellcellfor(inti=0;i<10;i++){//向sheet中写入数据sheet1.addCell(newjxl.write.Label(0,i,"书目ID"));}workbook.write();workbook.close();//sheet.addCell(newjxl.write.Label(0,1,"书目ID"));}catch(IOExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}catch(RowsExceededExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}catch(WriteExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}}}
下面是个读取excel的代码packagecom.foolfish.jxl;importjava.io.File;importjava.io.IOException;importjxl.Workbook;importjxl.write.WritableSheet;importjxl.write.WritableWorkbook;importjxl.write.WriteException;importjxl.write.biff.RowsExceededException;publicclassJxlWrite{publicstaticvoidmain(String[]args){WritableWorkbookworkbook;try{//创建工作簿workbook=Workbook.createWorkbook(newFile("E:/eclipseproject/Jxl/bin/test.xls"));//创建sheetWritableSheetsheet1=workbook.createSheet("测试用excel",0);WritableSheetsheet2=workbook.createSheet("测试excel",1);//开始创建cell//WritableCellcellfor(inti=0;i<10;i++){//向sheet中写入数据sheet1.addCell(newjxl.write.Label(0,i,"书目ID"));}workbook.write();workbook.close();//sheet.addCell(newjxl.write.Label(0,1,"书目ID"));}catch(IOExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}catch(RowsExceededExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}catch(WriteExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}}}
解决方案十三:
引用10楼shixitong的回复:
不一定要把所有都改为静态的,可以把list作为参数传到writeExcel方法中这样你在main方法中先获得这个list然后把list传到writeExcel中就行了
list我是在LISTgetData()方法中获得的,我要如何才能把它做为参数传入静态的writeExcel方法中去呢?
解决方案十四:
//在调用这个方法之前先获得list(通过getData方法),然后传到下面的方法里dfddObject=newdfd();Listlist=dObject.getData();Filef=newFile("kk.xls");f.createNewFile();writeExcel(newFileOutputStream(f),list);
publicstaticvoidwriteExcel(OutputStreamos,Listlist)throwsException{try{jxl.write.WritableWorkbookwwb=Workbook.createWorkbook(os);jxl.write.WritableSheetws=wwb.createSheet("TestSheet1",0);SimpleDateFormatdateFormat=newSimpleDateFormat("yyyyMMddHHmmss");SimpleDateFormatdate2Format=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");java.util.Datedate=newjava.util.Date();StringdateStr=dateFormat.format(date);WritableFontwf=newWritableFont(WritableFont.TIMES,16,WritableFont.BOLD,false);WritableCellFormatwcf=newWritableCellFormat(wf);//实例化文字格式化wcf.setAlignment(jxl.format.Alignment.CENTRE);//左右居中wcf.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中//打印日期行格式化WritableFontwf2=newWritableFont(WritableFont.TIMES,10,WritableFont.NO_BOLD,false);WritableCellFormatwcf2=newWritableCellFormat(wf2);//实例化文字格式化wcf2.setAlignment(jxl.format.Alignment.LEFT);//左右居中//wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中//列名格式化WritableFontwf3=newWritableFont(WritableFont.TIMES,13,WritableFont.BOLD,false);WritableCellFormatwcf3=newWritableCellFormat(wf3);//实例化文字格式化wcf2.setAlignment(jxl.format.Alignment.CENTRE);//左右居中//wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中ws.insertRow(0);ws.mergeCells(0,0,1,0);//合并单元格ws.addCell(newLabel(0,0,"部门表",wcf));ws.setRowView(0,800);//设置高度ws.insertRow(1);ws.mergeCells(0,1,1,1);ws.addCell(newLabel(0,1,"导出日期:"+date2Format.format(date),wcf2));ws.insertRow(2);ws.addCell(newLabel(0,2,"编码",wcf3));ws.setColumnView(0,10);//设置列宽度ws.addCell(newLabel(1,2,"名称",wcf3));ws.setColumnView(1,20);//设置列宽度//System.out.println(list.size());for(inti=3;i<list.size()+3;i++){Datathplyyvchdata=(Datathplyyvch)list.get(i-3);ws.insertRow(i);ws.addCell(newLabel(0,i,data.getVfdept_code()));ws.addCell(newLabel(1,i,data.getVfdept_name()));}//写入Excel工作表wwb.write();//关闭Excel工作薄对象wwb.close();}catch(Exceptione){//TODOAuto-generatedcatchblocke.printStackTrace();//System.out.println(getVfdept_code());}}
解决方案十五:
引用13楼shixitong的回复:
//在调用这个方法之前先获得list(通过getData方法),然后传到下面的方法里dfddObject=newdfd();Listlist=dObject.getData();Filef=newFile("kk.xls");f.createNewFile();writeExcel(newFileOutputStream(f),list);publicstaticvoidwriteExcel(OutputStreamos,Listlist)throwsException{try{jxl.write.WritableWorkbookwwb=Workbook.createWorkbook(os);jxl.write.WritableSheetws=wwb.createSheet("TestSheet1",0);SimpleDateFormatdateFormat=newSimpleDateFormat("yyyyMMddHHmmss");SimpleDateFormatdate2Format=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");java.util.Datedate=newjava.util.Date();StringdateStr=dateFormat.format(date);WritableFontwf=newWritableFont(WritableFont.TIMES,16,WritableFont.BOLD,false);WritableCellFormatwcf=newWritableCellFormat(wf);//实例化文字格式化wcf.setAlignment(jxl.format.Alignment.CENTRE);//左右居中wcf.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中//打印日期行格式化WritableFontwf2=newWritableFont(WritableFont.TIMES,10,WritableFont.NO_BOLD,false);WritableCellFormatwcf2=newWritableCellFormat(wf2);//实例化文字格式化wcf2.setAlignment(jxl.format.Alignment.LEFT);//左右居中//wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中//列名格式化WritableFontwf3=newWritableFont(WritableFont.TIMES,13,WritableFont.BOLD,false);WritableCellFormatwcf3=newWritableCellFormat(wf3);//实例化文字格式化wcf2.setAlignment(jxl.format.Alignment.CENTRE);//左右居中//wcf2.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);//上下居中ws.insertRow(0);ws.mergeCells(0,0,1,0);//合并单元格ws.addCell(newLabel(0,0,"部门表",wcf));ws.setRowView(0,800);//设置高度ws.insertRow(1);ws.mergeCells(0,1,1,1);ws.addCell(newLabel(0,1,"导出日期:"+date2Format.format(date),wcf2));ws.insertRow(2);ws.addCell(newLabel(0,2,"编码",wcf3));ws.setColumnView(0,10);//设置列宽度ws.addCell(newLabel(1,2,"名称",wcf3));ws.setColumnView(1,20);//设置列宽度//System.out.println(list.size());for(inti=3;i<list.size()+3;i++){Datathplyyvchdata=(Datathplyyvch)list.get(i-3);ws.insertRow(i);ws.addCell(newLabel(0,i,data.getVfdept_code()));ws.addCell(newLabel(1,i,data.getVfdept_name()));}//写入Excel工作表wwb.write();//关闭Excel工作薄对象wwb.close();}catch(Exceptione){//TODOAuto-generatedcatchblocke.printStackTrace();//System.out.println(getVfdept_code());}}
dfd.writeExcel(response.getOutputStream(),list);我用你的方法,就得在JSP里面加上list,但是就会提示listcannotberesolvedtoavariable,又该怎么解决呢,不好意思,问题可能有点笨,海涵。
解决方案:
引用
dfd.writeExcel(response.getOutputStream(),list);我用你的方法,就得在JSP里面加上list,但是就会提示listcannotberesolvedtoavariable,又该怎么解决呢,不好意思,问题可能有点笨,海涵。
jsp里要导入你相应的java类<%@pageimport="java.util.List"%>
其它没有的类依次也导入下
解决方案:
引用15楼shixitong的回复:
引用
dfd.writeExcel(response.getOutputStream(),list);我用你的方法,就得在JSP里面加上list,但是就会提示listcannotberesolvedtoavariable,又该怎么解决呢,不好意思,问题可能有点笨,海涵。jsp里要导入你相应的java类<%@pageimport="java.util.List"%>
其它没有的类依次也导入下
<%@pageimport="com.jagie.test.dfd"%><%@pageimport="java.util.List"%><%@pageimport="java.text.SimpleDateFormat"%><%@pageimport="java.sql.*"%><%@pageimport="java.io.OutputStream"%><%@pageimport="jxl.*"%><%@pageimport="java.io.File"%><%response.reset();response.setContentType("application/vnd.ms-excel");//dfd.writeExcel(response.getOutputStream(),null);dfd.writeExcel(response.getOutputStream(),list);%>
一样的提示listcannotberesolvedtoavariable
解决方案:
引用
一样的提示listcannotberesolvedtoavariable
这个有语法错误了,这个list从哪边得到的?dfddObject=newdfd();Listlist=dObject.getData();这样才是取list
解决方案:
这个有语法错误了,这个list从哪边得到的?dfddObject=newdfd();Listlist=dObject.getData();这样才是取list
还是不明白,能不能帮我调试成功呀,我有点晕了。
解决方案:
引用已经发私信给你了
解决方案:
用这个吧将数据保存在list集合然后跳到页面输出list集合就会自动导出到excel说明:实现的功能是checkBox选择多个订单对象,然后由word或excel导出Jsp页面<ahref="javascript:exportOrders('excel')">批量导出订单(excel)</a><ahref="javascript:exportOrders('word')">批量导出订单(word)</a>--------------------------------------------------------------Js文件/**批量导出订单*将要导出数据id进行拼接*/functionexportOrders(model){//messageId是checkbox的idvarmessageIds=document.getElementsByName("messageId");varorderIds="";varcheckedCount=0;for(vari=0;i<messageIds.length;i++){if(messageIds[i].checked){checkedCount++;}}if(checkedCount<=0){alert("请至少选择一条数据!");return;}else{for(vari=0;i<messageIds.length;i=i+1){if(messageIds[i].checked){orderIds+=("'"+messageIds[i].value+"';");}}}document.getElementById("orderIds").value=orderIds;document.getElementById("model").value=model;varaction=document.myForm.action;//记录之前的Action,用完之后,恢复原状document.myForm.action="order/exportOrders/";document.myForm.submit();document.myForm.action=action;}--------------------------------------------------------------Struts.xml文件<!--批量导出订单信息(excel/word)--><actionname="exportOrders"method="exportOrders"class="com.cloudsoar3c.action.OrderAction"><resultname="excel">/WEB-INF/order/exportOrdersExcel.jsp</result><resultname="word">/WEB-INF/order/exportOrdersWord.jsp</result><interceptor-refname="securityStack"></interceptor-ref></action>--------------------------------------------------------------Action文件/***批量导出订单信息(excel/word)**@return*/publicStringexportOrders(){StringstringOrderIds=this.request.getParameter("orderIds");Stringmodel=this.request.getParameter("model");StringorderIds=Util.charReplacement(stringOrderIds,";",",");Util.log(orderIds);List<TOrder>orderList=this.orderBiz.getOrderListByIds(orderIds);Util.log("导出的订单集合大小:"+orderList.size());super.request.setAttribute("orderList",orderList);return"excel".equals(model.trim())?"excel":"word";}--------------------------------------------------------------/***拆分字符串(将"A#B#C#D#E#F#"格式的字符串转换为"A,B,C,D,E,F"),并输出*/publicstaticStringcharReplacement(StringsourceStr,StringsourceChar,StringtargetChar){Stringresult="";//将需要处理的字符串中含有的sourceChar,全部替换为targetCharStringtemp=sourceStr.replaceAll(sourceChar,targetChar);//截取字符串中最后一个字符;intlen=temp.length();result=temp.substring(0,len-1);returnresult;}-------------------------------------------------------------------
解决方案:
导出Excel的返回页面exportOrdersExcel.jsp<%@pagelanguage="java"import="java.util.*"pageEncoding="utf-8"%><%@pagecontentType="text/html;charset=GBK"%><%@tagliburi="/struts-tags"prefix="s"%><%@pageimport="java.util.*"%><%@pageimport="java.text.SimpleDateFormat"%><%response.setContentType("application/vnd.ms-excel;charset=GBK");%><HTML><metahttp-equiv="Content-Type"content="text/html;charset=GBK"><head><title>Test</title></head><body><%request.setCharacterEncoding("GBK");SimpleDateFormatsf=newSimpleDateFormat("yyyy-MM-dd_HH_mm_ss");response.setHeader("Content-Disposition","attachment;filename=order_"+sf.format(newDate())+".xls");%><center>订单列表</center><tableborder="1"align="center"width="60%"><tralign="center"><td>序号</td><td>订单号</td><td>单价(元)</td><td>数量</td><td>总金额(元)</td><td>优惠价格(元)</td><td>实际需付金额(元)</td><td>下单时间</td><td>订单完成时间</td><td>客户账号</td><td>主机名称</td><td>订单状态</td></tr><s:iteratorvalue="#request.orderList"var="order"status="st"><tralign="center"><tdstyle="mso-number-format:'@';">${st.count}</td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.orderId"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.price"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.buyCount"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="%{@com.cloudsoar3c.tools.Util@getTotalPriceByOrder(#order.totalPrice)}"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.preferentialPrice"/></td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="%{@com.cloudsoar3c.tools.Util@getActualPayByOrder(#order.totalPrice,#order.preferentialPrice)}"/> </td><tdstyle="mso-number-format:'@';"> <s:datename="#order.orderTime"format="yyyy-MM-ddHH:mm:dd"/> </td><tdstyle="mso-number-format:'@';"> <s:datename="#order.completeTime"format="yyyy-MM-ddHH:mm:dd"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.TClient.email"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.TServerHostLicense.hostName"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="%{#order.TStatusTypeContent.statusTypeContent}"/> </td></tr></s:iterator></table></body></HTML>-------------------------------------------------------------------导出word的返回页面exportOrdersWord.jsp<%@pagelanguage="java"import="java.util.*"pageEncoding="utf-8"%><%@pagecontentType="text/html;charset=GBK"%><%@tagliburi="/struts-tags"prefix="s"%><%@pageimport="java.util.*"%><%@pageimport="java.text.SimpleDateFormat"%><%response.setContentType("application/vnd.ms-word;charset=GBK");%><HTML><metahttp-equiv="Content-Type"content="text/html;charset=GBK"><head><title>Test</title></head><body><%request.setCharacterEncoding("GBK");SimpleDateFormatsf=newSimpleDateFormat("yyyy-MM-dd_HH_mm_ss");response.setHeader("Content-Disposition","attachment;filename=order_"+sf.format(newDate())+".doc");%><center>订单列表</center><tableborder="1"align="center"width="2000px"><tralign="center"><td>序号</td><td>订单号</td><td>单价(元)</td><td>数量</td><td>总金额(元)</td><td>优惠价格(元)</td><td>实际需付金额(元)</td><td>下单时间</td><td>订单完成时间</td><td>客户账号</td><td>主机名称</td><td>订单状态</td></tr><s:iteratorvalue="#request.orderList"var="order"status="st"><tralign="center"><tdstyle="mso-number-format:'@';">${st.count}</td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.orderId"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.price"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.buyCount"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="%{@com.cloudsoar3c.tools.Util@getTotalPriceByOrder(#order.totalPrice)}"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.preferentialPrice"/></td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="%{@com.cloudsoar3c.tools.Util@getActualPayByOrder(#order.totalPrice,#order.preferentialPrice)}"/> </td><tdstyle="mso-number-format:'@';"> <s:datename="#order.orderTime"format="yyyy-MM-ddHH:mm:dd"/> </td><tdstyle="mso-number-format:'@';"> <s:datename="#order.completeTime"format="yyyy-MM-ddHH:mm:dd"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.TClient.email"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="#order.TServerHostLicense.hostName"/> </td><tdstyle="mso-number-format:'@';"> <s:propertyvalue="%{#order.TStatusTypeContent.statusTypeContent}"/> </td></tr></s:iterator></table></body></HTML>
解决方案:
debug模式断点跟踪,观察数据的传递情况这种错误往往是不细心导致的