Carriage Return into a Memo...
I'm having a problem with Chr(13) in Memo...
I have a memo with the following code:
When the data fields CondPag2..5 aren't filleds, a not necessary line space is printed... The solution I found is to put a IIF function on each line... But, to do that, I must insert on the IIF a Chr(13)...
I tried that way:
And the same logic to the CondPag fields... But it shows the error "Invalid variant type conversion"... When I remove the "Chr(13)", there are no errors, but the data fields are printed in the same line...
Finally, how can I force a Carriage Return into IIF functions?
I have a memo with the following code:
Prazo de Entrega: [CadProp."PrazoEntr1"]
         [CadProp."PrazoEntr2"]
Condi?§?µes Pgto.: [CadProp."CondPag1"]
        [CadProp."CondPag2"]
        [CadProp."CondPag3"]
        [CadProp."CondPag4"]
        [CadProp."CondPag5"]
When the data fields CondPag2..5 aren't filleds, a not necessary line space is printed... The solution I found is to put a IIF function on each line... But, to do that, I must insert on the IIF a Chr(13)...
I tried that way:
Prazo de Entrega: [CadProp."PrazoEntr1"][IIF( <CadProp."PrazoEntr2"> <> '', Chr(13) + ' Â Â Â Â Â Â Â Â ' + <CadProp."PrazoEntr2">, '' )]
And the same logic to the CondPag fields... But it shows the error "Invalid variant type conversion"... When I remove the "Chr(13)", there are no errors, but the data fields are printed in the same line...
Finally, how can I force a Carriage Return into IIF functions?
Comments
modify lines in memo text object
you can place each of these expressions in a memo
I usually do this in an rtf memo
[Customers."Company"]
[Customers."Addr1"]
[IIF(<Customers."Addr2">='',<Customers."City">,<Customers."Addr2">)]
[IIF(<Customers."Addr2">='',<Customers."State">,<Customers."City">)]
[IIF(<Customers."Addr2">='',<Customers."Zip">,<Customers."State">)]
[IIF(<Customers."Addr2">='','',<Customers."Zip">,)]
or in a plain text memo which you want to size
set memos stretchmode to smactualheight and write code in obp of band or memo
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
memo3.lines.clear;
memo3.lines.add('[Customers."Company"]');
memo3.lines.add('[Customers."Addr1"]');
if (<Customers."Addr2"><>'') then memo3.lines.add('[Customers."Addr2"]');
if (<Customers."City"><>'') then memo3.lines.add('[Customers."City"]');
if (<Customers."State"><>'')then memo3.lines.add('[Customers."State"]');
if (<Customers."Zip"><>'') then memo3.lines.add('[Customers."Zip"]');
end;
First, I want to thank you for the help...
I tried the second solution, because it seems to be the best for this, but, I have a GREAT problem with the code in the Report... I never could use it...
This time, it shows an error at line 3: Undeclared identifier "Lines"...
I used the following code (OnBeforePrint of the Memo4):
Best regards,
Gabriel Frones
Thank you for the help!!
Best regards,
Gabriel Frones