Hide a ppLabel and ppDBMemo based on content of ppMemo
Hi,
In the details of my report I have a ppLabel and a ppDBMemo.
When the content of the ppDBMemo is empty then both fields must be hidden
from the report.
If tried this in the OnGetMemo event of the ppDBMemo but it doesn't work.
procedure ppDBMemo1OnGetMemo(Lines: TStrings);
begin
ppLabe1.Visible := (Lines.Text <> '');
ppDBMemo1.Visible := (Lines.Text <> '');
end
What would be the right way to set this up?
Regards,
Stef
In the details of my report I have a ppLabel and a ppDBMemo.
When the content of the ppDBMemo is empty then both fields must be hidden
from the report.
If tried this in the OnGetMemo event of the ppDBMemo but it doesn't work.
procedure ppDBMemo1OnGetMemo(Lines: TStrings);
begin
ppLabe1.Visible := (Lines.Text <> '');
ppDBMemo1.Visible := (Lines.Text <> '');
end
What would be the right way to set this up?
Regards,
Stef
This discussion has been closed.
Comments
I would recommend using the Band.BeforePrint event to check the actual
record in the dataset the DBMemo is connected to. For instance...
procedure DetailBeforePrint;
begin
ppLabel.Visible := Report.DataPipeline['MemoField'] <> '';
ppDBMemo.Visible := Report.DataPipeline['MemoField'] <> '';
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I did implement it as you said, but still no luck.
Maybe that some more info will help.
My report is build up in the following way:
Report1 = TppReport
plCompany = TppDBPipeline
plCustomers = TppDBPipeline
Report1.DataPipeline = plCompany
In the Detailarea all fields from plCompany are added.
The Memo1-field that I want to hide (if blank) belongs to plCompany and is
also on the Detailarea (same go's for the label).
On the Detailarea of Report1 there is a TppSubReport added (=SubReport1)
SubReport1.DataPipeline = plCustomers
SubReport1 is positioned relatively to the Memo1-field (ShiftRelativeTo)
I load the report from file (*.rtm) on Form's onShow-event.
If any other info is needed please ask.
Regards,
Stef
My first suggestion would be to get this working in Delphi, then try to move
it to RAP. This way you can debug the event code and find out where the
problem is. In my testing with a very similar setup, the method I mentioned
in my previous post seemed to work correctly.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for the help.
Stef