qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
18.05k stars 1.71k forks source link

Add new functions DeleteSlicer and GetSlicers #1943

Closed zhangyimingdatiancai closed 1 month ago

zhangyimingdatiancai commented 3 months ago

PR Details

  1. Create a new GetSlicers function to get the slicer definition list
  2. Create a new DeleteSlicer function to delete specified slicer by the given slicer name
  3. Implement this feature in the slicer.go and xmlSlicers.go source code

Description

Slicers in spreadsheets are filter tools used along with Excel tables or pivot tables over a large amount of data. Currently, the Excelize library already supports to creation of a slicer for the table or pivot table in the worksheet. The goal of this PR is to add the function for getting and deleting slicers and support for removing slicers by the given slicer name.

Related Issue

N/A

Motivation and Context

Add get and delete slicer support

How Has This Been Tested

Complete documentation and unit tests, written unit test code in the slicer_test.go source code, incremental test coverage of line reach 100%

Types of changes

Checklist

zhangyimingdatiancai commented 1 month ago

Hi @xuri, the DeleteSlicer function now has been implemented. I added unit tests for it. This PR ready for review.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.31%. Comparing base (9a38657) to head (678c205). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1943 +/- ## ======================================== Coverage 99.31% 99.31% ======================================== Files 32 32 Lines 25002 25230 +228 ======================================== + Hits 24830 25058 +228 Misses 92 92 Partials 80 80 ``` | [Flag](https://app.codecov.io/gh/qax-os/excelize/pull/1943/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qax-os) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qax-os/excelize/pull/1943/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qax-os) | `99.31% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qax-os#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.