How to select correct dataset with more forms

CHeCHe
edited 8:08PM in FastReport 4.0
Hello,

I'm having a hard time controling which frxDBDatset the report shall use.

My report inheriteds from as master-report, containing some application defaults informations
for the reports, such as companyname, time of printing, etc.

I am having a form used as a report-template-form (baseform) containing a frxReport on the form.

In a form, inherited from the report-template-form (reportform) I am adding a frxDBDataset
connected to a memory dataset (memdatset) containing the fields used for the report.
The memory dataset is filled dynamic with data before showing the report.
The form allso contains some edits for user input of values needed to generate the report data.

When I need a report containing all of my data, the memdataset is filled in one way.
If I want a periodical data report, the memdataset is filled in another way, containing
less data.

The two reports is contained within separated forms, created as MDI forms.

The EngineOptions.UseGlobalDatasetList = false, usning EnabledDatasets.Add(frxDBDataset1) before
loading the report from a file.

Heres what happens -
1. Runs the periodical report from the first form, the report shows only the periodical data, correct.
2. Runs the full data report from a second form, the report show all the data, correct.
3. Runs the periodical report again from the first form, now show all the data, fail!

4. Destroing the second form, an run the periodical report again from the first form show
only the periodical data, correct.

I can not figure out how the make this work correct.

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.