根据值更改表格单元格高度

时间:2017-05-26 10:02:17

标签: c# asp.net fastreport

我在fastreport中创建了一些表,并从db中加载了数据。问题是并非所有数据都适合表格单元格,因此我需要根据单元格内的Text.Length更改表格单元格的高度。 我尝试过这样的事情:

namespace FastReport
{
    public class ReportScript
    {
        private void Data1_BeforePrint(object sender, EventArgs e)
        {
            if (Cell45.Text.Length > 5)
            {
              Cell45.Height *= 2; // I also tried changing Cell45 to Table2 (the table, where this cell is)

            }
        }
 }
};

它并不起作用,但当我试图以同样的方式改变单元格内的文本颜色时,它确实有效。我很困惑,高度变化实际上是怎么发生的?

1 个答案:

答案 0 :(得分:1)

您无法更改一个单元格的高度,只能更改整行的高度,例如:

-webkit-touch-callout: none; ;
-webkit-user-select: none;
-khtml-user-select: none; 
-moz-user-select: none;
-ms-user-select: none; 
user-select: none;
相关问题