memoview hide or delete a row

edited 1:37AM in FastReport 4.0
Hi

I'm new to fastreport and want to know how to hide certain MemoView when DataField have a null value or how to remove the line when the datafield has a null value. I would greatly appreciate your help.

Thank You

Comments

  • edited 1:37AM
    First is to get information if the datafield is null. You can do it using one of two methods:

    1. Set Report.EngineOptions.ConvertNulls := true
    2. Modify your query a bit like select ..., if ThisField is null then 0 else 1 endif as ShowThisField

    The second way seems (to me) more efficent as it does NOT change global EngineOptions for the whole report.
    And when you have info about null or not null then use OnBeforePrint event for a band (where your memo is located) and set

    Ad.1.
    Memo1.Visible := (<ADOQuery."ThisField"> is null)

    Ad.2.
    Memo1.Visible := (<ADOQuery."ShowThisField"> = 1)


    You can make the band not Visible in the same way

    MasterData1.Visible := (and_here_one_of_the_above_conditions)


    Mick
  • edited 1:37AM
    thank you for your help, and I try and then right, thank you >

Leave a Comment