TfrxDateEditControl

edited 11:45PM in FastReport 4.0
Hi,

I have a form with a TfrxDateEditControl on it and would like the date to default to the current date not the date set in the properties value. I have looked through the documentation and sample reports but I seem to be missing something.

If someone could point me in the right direction, it would be much appreciated.

Thanks

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:45PM
    procedure DialogPage1OnActivate(Sender: TfrxComponent);
    begin
    dateedit1.date:= now;
    end;
  • edited 11:45PM
    gordk wrote: »
    procedure DialogPage1OnActivate(Sender: TfrxComponent);
    begin
    dateedit1.date:= now;
    end;

    Thank you....You have saved me from pulling all my hair out. I appreciate your help very much!
  • edited 11:45PM
    gordk wrote: »
    procedure DialogPage1OnActivate(Sender: TfrxComponent);
    begin
    dateedit1.date:= now;
    end;

    Hi Again,

    When I have two date fields on a dialog page i.e. start date and end date, when I enter a different date in the start date field and then click on the end date, the start date switches back to 'now'.

    Code:
    procedure DialogPage1OnActivate(Sender: TfrxComponent);
    begin
    sDate.date:= now;
    end;

    begin
    eDate.date:= now;
    end.

    I've tried switching the eDate the the sDate and that fixes the start date but then the end date switches back to 'now' if I click on the start date.

    Am I using this in the proper format? As you can tell I'm a noobie so if you can point me in the right direction I would be greatful.

    Thanks,
    Brian
  • gordkgordk St.Catherines On. Canada.
    edited 11:45PM
    it works fine
    look where you wrote your code, you put it in the begin end. block of the code page
    this block is the first to be processed so edate is set before the activate event anwhen you click
    problem.set both dates in the onactivate event.
  • edited 11:45PM

    That worked perfectly, I'm beginning to see the light:)


    Thanks GordK.

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.