Skip to content

feat(DefaultTableExport): add EnableAutoFilter property#406

Merged
ArgoZhang merged 3 commits intomasterfrom
feat(DefaultTableExport)-#5845
Apr 19, 2025
Merged

feat(DefaultTableExport): add EnableAutoFilter property#406
ArgoZhang merged 3 commits intomasterfrom
feat(DefaultTableExport)-#5845

Conversation

@densen2014
Copy link
Copy Markdown
Contributor

@densen2014 densen2014 commented Apr 17, 2025

Link issues

fixes #407

依赖主工程 TableExportOptions

dotnetcore/BootstrapBlazor#5845

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

@bb-auto
Copy link
Copy Markdown

bb-auto Bot commented Apr 17, 2025

Thanks for your PR, @densen2014. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 17, 2025

Reviewer's Guide by Sourcery

This pull request introduces two new parameters, AutoFilter and EnableAutoWidth, to the table export functionality. These parameters allow developers to control whether Excel's auto-filter and auto-width features are enabled during the export process. The changes involve modifying the DefaultTableExport.cs file to incorporate these options when saving data to an Excel file using the MiniExcel library.

Sequence diagram for the table export process with new options

sequenceDiagram
  participant Client
  participant DefaultTableExport
  participant TableExportOption
  participant MiniExcel
  participant MemoryStream

  Client->>DefaultTableExport: ExportAsync(items, fileName, excelType, options, cols)
  DefaultTableExport->>TableExportOption: Read AutoFilter and EnableAutoWidth
  DefaultTableExport->>MiniExcel: SaveAsAsync(stream, value, excelType, configuration)
  activate MiniExcel
  MiniExcel->>MemoryStream: Write Excel data with AutoFilter and EnableAutoWidth
  deactivate MiniExcel
  DefaultTableExport->>MemoryStream: stream.Position = 0
  DefaultTableExport-->>Client: Return Task<bool>
Loading

File-Level Changes

Change Details Files
Added parameters to control Excel auto-filter and auto-width during export.
  • Added AutoFilter and EnableAutoWidth properties to the BootstrapBlazorOptions.TableSettings.TableExportOptions to control Excel export behavior.
  • Created an OpenXmlConfiguration object to pass the AutoFilter and EnableAutoWidth options to MiniExcel.
  • Passed the OpenXmlConfiguration object to the MiniExcel.SaveAsAsync method.
src/components/BootstrapBlazor.TableExport/Services/DefaultTableExport.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot requested a review from ArgoZhang April 17, 2025 13:47
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @densen2014 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a comment explaining why AutoFilter and EnableAutoWidth are part of OpenXmlConfiguration.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang changed the title feat(DefaultTableExport): 添加是否启用 Excel 自动筛选,是否启用 Excel 自动宽度参数 #5845 feat(DefaultTableExport): add EnableAutoFilter property Apr 19, 2025
@bb-auto bb-auto Bot added the enhancement New feature or request label Apr 19, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Apr 19, 2025
@ArgoZhang ArgoZhang merged commit 6aa3020 into master Apr 19, 2025
1 check passed
@ArgoZhang ArgoZhang deleted the feat(DefaultTableExport)-#5845 branch April 19, 2025 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(DefaultTableExport): add EnableAutoFilter property

2 participants