Skip to content

Added support for querying arbitrary named tables #969

Merged
michelebastione merged 5 commits into
mini-software:masterfrom
michelebastione:tables-support
May 31, 2026
Merged

Added support for querying arbitrary named tables #969
michelebastione merged 5 commits into
mini-software:masterfrom
michelebastione:tables-support

Conversation

@michelebastione
Copy link
Copy Markdown
Collaborator

Added QueryTable and QueryTableAsync API methods to OpenXmlImporter for retrieving data from arbitrary tables in the worksheets.

Resolves #341

Split `OpenXml.Reader` into partial files: OpenXmlReader, OpenXmlReader.Mapped, OpenXmlReader.MergeCells and OpenXmlReader.Comments, and sealed the class to simplify the Dispose pattern.
Unified `XmlReaderSettings` via `XmlReaderHelper.GetXmlReaderSettings` and refactored `OpenXmlStyles` to an async factory.
Removed `OpenXmlConfiguration` from `GetSheetNames`/`GetSheetInformations` public signatures and add obsolete forwarding overloads for compatibility.
Other minor modifications and cleanups.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for querying named tables in Excel worksheets through new QueryTable and QueryTableAsync methods in OpenXmlImporter, alongside refactoring OpenXmlReader into partial classes and optimizing XML reading and styles loading. The review feedback highlights several robustness issues in the new table querying and styles parsing logic. Specifically, it points out potential NullReferenceException and KeyNotFoundException risks, a bug where columns named identically to their Excel column letters could be deleted, a potential out-of-bounds index issue, and the need for case-insensitive sheet name matching.

Comment thread src/MiniExcel.OpenXml/Reader/OpenXmlReader.Tables.cs
Comment thread src/MiniExcel.OpenXml/Reader/OpenXmlReader.Tables.cs Outdated
Comment thread src/MiniExcel.OpenXml/Reader/OpenXmlReader.Tables.cs Outdated
Comment thread src/MiniExcel.OpenXml/Reader/OpenXmlReader.Tables.cs
Comment thread src/MiniExcel.OpenXml/Reader/OpenXmlReader.Tables.cs Outdated
Comment thread src/MiniExcel.OpenXml/Styles/OpenXmlStyles.cs Outdated
@michelebastione michelebastione merged commit 2dd1e81 into mini-software:master May 31, 2026
3 checks passed
@michelebastione michelebastione deleted the tables-support branch May 31, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for reading arbitrary tables defined in the worksheets

1 participant