Search code examples
c#asp.netfastreport

Changing Table Cell Height Depending on the Value


I had created some table in fastreport and loaded data from db inside it. The thing is that not all of the data fit inside the table cells, so I need to change the height of the table cells depending of the Text.Length inside the cells. I've tried doing something like this:

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)

            }
        }
 }
};

And it doesn't work but when I'm trying to change the text colour inside the cell the same way, it does work. I'm confused, how does the height change actually happen then?


Solution

  • You can't change the height of only one cell, you can only change the height of the entire row, for example:

    Row2.Height = 100;