MasterData Stretched= true forces page break after every line
I'm using FMX 2 (version 2.5.11) with Delphi 10.2 with Update 2. I have a text object on my MasterData band that can have a variable number of lines. I set the text object stretchmode = smactualheight and Allowsplit = false. I'm using the onbeforeprint event to determine how many lines should appear. If I set the MasterData band to stretched = true, whether one line or two lines to print a page break always occurs. If MasterData band to stretched = false, the lines will bunch up on the page. See attached examples. Here is my code:
procedure Descrip1OnBeforePrint(Sender: TfrxComponent);
var
s : string;
begin
s := '';
if <Tmptrans."B_SESCHARGE"> <> 0 then
begin
if (length(<Tmptrans."B_SERVLINE1">) > 0) then
s := formatServLine(<Tmptrans."B_SERVLINE1">);
if (<tmptrans."B_SESDATEBILLED"> <> 0) and Validdate(<tmptrans."B_SESDATEBILLED">) then
begin
if Carriers.Locate('CAR_NUMBER',<tmptrans."B_CARRIER">, 0) then
s := s+#13#10 +' Claim Submitted To: '+<Carriers."CAR_NAME">
end;
Descrip1.Text := s
end
else
if <Tmptrans."B_SESRECVD"> <> 0 then
Descrip1.Text := 'PAYMENT'
else
Descrip1.Text := 'ADJUSTMENT'
end;
Any help greatly appreciated
procedure Descrip1OnBeforePrint(Sender: TfrxComponent);
var
s : string;
begin
s := '';
if <Tmptrans."B_SESCHARGE"> <> 0 then
begin
if (length(<Tmptrans."B_SERVLINE1">) > 0) then
s := formatServLine(<Tmptrans."B_SERVLINE1">);
if (<tmptrans."B_SESDATEBILLED"> <> 0) and Validdate(<tmptrans."B_SESDATEBILLED">) then
begin
if Carriers.Locate('CAR_NUMBER',<tmptrans."B_CARRIER">, 0) then
s := s+#13#10 +' Claim Submitted To: '+<Carriers."CAR_NAME">
end;
Descrip1.Text := s
end
else
if <Tmptrans."B_SESRECVD"> <> 0 then
Descrip1.Text := 'PAYMENT'
else
Descrip1.Text := 'ADJUSTMENT'
end;
Any help greatly appreciated
Comments