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
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
read faq.txt
or see notes in unit1.pas of fr\demos\reports
regards
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
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
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"?