Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for merged cells and hyperlinks in Excel template #32

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dungsaga
Copy link

@dungsaga dungsaga commented Jul 3, 2023

Hyperlinks in Excel template are recorded in element. This PR adds support for keeping updated correctly when rows/cells are added as a result of the calls to MergeBlock.

Merged cells in Excel template are records in element. This PR adds similar support for element.

This kind of support only works for merged cells and hyperlinks that are not in the same row as the row that has block=tbs:row (and similarly, not in the same column as the column that hasblock=tbs:cell).

A new ope was introduced to support this case, that's ope=mergecells.

Example:

  • in a row that has block=tbs:row, a cell with ope=mergecells;cols=2 would generate a merged cell (containing 2 columns) in each added row
  • in a row that has block=tbs:cell, a cell with ope=mergecells;rows=3 would generate a merged cell (containing 3 rows) in each added column

Parameters rows and cols can be omitted. The default value is the value of the current field. This feature allows the dimensions of the merged cell to be determined dynamically.

Example:

  • in a row that has block=tbs:row, a cell with [block1.field2;ope=mergecells;rows=1] and block1.field2 has value 4 would generate a merged cell (containing 4 columns) in each added row
  • in a row that has block=tbs:cell, a cell with [block1.field2;ope=mergecells;cols=1] and block1.field2 has value 5 would generate a merged cell (containing 5 rows) in each added column

dungsaga added 6 commits May 22, 2023 12:13
Example: the block [fieldName;ope=mergecells;rows=xx;cols=yy] is used to merge cells from xx rows and yy columns. One of the parameters (`rows` or `cols`) can be omitted, and its value would be read from `fieldName`.
Reference to existing merged cells are read in TbsLoadSubFileAsTemplate(), and are updated in BeforeMergeBlock() to match their new position after adding rows/columns. Finally, they are written in BeforeShow() to the current subfile.
@diantonio85
Copy link

Hi, will this ever get merged?

@dungsaga
Copy link
Author

dungsaga commented Nov 30, 2024 via email

@diantonio85
Copy link

Maybe send a ping to @Skrol29. This is a really needed feature!

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.

2 participants