Help on creating simple TfrxDialogControl DB component

Hello,

I'm trying to create an simple DBText component.
I need this component to display dataset data when my user change item from a TfrxDBLookupComboBox.

I have attached my both unit to this topic.

My issue is that I'm not able to modify dataset and datafield properties when designing my report.
This looks trivial but I'm not able to do it easily !

Another solution is to implement a OnChangeKeyValue on the tFrxDBlookupCombobox ...

Can somebody helps me on this ?
Thank you

Comments

  • gpigpi
    edited 6:39AM
    See a Developer's manual "Writing Custom Report Components" chapter
    wrote:
    To create a component which displays data from a DB move the DataSet and DataField properties into the ???published??? section and then override the ???GetData??? method. Let's look at this by using the TfrxCheckBoxView standard component as an example.



    The ???TfrxCheckBoxView??? component can be connected to a DB field using the ???DataSet??? and ???DataField??? properties, which are declared in the TfrxView base class. This component also has the ???Expression??? property which can hold an expression. As soon as the expression has been calculated the result is placed in the ???Checked??? property. The component displays a cross when ???Checked??? is ???True.??? Below are the most important parts of the component???s definition.
  • edited 6:39AM
    gpi wrote: »
    See a Developer's manual "Writing Custom Report Components" chapter
    gpi wrote: »
    To create a component which displays data from a DB move the DataSet and DataField properties into the ???published??? section and then override the ???GetData??? method. Let's look at this by using the TfrxCheckBoxView standard component as an example.



    The ???TfrxCheckBoxView??? component can be connected to a DB field using the ???DataSet??? and ???DataField??? properties, which are declared in the TfrxView base class. This component also has the ???Expression??? property which can hold an expression. As soon as the expression has been calculated the result is placed in the ???Checked??? property. The component displays a cross when ???Checked??? is ???True.??? Below are the most important parts of the component???s definition.

    I'm creating a "Custom Common Controls" that can be placed on a FastReport design dialogue form. This component inherit from "TfrxDialogComponent???
    TfrxCheckBoxView component is a "Custom Report Components" that can be placed on a report design page !

    I don't want to be rude, but did you have a look to the attached file ?
      published
        property DataSet: TfrxDBDataset read FDataSet write SetDataSet;
        property DataField: String read GetDataField write SetDataField;
    

    Dataset and Datafield properties are already in the published section and I do not need to override the "GetData" method as this is not needed with "TfrxDialogComponent??? components (I helped myself borrowing the TfrxDBLookupComboBox structure)
    My problem is that FastReport Object inspector doesn't display any available dataset when I click on the "Dataset" field (and this obviously works with the TfrxDBLookupComboBox component...)

    Any help will be usefull
  • gpigpi
    edited 6:39AM
    wrote:
    I don't want to be rude, but did you have a look to the attached file ?
    No, as you can see
    wrote:
    Attached File frxAddDB.pas ( 2.42k ) Number of downloads: 0
    Attached File frxAddDBRTTI.pas ( 1.69k ) Number of downloads: 0
    See a wrapper's sample in the attach

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.