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

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.