Report designer leaves linked datasets active
Just a little niggle....
I find that the report designer causes permanent changes to the active
property of datasets in a separate datamodule.
I have a report with two TppDBPipeLine linked via datasource to two
underlying query components in a separate datamodule. Whenever I do any
layout changes to the the report in the designer it would seem that
something sneaks off and sets the dataset's Active property TRUE, and leaves
them that way.
Why is this a niggle? My application starts with no database connection, so
trying to load the datamodule with active dataset causes an error. Solution:
go back, edit the datamodule to close the dataset, recompile and try again.
Everytime I edit my report I have to revisit the datamodule before
compiling.
I understand that the report designer needs to open the datasets to show
data etc. But why is this made as a permanent change to the datamodule?? I
am using The DiamondADO suit of data access components so perhaps there is
some problem interacting with their Tdataset descendants.
It would be so nice to edit the report without having collateral changes in
the datamodule.
Sarah
I find that the report designer causes permanent changes to the active
property of datasets in a separate datamodule.
I have a report with two TppDBPipeLine linked via datasource to two
underlying query components in a separate datamodule. Whenever I do any
layout changes to the the report in the designer it would seem that
something sneaks off and sets the dataset's Active property TRUE, and leaves
them that way.
Why is this a niggle? My application starts with no database connection, so
trying to load the datamodule with active dataset causes an error. Solution:
go back, edit the datamodule to close the dataset, recompile and try again.
Everytime I edit my report I have to revisit the datamodule before
compiling.
I understand that the report designer needs to open the datasets to show
data etc. But why is this made as a permanent change to the datamodule?? I
am using The DiamondADO suit of data access components so perhaps there is
some problem interacting with their Tdataset descendants.
It would be so nice to edit the report without having collateral changes in
the datamodule.
Sarah
This discussion has been closed.
Comments
with ADOQueries, they reset their Active property to false when their
associated connection was removed. You can try adding an initialization
section to the data module where you check if the data sets are active and,
if they are, close them.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
does this help? Datasets with no connection property are pretty useless!!
Why is RB designer permanently altering the dataset's and leaving them open
in the first place? Surely this is a bug??
I will try the idea of looping through all datasets in the Datamodule and
closing them in an initialization section. But it does seem a rather odd
approach: design a datamodule with all datasets closed, edit a report and
then have to have code to check the datasets are closed in case the report
designer has opened them.
Should RB be openning things and leaving them??
Sarah
"Alexander Kramnik (Digital Metaphors)" wrote
open
that's NOT a ReportBuilder bug, nor a bug at all. That's simply the
behaviour of the dataset components you are using.
The problem is your DataSet component, storing the 'Active' property is poor
design (create descendants and override it).
When any Delphi AddOn needs a opened table during design time, it has three
options (...) - opening them when needed ist the best one.
But the problem is the closing, the AddOn normally doesn't know if it is the
right time to close, or knows when it should close them, but isn't activated
at that point by Delphi.
Once again, the dataset component should handle it, not RB.
jm2c,
Chris Ueberall;
any other AddOn, but I take your point.
The active property is one of those things that gets stored which it would
be better if it weren't. Got it! I just had not realised that something
would come along and change the stored value when the datamodule was not
open in the IDE. I'm wiser now )
Sarah