Determing Data Fields in Report
(D6, RB 6.03 Enterprise. Have RB7 but not installed yet)
I allow users to create ad-hoc queries. They can then call the Designer, and
either load a saved report (created using that query), or create a new
report using the Report Wizard. All this works just fine, but there are some
minor problems.
If the user creates a report, exits from the Designer without closing the
report, changes the ad-hoc query to remove some fields already used in the
Designer, then re-enters the Designer, some of the fields will no longer be
available.
Also if the user loads a saved report, with different data fields from those
present in the current ad hoc query, some of these fields will no longer be
available.
Is there a way of determining what data fields are present in the report
currently open in the Designer, or in a report which you want to load,
ideally prior to actually loading it ?
Many Thanks
Terence Schoenherr
I allow users to create ad-hoc queries. They can then call the Designer, and
either load a saved report (created using that query), or create a new
report using the Report Wizard. All this works just fine, but there are some
minor problems.
If the user creates a report, exits from the Designer without closing the
report, changes the ad-hoc query to remove some fields already used in the
Designer, then re-enters the Designer, some of the fields will no longer be
available.
Also if the user loads a saved report, with different data fields from those
present in the current ad hoc query, some of these fields will no longer be
available.
Is there a way of determining what data fields are present in the report
currently open in the Designer, or in a report which you want to load,
ideally prior to actually loading it ?
Many Thanks
Terence Schoenherr
This discussion has been closed.
Comments
its available fields. Find the FieldAlias for those fields and print them
in a dialog. Sure, sounds doable. Here is an example which shows how to load
a binary template via a stream to acii text instead of actually
instantiating the template objects unneccessarily.
http://www.digital-metaphors.com/tips/ConvertBinaryTemplateToASCII.zip
Otherwise, you cold load the template to a report that isn't connected to
the designer. THen you could extract hte TdaSQL object and loop through it s
available fields to get the field aliases for the user. Then youcan close
the temporary report and continue loading the template conditionally if the
user doesn't want to load the template.
http://www.digital-metaphors.com/tips/ExtractSQLObject.zip
Another idea is that you could break the datamodule (dtm) out, just like an
rtm. The dtm can be loaded dynamically. Let's say the user is about to load
a template that doesn't have the field that they want. Instead of forcing
them to go into the query designer to add a couple of fields, you could let
them pick a datamodule that they know has the field to quickly allow them to
get the data access that they want to have. Here is an example of swapping
the datamodule in code.
http://www.digital-metaphors.com/tips/ReplaceDataModule.zip
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
save/load/merge the datamodules from the report explorer as an item, just
like a report template.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com