Board index » delphi » Quick Report memo

Quick Report memo

I have a Quick Report in my Delphi 5 multi-user application that contains a
QRMemo component in which i wish to display the address details related to
the current record.  The current record is derived from a Query component
with the following select ;-

SELECT
    p.Clientid,
    p.CreditorId,
    p.AcctRef,
    p.BatchNo,
    p.ChqNo,
    p.InstAmmount,
    cr.name,
    cradd.address1,
    cradd.address2,
    cradd.address3,
    cradd.town,
    cradd.county,
    cradd.postcode,
    c.forename,
    c.surname,
    c.forename2,
    c.surname2

FROM
    Payout p,
    Creditor Cr,
    CredAddress CrAdd,
    Client1 c

WHERE
    p.creditorid = cr.creditorid
    AND cr.creditorid = cradd.id
    AND c.clientid = p.clientid
    AND p.BatchNo = :intBatchNo

ORDER BY
    p.creditorid, p.AcctRef

How do I pass the values of field in the query to the QRMemo  component ?

If I had a form with a text component and a button to produce a report I
would use the following code in the QRBand1 BeforePrint property, which
effectively ignores anything with a no address details ;-

begin
 qrmemo1.lines.clear;
  with CreditFrm do
  begin
   if DBEdit1.Text <> emptyStr then
      qrmemo1.Lines.Add(DBEdit1.Text);
   if DBEdit2.Text <> emptyStr then
      qrmemo1.Lines.Add(DBEdit2.Text);
   if DBEdit3.Text <> emptyStr then
      qrmemo1.Lines.Add(DBEdit3.Text);
   if DBEdit4.Text <> emptyStr then
      qrmemo1.Lines.Add(DBEdit4.Text);
   if DBEdit5.Text <> emptyStr then
      qrmemo1.Lines.Add(DBEdit5.Text);
   if DBEdit6.Text <> emptyStr then
      qrmemo1.Lines.Add(DBEdit6.Text);
  end;
end;

Chris

 ChrisRoss....@EggConnect.net

 

Re:Quick Report memo


The approach looks generally good. Have you tried putting the code in the
QRMemo's OnPrint event?

--
Steve F (Team B)

Re:Quick Report memo


The issue is how to obtain the value from the query to pass to the memo -
I'm sure it will work in the current property.

Chris

Other Threads