Inheritance: IDisposable
示例#1
0
        public override void Execute()
        {
            Log.Info("Start to import json to excel...");

            using (var writer = new ExcelOperation.ExcelWriter(ExcelPath, ExcelTitleRow, ExcelContentRow))
            {
                Log.Info("Read sheets from: {0}", JsonPath);
                var sheets = JsonOperation.DeserializeSheets(File.ReadAllText(JsonPath, Encoding.UTF8));

                foreach (var sheet in sheets)
                {
                    Log.Info("Write sheet : {0}", sheet.Name);
                    writer.Write(sheet);
                }

                writer.Save();
            }

            Log.Info("Done.");
        }
示例#2
0
        public override void Execute()
        {
            Log.Info("Start to import json to excel...");

            using (var writer = new ExcelOperation.ExcelWriter(ExcelPath, ExcelTitleRow, ExcelContentRow))
            {
                Log.Info("Read sheets from: {0}", JsonPath);
                var sheets = JsonOperation.DeserializeSheets(File.ReadAllText(JsonPath, Encoding.UTF8));

                foreach (var sheet in sheets)
                {
                    Log.Info("Write sheet : {0}", sheet.Name);
                    writer.Write(sheet);
                }

                writer.Save();
            }

            Log.Info("Done.");
        }