How to Print TEXT on Form

Hi,

I use Sql :

WHERE ( I.InvoiceDate Between' + QuotedStr(DateEdit.text) + ' and ' + QuotedStr(DateEdit2.text)+')';

When Print out : I need to print [DateEdit.text] - [DateEdit.text2] on Report header.

any advice?

mike

Comments

  • edited 10:39PM
    Use OnGetValue.
  • gordkgordk St.Catherines On. Canada.
    edited 10:39PM
    assuming you are using a dateeditcontrol on an fr3 dialog form
    the text in your header memo would be
    [Dateedit1.date] - [Dateedit2.date]
    and set the display format of the memo to what date format you want.
    ;)
  • edited 10:39PM
    Hi grodk,

    Thanks for your advice.

    I like fr3, my existing report use QReport. Now I want to covert QReport to fr3.
    I have no problem using fr3 dialog, but my dialog is on TForm - DateEdit1.text and DateEdit2.text (TEdit). I need to print (DateEdit1.text) and (DateEdit2.text) on fr3 header.

    Below is my query for QReport:

    DateFrom := StrToDate(DateEdit1.text);
    DateThru := StrToDate(DateEdit2.text);

    rptARStatements.lblFrom.caption := FormatDateTime('mm/dd/yyyy',
    DateFrom); // Print on TQuickRep header
    rptARStatements.lblThru.caption := FormatDateTime('mm/dd/yyyy', DateThru); // Print on TQuickRep header

    with rptARStatements, qryARinv do
    begin
    SQL.Clear;
    SQL.Add('SELECT I.InvoiceNo, I.InvoiceDate, I.InvoiceAmount, I.Owing, I.CustomerID, I.Description, C.*');
    SQL.Add('FROM ARInv I INNER JOIN Customer C ON I.CustomerID = C.CustomerID');
    SQL.Add('WHERE I.InvoiceDate Between' + QuotedStr(DateEdit1.text) + ' and ' + QuotedStr(DateEdit2.text));
    SQL.Add('ORDER BY C.CustomerNo, I.InvoiceDate, I.InvoiceNo NOCASE');
    rptARStatements.qryARInv.Active := true;
    end;
    rptARStatements.QuickReport.Preview;

    This is in customer statement Form. I must show on this statement "Date From" and "Date Thru"(Ending Date) on fr3 print out (on fr3 header).


    mike
  • gordkgordk St.Catherines On. Canada.
    edited 10:39PM
    Create variables in the report ie stdate enddate
    when you load report pass values into the variables before calling preparereport or show report
    read the progammers and the users manual on variables.
    ;)

  • edited 10:39PM
    Hi

    Gordk & Serg:

    Thank you for your advice.
    They are very helpful.

    Michael

Leave a Comment