예제 #1
0
        static int ConvertReportToExcel(Xbrl.Taxonomy.Dts dts, ExcelWriter writer, string fileIn, string fileOut)
        {
            try
            {
                var report = new Report(fileIn, dts);
                var wb     = writer.WriteReport(report);

                Logger.Debug("Saving Excel workbook to {0}", fileOut);
                wb.SaveAs(fileOut);
            }
            catch (Exception e)
            {
                Logger.Error(e);
                return(1);
            }

            Logger.Info("Finished conversion of {0} to {1}", fileIn, fileOut);
            return(0);
        }
예제 #2
0
        static int Run(Options o)
        {
            SetupLogger(o.LogFile);

            Xbrl.Taxonomy.Dts dts = null;
            if (o.EntryPointUrl != null)
            {
                Logger.Debug("Loading DTS {0}", o.EntryPointUrl);
                ErrorLog log;
                dts = Xbrl.Taxonomy.Dts.CreateFromUrl(o.EntryPointUrl, out log);
                if (log.HasErrors)
                {
                    Logger.Error(log);
                    return(1);
                }
            }

            var writer = new ExcelWriter(new DefaultTableStyle(), o.XOffset, o.YOffset, o.EmptyRowsAfterTitle);

            return(ConvertReportToExcel(dts, writer, o.InputFile, o.OutputFile));
        }