Please help me,a very difficulty problem !!

edited 11:47AM in FastReport 3.0

hello everyone.
i'm from china P.R.
my english is very pool.

I have edit the frxDCtrl.pas , on it I have add some components (TfrxRadioGroupControl , TfrxDBGridControl)
and edit below
frxObjects.RegisterObject1(TfrxDateEditControl, nil, '', '', 0, 20); //add by hz
frxObjects.RegisterObject1(TfrxImageControl, nil, '', '', 0, 3); //add by hz
frxObjects.RegisterObject1(TfrxBevelControl, nil, '', '', 0, 33); //add by hz
frxObjects.RegisterObject1(TfrxBitBtnControl, nil, '', '', 0, 45); //add by hz
frxObjects.RegisterObject1(TfrxSpeedButtonControl, nil, '', '', 0, 46); //add by hz
frxObjects.RegisterObject1(TfrxMaskEditControl, nil, '', '', 0, 47); //add by hz
frxObjects.RegisterObject1(TfrxCheckListBoxControl, nil, '', '', 0, 48); //add by hz
frxObjects.RegisterObject1(TfrxRadioGroupControl, nil, '', '', 0, 49); //add by hz
frxObjects.RegisterObject1(TfrxDBGridControl, nil, '', '', 0, 50); //add by hz

so , i edit the form frxDesgn and edit the ObjectsTB1's with ,then these components work OK,
but now I went to add TDataSource as TfrxTDataSourceControl ,there some difficulty for me, can someone help to write this code for me?
Thanks!

hz
from 上海

Comments

  • edited 11:47AM
    Why do you need to add TDataSource?
  • edited 11:47AM
    Because I went use the DBGrid-->"TfrxDBGridControl" on the Dialogform ,So It's coincidence the habit of chinese people.

    query -->dbgrid--->"look the result"-->Preview--->print
  • edited 11:47AM
    You should create internal TDataSource component for your dbgrid.
    Example:

    type
    TfrxDBGridControl = class(TfrxDialogControl)
    private
    FDBGrid: TDBGrid;
    FDataSource: TDataSource;
    FDataSet: TfrxDBDataSet;
    procedure SetDataSet(const Value: TfrxDBDataSet);
    public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    published
    property DataSet: TfrxDBDataSet read FDataSet write SetDataSet;
    end;

    constructor TfrxDBGridControl.Create(AOwner: TComponent);
    begin
    inherited;
    FDBGrid := TDBGrid.Create(nil);
    InitControl(FDBGrid);

    FDataSource := TDataSource.Create(nil);
    FDBGrid.DataSource := FDataSource;
    Width := 185;
    Height := 105;
    end;

    destructor TfrxDBGridControl.Destroy;
    begin
    FDataSource.Free;
    inherited;
    end;

    procedure TfrxDBGridControl.SetDataSet(const Value: TfrxDBDataSet);
    begin
    FDataSet := Value;
    if Value <> nil then
    FDataSource.DataSet := Value.GetDataset;
    end;

  • edited 11:47AM
    Thank's AlexTZ

    tell you a good tidings
    Our company decide buy the "FastReport 3 Enterprise Edition"
    next week our manager will look The Demo of "FastReport 3.14 Enterprise Edition"

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.