ClosedXML.Report icon indicating copy to clipboard operation
ClosedXML.Report copied to clipboard

Add Height and HeightRange option.

Open masterworgen opened this issue 1 year ago • 2 comments

Pull Request Description

Summary

I have added two new tags to the library, <<Height number>> and <<HeightRange number>>, which allow users to set the height for individual rows and a range of rows respectively.

Changes Made

  1. <<Height number>> Tag: This tag sets the height for a specific row. When this tag is processed, the row height is adjusted according to the specified number.

    Example Usage:

    <<Height 20>>
    

    After processing, the row containing this tag will have a height of 20 units.

  2. <<HeightRange number>> Tag: This tag sets the height for a range of rows. When this tag is processed, the specified range of rows will have their heights set to the given number.

    Example Usage:

    <<HeightRange 30>>
    

    After processing, the rows in the specified range will each have a height of 30 units.

Detailed Implementation

  • The <<Height number>> tag parses the number and applies it to the height property of the targeted row.
  • The <<HeightRange number>> tag parses the number and applies it to the height property of the rows within the specified range.

These enhancements aim to provide more flexibility and control over row formatting in the library.

Thank you for considering this pull request. I believe these additions will greatly benefit users by providing more precise control over row heights.

masterworgen avatar Jul 03 '24 08:07 masterworgen

Please, add some tests - maybe something like this checking the new tags, or put a template with these tags into test/Templates folder and make a test like this.

Notice there are failing tests here.

Pankraty avatar Jul 03 '24 11:07 Pankraty

Add and fix tests

masterworgen avatar Jul 04 '24 06:07 masterworgen