網頁

2011年2月17日 星期四

WinServer2008 & IIS & Excel - 無法存取檔案

Last Update: 2011/02/17 17:55+08



Context


完全是 Windwos Server 2008的錯!!!

如果你按照這篇設定完後仍然不能使用 Excel

又是使用 Server 2008, 那請在web.config 加入
<configuration>
<system.web>
<identity impersonate="true" userName="adminUser" password="adminUserPassword" />



OK, 還是不能使用
訊息:Microsoft Office Excel 無法存取檔案


若是 Server 2008 x64 請建立下述資料夾
C:\Windows\SysWOW64\config\systemprofile\Desktop

若是 Server 2008 x86 請建立下述資料夾
C:\Windows\System32\config\systemprofile\Desktop

這樣就可以了!!搞啥呀XD
感想: 軟體工程師 = 會一點程式 + 一點邏輯 + 在Google打關鍵字!




參考


原討論文

2011年2月6日 星期日

Excel 操作

Last Update: 2011/03/13 02:50+08


Intro


關於 Excel API 操作

◆ 如果單只是要匯出Excel表, 只要把副檔名設成xls
html(UI)就放個Table就好
反正Excel可以幫你轉換
Response.AddHeader("content-disposition", "attachment;filename=MyExcel.xls");


◆ 如果是要匯入資料的話, 用OleDb就可以了

◆ 如果有些格式, 公式 等等要求的話
還是得乖乖的用 Excel 的 API
下面就來講這塊