zoukankan      html  css  js  c++  java
  • 导出Excel 报错

    System.InvalidOperationException: Error saving file D:SCAS-SERVERUploadICON2014-02-1020140210153403343.xlsx ---> System.IO.IsolatedStorage.IsolatedStorageException: Unable to create the store directory. (Exception from HRESULT: 0x80131468)
       at System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope scope, StringHandleOnStack retRootDir)
       at System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsNonRoamingUser(IsolatedStorageScope scope)
       at System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope scope)
       at System.IO.IsolatedStorage.IsolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope scope)
       at System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope scope)
       at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
       at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.GetCurrentStore()
       at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder..ctor()
       at MS.Internal.IO.Packaging.PackagingUtilities.GetDefaultIsolatedStorageFile()
       at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName)
       at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()
       at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at MS.Internal.IO.Packaging.CompressEmulationStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
       at System.IO.StreamWriter.Write(String value)
       at System.IO.TextWriter.Write(String format, Object arg0, Object arg1)
       at OfficeOpenXml.ExcelWorksheet.UpdateRowCellData(StreamWriter sw)
       at OfficeOpenXml.ExcelWorksheet.SaveXml()
       at OfficeOpenXml.ExcelWorksheet.Save()
       at OfficeOpenXml.ExcelWorkbook.Save()
       at OfficeOpenXml.ExcelPackage.Save()
       --- End of inner exception stack trace ---
       at OfficeOpenXml.ExcelPackage.Save()
       at FrogSCAS.Service.Util.CUtil.GenerateExcel(DataTable dataToExcel, String excelSheetName, String fileNameWithPath, String& errMsg)

    解决方案:

    Solved by creating directory: C:Documents and Settings<Default User>Local SettingsApplication DataIsolatedStorage

    如果还是无法导出则将IsolatedStorage文件夹设置为Everyone full control.

  • 相关阅读:
    GCD
    vue中前进刷新、后退缓存方案收集
    vue cli3 项目配置
    CSS 多行省略失效 (-webkit-box-orient 失效) Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules.
    vue 设置当前页背景色
    vue history模式下的微信支付,及微信支付授权目录的填写,处理URL未注册
    h5 audio播放问题,audio获取缓存进度条
    h5页面ios键盘弹出收起后页面底部留白问题
    vue项目中引入vant 使用rem布局问题
    vue history模式下的微信分享
  • 原文地址:https://www.cnblogs.com/chenjm/p/3557812.html
Copyright © 2011-2022 走看看