restricting dataset visible from designer

Hi,
When end user is designing a report, he's able to choose any dataset from open forms or datamodulesapplication to insert a fields. I would like to restrict his visibility to pre-defined set of dataset.
Any idea ?
thanks

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:14AM
    hi
    read faq.txt
    or see notes in unit1.pas of fr\demos\reports
    regards ;)
  • edited 3:14AM
    well, it's a way to restrict the dataset list ...
    but my application is mdi designed and if the user access to the report designer with many mdi form childs currently opened, the dataset list to exclude can be very long ...
    Actually, my application comprise a report module based on SQL builder, data grid and chart viewers and so ... but lacks a true report engine and I like to give to end users the possibility to personalize the output representation based on dataset allready built.
    So is it possible for fastreport team to implement a callback dataset list provider (OnGetDatasetList) witch return for example an array of dataset ? That what I will try to do because I don't see another way ...
    regards
  • edited 3:14AM
    Hi mbana,

    I have had nearly the same problem...
    one very quick'n dirty method is the one below:

    ---
    procedure ExcludeFormDatasets(aForm : TForm; aReport : TfrReport);

    var i : integer;
    s : string;

    begin
    aReport.Dictionary.DisabledDatasets.
    for i := 0 to aForm.ComponentCount - 1 do begin
    if aForm.Components is TMySqlQuery then begin
    // ^^^
    // depends on your database
    s := aForm.name + aForm.Components.Name;

    ...
    ...

    aReport .Dictionary.DisabledDatasets.Add(s);
    end;
    end;
    end;


    ---
    look inside the frClass.pas > i did not see any routine to plonk a whole form

    involved routines:

    fr_class
    ============
    function TfrDataDictionary.DatasetEnabled(DatasetName: string): Boolean;
    procedure TfrDataDictionary.GetDatasetList(List: Tstrings);


    fr_utils
    ============
    procedure frGetComponents(Owner: TComponent; ClassRef: TClass; List: trings; Skip: TComponent);

    as you can see in the last procedure the report browses through all forms in the app
    and collects all datasets ..


    regards,

    peter
  • edited 3:14AM
    I have this same problem, but I cannot use an exclusion list as a solution, since the dataset names on the different forms might be the same.

    For example, in my MDI application, someone might have 2 different sales invoices, and a purchase order open. I don't want the data getting mixed between reports.

    Is it not possible to say "only use datasets from the same form the frxReport is on"?

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.