memoview hide or delete a row

edited 9:53AM 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 9:53AM
    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 9:53AM
    thank you for your help, and I try and then right, thank you >

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.