I need to move around some memo objects and adjust the height of a band while the report is being generated. I added the following to the script:
procedure MasterDataOnBeforePrint(Sender: TfrxComponent);
begin
if (DRID = <TRAN_DETAIL."REFERENCEID">) then
begin
txChargeDate.Top := 0;
txChargeDesc.Top := 0;
txChargeQuant.Top := 0;
txChargeAmt.Top := 0;
txDRInfo.Visible := false;
txDRDesc.Visible := false;
MasterData.Height := 0.25;
end
else
begin
MasterData.Height := 0.65;
txChargeDate.Top := 0.4;
txChargeDesc.Top := 0.4;
txChargeQuant.Top := 0.4;
txChargeAmt.Top := 0.4;
txDRInfo.Visible := true;
txDRDesc.Visible := true;
end;
DRID := <TRAN_DETAIL."REFERENCEID">;
end;
Basically, if the current line item has the same ReferenceID as the previous line item, then I don't want txDRInfo and txDRDesc to print. I also don't want a big space to show up where they would have been. So, I check if the reference ID has changed and move the items around and hide the text that isn't to be printed.
The problem with this is that although this is in the BeforePrint event, any changes I make to position or size affect ALL line items and not just the one being looked at by the event.
Is there a way around this using Delphi 2007 and FastReport VCL 5?