variable height TfrxMasterData

Hi All,

Is it possible to adjust the height of a TfrxMasterData component?

I want:

First datacouple: both datafields do have data

----------

| row 1 data of dataset

| row 2 data of dataset

----------


Second datacouple: only first datafield has data, second one is empty.

Second row is not visible and the height of the TfrxMasterData component is adjusted to only one row.

----------

| row 1 data of dataset

----------


I want to avoid this situation:

----------

| row 1 data of dataset

| row 2 no data visible, displaying an empty line on page

----------


I hope someone can help me.

Regards, Peter

Comments

  • Move row 2 to TfrxChild band and show/hide this band depend of row 2 datafield value

  • Hi,

    Thank you for your reply.

    If I do it like this:


    Code in FastReport:

    procedure ChildOfBand_MasterData1OnBeforePrint(Sender: TfrxComponent);

    begin

     ChildOfBand_MasterData1.Visible := Memo_Text1DB_Plants.Text <> '';

    end;


    The child will be shown or hidden depending of the last MemoText1DBPlants.Text value.

    Is it possible to show or hide a TfrxChild coupled to a TfrxMasterData?

  • I already solved the problem by:


    Code in FastReport:

    procedure Memo_Text1DB_PlantsOnAfterData(Sender: TfrxComponent);

    begin

     If Memo_Text1DB_Plants.Text = ''

      Then Engine.CurY := Engine.CurY - Memo_Text1DB_Plants.Height;                                                       

    end;


    Result:

    Thanks again. Your help was very appreciated.

Leave a Comment