Home RAP

Conditional Show of DBMemo

edited January 2010 in RAP
Hi.

I have a sub report where I would like to show detail-info from a memo
field on some records not all.
The condition that tells if the details(memo) should be shown, is a data
field called "VisInfo" (Boolean) in the "printed record".

The report should look something like this:

Detail
_________________

Record 1
Record 2
Record 3
"This is detail info for record 3"
Record 4
Record 5
"This is detail info for record 5"
Record 6
...
...
_________________

I have tried this code on several events, but can't get the DBMemo to show:


procedure DBMemo1OnGetMemo(Lines: TStrings);
begin
if plAvrTillegg['Visinfo'] then
DBMemo1.Visible:= True;
end;

Anyone have a tip on how to accomplish this functionality?


--
Best Regards
Petter Topp


Sent using Opera newsreader: http://www.opera.com/

Comments

  • edited January 2010
    Hi Petter,

    Try getting this to work correctly in Delphi first, then move the code to
    RAP. This way you can trace into the event handlers and see the actual
    values being returned by the datasets. Also you may want to use the OnPrint
    event of the memo or perhaps try using the BeforePrint event of the band.

    Do not forget to set the Visible property back to False if the VisInfo field
    is false...

    DBMemo1.Visible := plAvrTillegg['Visinfo'];

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.