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 2:14AM
    Use OnGetValue.
  • gordkgordk St.Catherines On. Canada.
    edited 2:14AM
    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 2:14AM
    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 2:14AM
    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 2:14AM
    Hi

    Gordk & Serg:

    Thank you for your advice.
    They are very helpful.

    Michael

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.