Hiding Child Band based on Memo field contents set from Delphi
Hi,
I have a child Band for my Report Title. On this Child band there is a Memo field, which is not connected to any dataset. The value for this memo field is populated from Delphi by using the following syntax in Delphi itself:
How can I check if the Memo field contains something, and if it does not contain any characters I want the Child band not to display.
I have tried this code on the OBP event in the Fast Report Script, but this does not print anything under any condition.
Your assistance much appreciated.
Regards
Marius
I have a child Band for my Report Title. On this Child band there is a Memo field, which is not connected to any dataset. The value for this memo field is populated from Delphi by using the following syntax in Delphi itself:
t := TfrxMemoView(frxReportSlip.FindObject('lblCustomerName'));
  if t <> nil then
    t.Memo.Text := (qryFetchHeader.FieldByName('E_CUSTOMERNAME').AsString);
How can I check if the Memo field contains something, and if it does not contain any characters I want the Child band not to display.
I have tried this code on the OBP event in the Fast Report Script, but this does not print anything under any condition.
  if length(lblCustomerName.value)<1 then         Â
    begin
      Child2.Visible := False;
      Child2.Height  := 0.00;                                                           Â
    end
  else
    begin
      Child2.Visible := True;
      Child2.Height  := 1.13;       Â
    end;
Your assistance much appreciated.
Regards
Marius
Comments
From within my Delphi code, I use this:
Any comments?
I would try:
As far as I know, the value-property is for use in the OnAfterData of the memo only, and does not contain anything otherwise.
Petter
Child2.Visible := Trim(lblCustomerName.text) <> ''
and that code (FR script) should be executed in OBP event of Report Title, eg. before its Child band is analised by FR Engine.
Regards
Mick
or Child2.Visible := Trim(Report.Calc(lblCustomerName.text)) <> ''