Dragging DBfield into designform

edited 12:09PM in FastReport 3.0
in designer, when I drag a DB field into the designer,
FR always creates a TfrxMemoView instance.

Is there a way to change this?
Depending on the field, I would like to create another class, in my case, some custom report component!

Thanks

Comments

  • edited 12:09PM
    waeberd wrote:
    in designer, when I drag a DB field into the designer,
    FR always creates a TfrxMemoView instance.

    Is there a way to change this?
    Depending on the field, I would like to create another class, in my case, some custom report component!

    Thanks
    Hi,

    I've investigated a bit further:

    drxDesgnWorkspace1.pas lines 275 ff.
    procedure TDesignerWorkspace.DragDrop(Source: TObject; X, Y: Integer);
        [...]
        if Page is TfrxDMPPage then
          m := TfrxDMPMemoView.Create(Page) else
          m := TfrxMemoView.Create(Page);
        [...]
    

    How about sending an event here for creating a TfrxMemoView-descendant class
    outside from this file? Would be very handy!

    Thanks,

    Daniel
  • gordkgordk St.Catherines On. Canada.
    edited 12:09PM
    drag and drop from data tab of data pane was designed for just that
    you have 2 option choices at the bottom of which you can select either or both.
    this pane is not used to add fields to existing memos, to do so select the memo
    rclck select edit then clck the expression builder btn in expr builder select data tab
    dblclick on field and select ok to leave expression builder, memo will then contain
    data field with correct brackets.
    ;)
  • edited October 2004
    gordk wrote:
    drag and drop from data tab of data pane was designed for just that
    you have 2 option choices at the bottom of which you can select either or both.
    this pane is not used to add fields to existing memos, to do so select the memo
    rclck select edit then clck the expression builder btn in expr builder select data tab
    dblclick on field and select ok to leave expression builder, memo will then contain
    data field with correct brackets.
    ;)
    Thanks Gordk,

    but my problem lies slightly elsewhere ;)

    I have descendants from TfrxMemoView that basically override the way the datafield is formatted.

    Example:
    For example I have a TfrxTimeView which takes the datafield - a time of the day stored as number of seconds - and I override the GetData procedure to convert the data from the field (number of seconds - integer) into a displayable string ('hh:mm').

    Now when I drag a database-field into the workspace, it would be nice to have a TfrxTimeView instance created, depending on the field-type....

    My workaround is to have several custom components (on the OTHERS-buttongroup on the left side). When I create such a component, it asks for a field reference in a custom editor.... Works fine but you need to know which custom component matches which fieldtype....

    The workaround runs fine, I just thought it might be easier to have some "component detection"-event while doing the drag/drop.

    Hope that's understandable ;)

    Thanks,

    Daniel
  • edited 12:09PM
    This is very specific request. If you have FR3 sources you can adapt them for your needs.
  • edited October 2004
    wrote:
    This is very specific request. If you have FR3 sources you can adapt them for your needs.
    Sure! Just wanted to find out if this could be handy for other users and if maybe some extension is planned ;)

    I will probably subclass the designer and add this functionality!

    Thanks,

    Daniel

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.