Blank fields
I have 6 database fields in a report.
Address1
Address2
Address3
Town
County
PostCode
If there is no data in address3 I get a blank line in the report. How do I 'Move up' the fields below so I don't see the blank line.
Cheers
SteveW
Address1
Address2
Address3
Town
County
PostCode
If there is no data in address3 I get a blank line in the report. How do I 'Move up' the fields below so I don't see the blank line.
Cheers
SteveW
Comments
procedure Memo1OnBeforePrint(Sender: TfrxComponent);
begin
Memo1.Text := '';
if <MyDb."Address1"> <> '' then
Memo1.Lines.Add(<MyDb."Address1">);
if <MyDb."Address2"> <> '' then
Memo1.Lines.Add(<MyDb."Address2">);
end;
Petter
then write code for the oad event of the memo.
procedure memonameOnAfterData(Sender: TfrxComponent);
var i: integer;
begin
for i := TfrxMemoView(Sender).Lines.Count - 1 downto 0 do
begin
if TfrxMemoView(Sender).Lines.Strings = '' then
TfrxMemoView(Sender).Memo.Delete(i);
end;
end;
Cheers
SteveW
Can you please explain where I place the code.(at idiot level)
Cheers
SteveW
Try to use IIF function in TfrxMemoView
Where do I do that please ? Is there an example I can look at ?
Cheers
SteveW
Thanks for the code but I do not know where to add the code. Is there an event within the report or is it on an event on the component?
Cheers
SteveW
It works fine if you only have one or two column references. However, more than that quickly results in code which is unreadable, error prone and impossible to debug and get right. Even using the facility to build the expression by dropping in functions and column references often creates code which still throws up errors, so much so that I have abandonned using that construct except for the most simple things. It looks to me that there are some internal limitation as to the nesting levels.
Do yourself a favor, preserve your mental and physical health, and get the standard version with the scripting capability. Working with a script will make many problems almost child's play.