Autofit Row Height of Merged Cell in EPPlus

后端 未结 3 724
予麋鹿
予麋鹿 2020-12-19 02:41

I\'m using EPPlus and C# and trying to autosize/autofit the height of a row to accommodate the height needed to show all of the contents of a merged cell with text wrapping.

3条回答
  •  被撕碎了的回忆
    2020-12-19 03:07

    I have used a workaround for this and I a had print area A:Q.

    1. I copied merged cells value to column z.
    2. set width of column z to merge cells width.
    3. Then set auto row height true in format.
    4. Hide the z column.
    5. Set print area A:Q

    Cons: There are duplicate data. But we are okay since report is printing and not print z column.

    Pros: Row height works correctly not like calculation method.

提交回复
热议问题