Dynamically create report
Hi
I am currently using ReportBuilder 6.02 Profressional with Delphi 6
Professional.
I need to develop a report manager for my current Interbase application. The
report manager has a couple of tasks:
1. To allow the user to print out system reports. System reports are reports
defined by the application and cannot be changed.
2. The create and maintain a list of user-defined reports. These reports in
general will be based on a list of pre-defined report types, eg Employee
Based reports, Client based reports etc. For example, when the user wishes
to create a report based on employee information, they would select the
Employee Based option and be presented with a list of fields from the
employee and employee related tables.
I had a quick (and I mean quick) look at the end user feature in RB Pro and
while, I ,as a programmer and someone familiar with report generation, be it
RB, QuickReports, Crystal, Access etc can easily grasps the concepts behind
building a report from scratch either using the query builder or available
pipelines, I personally feel I do not want to expose this development
environment to the user.
The way I was going to approach it was as follows:
Display a list of fields to the user.
Let the user select which fields he/she wants to display. The order of the
selection controls the order in which they appear.
Let the user chose say up to a maximum of three groups and the ability to
select summation, count, max, min,ave fields for these groups.
Let the user select a maximum of say 3 fields to order by
Let the user at any "where clauses".
Let the user chose basic page layout eg portrait, landscape, etc
From this, is it feasible to create the report and all report based options
from scratch including bands, groups, labels etc and then save the report to
file or DB for loading/displaying etc.
Or would it be better to have a couple of template reports (eg simple,master
detail etc) with say a maximum of ten tppDBText components and on load
simply hide/show the components as necessary.
Your thoughts and commensts are much appreciated.
Dominic
I am currently using ReportBuilder 6.02 Profressional with Delphi 6
Professional.
I need to develop a report manager for my current Interbase application. The
report manager has a couple of tasks:
1. To allow the user to print out system reports. System reports are reports
defined by the application and cannot be changed.
2. The create and maintain a list of user-defined reports. These reports in
general will be based on a list of pre-defined report types, eg Employee
Based reports, Client based reports etc. For example, when the user wishes
to create a report based on employee information, they would select the
Employee Based option and be presented with a list of fields from the
employee and employee related tables.
I had a quick (and I mean quick) look at the end user feature in RB Pro and
while, I ,as a programmer and someone familiar with report generation, be it
RB, QuickReports, Crystal, Access etc can easily grasps the concepts behind
building a report from scratch either using the query builder or available
pipelines, I personally feel I do not want to expose this development
environment to the user.
The way I was going to approach it was as follows:
Display a list of fields to the user.
Let the user select which fields he/she wants to display. The order of the
selection controls the order in which they appear.
Let the user chose say up to a maximum of three groups and the ability to
select summation, count, max, min,ave fields for these groups.
Let the user select a maximum of say 3 fields to order by
Let the user at any "where clauses".
Let the user chose basic page layout eg portrait, landscape, etc
From this, is it feasible to create the report and all report based options
from scratch including bands, groups, labels etc and then save the report to
file or DB for loading/displaying etc.
Or would it be better to have a couple of template reports (eg simple,master
detail etc) with say a maximum of ten tppDBText components and on load
simply hide/show the components as necessary.
Your thoughts and commensts are much appreciated.
Dominic
This discussion has been closed.
Comments
1. ReportBuilder has built-in Query Wizards and Report Wizards that
generate queries and report layouts. You can literally create a report in
seconds.
2. You can use the DataDictionary to predefine what tables are available to
end-users, define the join relationships between tables, and specify user
friendly table aliases and field aliases. See
RBuilder\Demos\EndUser\AutoJoin
3. You could simpify things further by creating a set of default reports
that serve as the starting point for any end-users. The default reports
could have the data predefined and optionally have the layout defined as
well.
4. You could optionally create your own wizards that dynamically generate
reports then bring up the designer.
ReportBuilder contains a very simple to use EndUser solution that solves
many of the issues encountered in building a an end-user solution. You can
however, "roll your own" so to speak.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks for your response.
After searching the newsgroup and downloading some sample code from the TIPS
section, I have decided that the "roll-out" of our own report engine wizard
will be the way to go.
In minutes, with the help of these code snippets, I was able to demonstrate
how easy it would be to dynamically generate a report fully equiped with
sorting, grouping and sub-totals (dbCalcs). I could then save this to an rtm
file format and load it back in, with the full layout of the report intact
and no need to re-generate the components again at run time.
This is essentially all that is required at the moment. Now "all" that is
left is to develop the front end wizard and db/report business rules.
Thanks again
Dominic