M
M
madhowrad2021-11-22 08:33:50
C++ / C#
madhowrad, 2021-11-22 08:33:50

How to infer from a table?

How to infer from a table?
Here is the table it needs to be displayed in the canvas.
Please help or we'll die
https://dropmefiles.com/IXmkZ

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-11-22
@madhowrad

Parse the file and output
https://docs.microsoft.com/ru-ru/dotnet/api/docume...

using DocumentFormat.OpenXml.Packaging;
using System;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;


namespace ExcelImport
{
    public class ProjectEstimatesImport
    {
        private const  string pkname = "CF_РТК";
        private const string rtk = "ПК_РТК";
        private const string importData = "Лист импорта данных";

        public ProjectEstimatesImport(string fileName)
        {

            using (SpreadsheetDocument mySpreadsheet = SpreadsheetDocument.Open(fileName, false))
            {
                var  sheets = mySpreadsheet.WorkbookPart.Workbook.Sheets;
                foreach (Sheets sheet in sheets)
                {
                    foreach (var attr in sheet.GetAttributes())
                    {
                        if (attr.Value == pkname)
                        {
                            ;
                        }
                        else if (attr.Value == rtk)
                        {
                            ;
                        }
                        else if (attr.Value == importData)
                        {
                            ;
                        }
                        Console.WriteLine("{0}: {1}", attr.LocalName, attr.Value);
                    }
                }
            }
            
        }

        public object Result { get; private set; }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question