Git Product home page Git Product logo

tableml's Issues

我在ks里导表的时候碰到的一个读取问题

Exception: 无法打开Excel: Product/SettingSource\Billboard.xlsx, 可能原因:正在打开?或是Office2007格式(尝试另存为)? Specified argument was out of the range of valid values.
Parameter name: length
TableML.Compiler.SimpleExcelFile.ParseExcel (System.String filePath) (at e:/Workspace/TableML/TableML/TableMLCompiler/SimpleExcelFile.cs:137)
TableML.Compiler.SimpleExcelFile..ctor (System.String excelPath) (at e:/Workspace/TableML/TableML/TableMLCompiler/SimpleExcelFile.cs:120)
TableML.Compiler.Compiler.Compile (System.String path, System.String compileToFilePath, System.String compileBaseDir, System.Boolean doRealCompile) (at e:/Workspace/TableML/TableML/TableMLCompiler/Compiler.cs:317)
TableML.Compiler.BatchCompiler.CompileTableMLAll (System.String sourcePath, System.String compilePath, System.String genCodeFilePath, System.String genCodeTemplateString, System.String nameSpace, System.String changeExtension, System.String settingCodeIgnorePattern, System.Boolean forceAll) (at e:/Workspace/TableML/TableML/TableMLCompiler/BatchCompiler.cs:177)
KEngine.Editor.SettingModuleEditor.DoCompileSettings (System.Boolean force, System.String forceTemplate, System.Boolean canCustom) (at Assets/KSFramework/KEngine/Editor/KEngine.Editor/SettingModuleEditor.cs:190)
KEngine.Editor.SettingModuleEditor.CompileSettings () (at Assets/KSFramework/KEngine/Editor/KEngine.Editor/SettingModuleEditor.cs:148)

这是因为Office版本的原因么?

是否不支持xlsx(office2007)格式?

在WIN10/7 编译xlsx时,出现下面的提示。
提示信息:

D:\Git\TableML\TableML\TableMLCompilerConsole\bin\Debug>TableML.exe -f TestExcel2.xlsx
Filename: TestExcel2.xlsx

未经处理的异常:  System.Exception: 无法打开Excel: TestExcel2.xlsx, 可能原因:正在打开?或是Office2007格式(尝试另存为)? 未能加载文件或程序集ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73或它的某一个依赖项。系统找不到指定的文件。
   在 TableML.Compiler.SimpleExcelFile.ParseExcel(String filePath) 位置 d:\Git\TableML\TableML\TableMLCompiler\SimpleExcelFile.cs:行号 130
   在 TableML.Compiler.SimpleExcelFile..ctor(String excelPath) 位置 d:\Git\TableML\TableML\TableMLCompiler\SimpleExcelFile.cs:行号 113
   在 TableML.Compiler.Compiler.Compile(String path, String compileToFilePath, String compileBaseDir, Boolean doRealCompile) 位置 d:\Git\TableML\TableML\TableMLCompiler\Compiler.cs:行号 317
   在 TableML.Compiler.Compiler.Compile(String path) 位置 d:\Git\TableML\TableML\TableMLCompiler\Compiler.cs:行号 293
   在 TableCompilerConsole.TableCompilerConsole.Main(String[] args) 位置 d:\Git\TableML\TableML\TableMLCompilerConsole\Program.cs:行号 36

编译xls文件,是正常的。

D:\Git\TableML\TableML\TableMLCompilerConsole\bin\Debug>TableML.exe -f TestExcel.xls
Filename: TestExcel.xls
Compile excel file: TestExcel.xls , to D:\Git\TableML\TableML\TableMLCompilerConsole\bin\Debug\TestExcel.tml

抛异常的130行代码行如下:

       private void ParseExcel(string filePath)
        {
            using (var file = new FileStream(filePath, FileMode.Open, FileAccess.Read,FileShare.ReadWrite)) // no isolation
            {
                try
                {
                    Workbook = WorkbookFactory.Create(file);
                }
                catch (Exception e)
                {
                    throw new Exception(string.Format("无法打开Excel: {0}, 可能原因:正在打开?或是Office2007格式(尝试另存为)? {1}", filePath,
                        e.Message));
                    //IsLoadSuccess = false;
                }
            }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.