Having multiple instances of same DataModule, prints data from DM1 in the report of DM2

I have a DataModule for a CRUD of orders and items. This DM is used for the form (VCL) and for print some reports. The TfrxDataSet componentes are in this DM.


When I have the order's form openned showing data from Order 1 and create other instance of same DM do print a report for Order 2, the report show data of Order 1.


Before printing, I'm setting:

Report.EngineOptions.UseGlobalDataSetList := False;

Report.EnabledDataSets.Clear

Report.EnabledDataSets.Add(...datasets from the instance of DM created to print ...)


In the FR3 (XML), there is <item DataSet="dtmNotaVenda.fdsNotaVenda" DataSetName="fdsNotaVenda"/>, where "dtmNotaVenda" is the global var to the DM instance used at Order's form.

Comments

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.