2014-03-31 25 views
0

我似乎无法做ColdFusion的任何格式,试图做任何事情都意味着它抛出这个错误ColdFusion的Excel的格式错误

NoSuchMethodError : org.apache.poi.ss.usermodel.Font.getCharSet()B 

这是代码的问题区域,问题是在最后几行,其他一切正常。

<cfscript> 
      sheet = SpreadsheetNew("JEreport", "yes"); 
      SpreadsheetSetCellValue(sheet,"JE Report - Charge for Moves",1,1); 
      SpreadsheetSetCellValue(sheet,"JE Report Charge for Moves for the Period From: " & toString(local.formatStartDate) & " To: " & toString(local.formatEndDate),3,1); 
      SpreadsheetSetCellValue(sheet,"Report Date: " & toString(local.formatNow),4,1); 
      SpreadsheetSetCellValue(sheet,"Created by: " & local.employee.empl_firstname & " " & local.employee.empl_lastname & " (" & session.user.getAlias() & ")",5,1); 
      SpreadsheetAddRow(sheet,"Move ID,Move Type,Number of Movees (people),Number of Movees (items),Movees (people),Move Requested Date,Move Completed Date,Funding Category,Funding Type,Funding Source",7,1); 

      for(i = 1; i <= local.numOfProjects; i++){ 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].projectId,i+8,1); 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].move_type,i+8,2); 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].num_movers,i+8,3); 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].num_items,i+8,4); 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].movers,i+8,5); 
       SpreadsheetSetCellValue(sheet,"Not Currently Available",i+8,6); 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].move_start_date,i+8,7); 
       if(local.arrayProjects[i].move_type == "group"){ 
        SpreadsheetSetCellValue(sheet,local.arrayProjects[i].move_funding_cat,i+8,8); 
       }else{ 
        SpreadsheetSetCellValue(sheet,"N/A",i+8,8); 
       } 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].move_funding_type,i+8,9); 
       SpreadsheetSetCellValue(sheet,local.arrayProjects[i].move_funding_source,i+8,10); 
      } 
      format1=structnew(); 
      format1.bold="true"; 
      theFile=GetDirectoryFromPath(arguments.tempDir) & "jeTemp.xlsx"; 
      format1.alignment="center"; 
      SpreadsheetFormatColumn(sheet,format1,5); 
     </cfscript> 

我不知道该怎么办。我显然想念什么,但是什么?我正在使用Coldfusion 10,所以我不需要做一些电子表格格式化吗?

+0

你可以发布所有的代码,以便我们可以看到一切吗? – fyroc

+0

它没有成功运行,“SpreadsheetFormatColumn(sheet,format1,5);”? –

+0

您在ColdFusion中安装了哪些POI罐?你也许有一个不匹配的集? – Gagravarr

回答

0

根据文档,SpreadsheetFormatColumn需要4个参数(spreadsheetObj,格式,行,列)。我只是在我的开发箱上试过它,并用3个参数抛出错误。尝试提供行以及col参数,它应该工作。

+0

电子表格格式列需要3个参数。为什么格式化列的函数需要一个行号作为参数? http://help.adobe.com/zh_CN/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-6806.html – lorless

+0

对不起,我把它与SpreadsheetFormatCell混合在一起。 SpreadsheetFormatColumn适用于我。看看你的错误,有可能是format1.bold =“true”;可能会导致POI jar问题? –