Ejemplo n.º 1
0
        static void ActivateAutoFilter(string path)
        {
            Workbook workbook = new Workbook();

            workbook.LoadFromFile(path);
            Worksheet             sheet   = workbook.Worksheets[0];
            AutoFiltersCollection filters = sheet.AutoFilters;

            filters.Range = sheet.Range[1, 6, sheet.LastRow, 6];
            filters.AddFilter(0, "FİLO YÖNETİCİSİ");
            filters.AddFilter(0, "TPC SORUMLUSU");
            filters.Filter();
            workbook.SaveToFile(@"C:\temp\output.xlsx", ExcelVersion.Version2010);
        }
Ejemplo n.º 2
0
        public static void AutoFilter_Test()
        {
            Workbook workbook = new Workbook();

            workbook.LoadFromFile(@"D:\dotnet\chart\bin\Debug\netcoreapp3.1\template.xlsx");
            Worksheet sheet = workbook.Worksheets["FD"];

            sheet.Activate();
            AutoFiltersCollection filters = sheet.AutoFilters;

            filters.Range = sheet.Range[3, 8, sheet.LastRow, 8];

            filters.AddFilter(0, "Walk-in");
            filters.Filter();
            workbook.SaveToFile("output.xlsx", ExcelVersion.Version2010);
        }
Ejemplo n.º 3
0
        public static void ActivateAutoFilter(string path, string dest)
        {
            Workbook workbook = new Workbook();

            workbook.LoadFromFile(path);
            Worksheet sheet = workbook.Worksheets[0];


            workbook.DataSorter.SortColumns.Add(5, OrderBy.Descending);
            workbook.DataSorter.Sort(sheet["A1:Z10000"]);

            AutoFiltersCollection filters = sheet.AutoFilters;

            filters.Range = sheet.Range[1, 6, sheet.LastRow, 6];
            filters.AddFilter(0, "FİLO YÖNETİCİSİ");
            filters.AddFilter(0, "TPC SORUMLUSU");
            filters.Filter();



            workbook.SaveToFile(dest, ExcelVersion.Version2010);
        }