Mask in TfrEditControl

produsysprodusys Brazil
edited 12:06AM in FastReport 2.xx VCL
Hi,
I'm want to put a Date Mask into a TfrEditControl on Dialog! But I don't know how make this!! Somebody help me!! Please!!

Ps.: Sorry for my poor english! ;)

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:06AM
    why not use the dateedit control
    ;)
  • produsysprodusys Brazil
    edited January 2005
    This don't work for me!!
    I'm want to make this for a Select in query where the date is greater than Edit2.Text and minor than Edit3.Text. Do you understand??
    See my example code:
     Query1.SQL.Clear;
      Query1.SQL.Add('Select * from BUY');
      Query1.SQL.Add('where buy_code = '+Trim(Edit1.Text));
      // Here I have a if for check blank Edit2
      Query1.SQL.Add('and buy_date >= '''+Trim(Edit2.Text)+'''');
      // Here I have a if for check blank Edit3
      Query1.SQL.Add('and buy_date <= '''+Trim(Edit3.Text)+'''');
      Query1.Open;
    
    It's for that I need the date mask, because if the user not type the date separator "/" or ".", mine Select returns null and the report... blank!
    if my user not type anything, my Select will return all date. Understand??
  • gordkgordk St.Catherines On. Canada.
    edited 12:06AM
    so use 2 date edits parameterize your query and point the params
    to dateedit.text then all your user has to do is pick the date, you can initialize the date value in the onactivate event of the dialog if you want to supply a default date.
    ;)
  • produsysprodusys Brazil
    edited 12:06AM
    gordk wrote:
    so use 2 date edits parameterize your query and point the params
    to dateedit.text then all your user has to do is pick the date, you can initialize the date value in the onactivate event of the dialog if you want to supply a default date.
    ;)
    How make the DateEdit be blank?? My Select may be affected if the DateEdit is filled with Default Date??
  • gordkgordk St.Catherines On. Canada.
    edited 12:06AM
    the initial value of a dateedit is empty, it just shows 2 separators.
    typical query sql statement
    SELECT DISTINCT OrderNo, ShipDate, Subtot, GstTotal, PstTotal, InvTotal, Posted
    FROM "orders.DB"
    WHERE
    (ShipDate >=:from)
    AND (ShipDate <=:to)
    AND (Posted = 'TRUE')
    ORDER BY OrderNo, ShipDate, Subtot, GstTotal, PstTotal, InvTotal, Posted

    from and to are parameters
    in designer select query in obj inspector select params
    in params editor left pane select the parameter in the datatype select date
    select value add dateedit1.text. repeat for next param using dateedit2.text.
    you can also parameterize your other selection criteria the same way.
    ;)
  • produsysprodusys Brazil
    edited 12:06AM
    Thank You gordk, I'll test the DateEdit.
  • produsysprodusys Brazil
    edited 12:06AM
    In my Fast Report the DateEdit is showing with the Actual Date, It cannot be set blank! How I make it?

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.