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

Merge Cells #15

Open
ndrogers opened this issue Feb 26, 2020 · 6 comments
Open

Merge Cells #15

ndrogers opened this issue Feb 26, 2020 · 6 comments

Comments

@ndrogers
Copy link
Collaborator

ndrogers commented Feb 26, 2020

The Merge Cells feature should be an optional property of a range.

This requires the same extension to cellXfs required by wrap text #14

@ndrogers
Copy link
Collaborator Author

ndrogers commented Feb 26, 2020

An extension to cellXfs such as the following should be made to extend the xfs XML generation found in StyleXML.

  • Can multiple properties be added to alignment simultaneously?
  • What other types of properties exist for alignment?
alignment02 'alignment' ''('horizontal' 'center')
alignment12 'alignment' ''('wrapText' '1')
spreadalignment1{(,())[{,}]}c

An extension for rows is required. The value is placed into the first cell of the range that is to be merged. Other cell values are empty, but have the same type and style xfs index.

  <row r="1" spans="1:4" x14ac:dyDescent="0.35">
      <c r="A1" s="1" t="s">
        <v>0</v>
      </c>
      <c r="B1" s="1"/>
      <c r="C1" s="1"/>
      <c r="D1" s="1"/>
    </row>
    <row r="2" spans="1:4" x14ac:dyDescent="0.35">
      <c r="A2" s="1"/>
      <c r="B2" s="1"/>
      <c r="C2" s="1"/>
      <c r="D2" s="1"/>
    </row>
    <row r="3" spans="1:4" x14ac:dyDescent="0.35">
      <c r="A3" s="1"/>
      <c r="B3" s="1"/>
      <c r="C3" s="1"/>
      <c r="D3" s="1"/>
    </row>
.
.
.
  • How should you define a range that merges cells?
  • Should a Merge Cell range only contain a single value?
  • Should the Merge Cell property contain an APL shape to define the range?
  • etc.

@ndrogers ndrogers mentioned this issue Feb 26, 2020
@PaulMansour
Copy link
Contributor

MergeCells should be a boolean flag in the range object. All of the other properties in the range should be "scalar" or if an array is defined that matches the shape of the range, simply take the first item for the property and ignore the rest.

@PaulMansour
Copy link
Contributor

Not sure what you are planning for alignment, but should be just properties of the range like Value. HorizontalAlignment and VerticalAlignment.

@ndrogers
Copy link
Collaborator Author

@PaulMansour The point I was making about multiple alignment properties is that wrapText is a property for the <alignment/> tag within a xfs tag. So in that case, is it possible to have wrapText="1" and horizontal="center"? What other values are possible for horizontal, what other kinds of alignment are there aside from wrapText and horizontal. I'm just musing about this and need to learn more before solidifying the internal design.

@PaulMansour
Copy link
Contributor

So in that case, is it possible to have wrapText="1" and horizontal="center"?

Yes. Open excel and look at the Alignment tab on the Format Cells dialog box.

@ndrogers
Copy link
Collaborator Author

Commit 04f2c2c adds the following attributes to Ranges

range.MergeCells1  boolean scalar
range.Horizontal'center'  nested charvec, or nested char mat corresponding to the cells in range.Value
range.Vertical 'center' same as Horizontal
range.WrapText1  boolean scalar/vec/mat corresponding to the cells in range.Value
range.ShrinkToFie1  same as range.WrapText

Tests are yet to be added to validate these features.

Please test them at your leisure @PaulMansour @mkromberg

Tests.Utility.BasicWS is what I was using for testing, and I set the 2 ranges to different combinations of styles. I will now test these attributes more thoroughly and add test cases for them in the Tests directory.

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

No branches or pull requests

2 participants