DADE Questions - Please Help
Hi,
Delphi 6, RB 7.02 Ent.
I am sure this has been asked 100 times, but I cant seem to find the correct
answer(s).
I am new to Report Builder, and I am having some problems.
Let me explain what I want from the product.
I want to design a End-User reporting tool, that connects to my MS SQL
database via ADO.
I plan on using this tool myself to provide all reports for my clients, and
creating a report viewer exe that launches the reports after they have been
designed.
My questions are as follows.
1. I have a base architecture that I use for all my forms etc, I want to
create the designer using this but am having some problems.
1a. It wont default connect to the TADOConnection that is in a
DataModule, I have to put a TADOConnection on the Form and then set its
connectionString = DM.ConnectionString in order for it to work, I would
prefer to have just the 1 ADOConnection in my project.
1b. I want the Designer to be the form that is shown on Start up, how
can I make a form that does this?
2. I want users to be able to create parameters that are requested before
the report is run. How can I do this from a End User situation? Do I have to
develop this myself? and If so what is the best way of using these
parameters?
3. Report To Template (.rtm) etc. I am having a problem with this, I want to
launch the designer and when the User clicks Save or Save as bring up the
SaveDialog and let them save, nothing happens. If I enable save to template
I get errors about missing files. This is before the report is created etc.
I would really appreciate any advise anyone has on this as I am a bit lost.
Daniel
Delphi 6, RB 7.02 Ent.
I am sure this has been asked 100 times, but I cant seem to find the correct
answer(s).
I am new to Report Builder, and I am having some problems.
Let me explain what I want from the product.
I want to design a End-User reporting tool, that connects to my MS SQL
database via ADO.
I plan on using this tool myself to provide all reports for my clients, and
creating a report viewer exe that launches the reports after they have been
designed.
My questions are as follows.
1. I have a base architecture that I use for all my forms etc, I want to
create the designer using this but am having some problems.
1a. It wont default connect to the TADOConnection that is in a
DataModule, I have to put a TADOConnection on the Form and then set its
connectionString = DM.ConnectionString in order for it to work, I would
prefer to have just the 1 ADOConnection in my project.
1b. I want the Designer to be the form that is shown on Start up, how
can I make a form that does this?
2. I want users to be able to create parameters that are requested before
the report is run. How can I do this from a End User situation? Do I have to
develop this myself? and If so what is the best way of using these
parameters?
3. Report To Template (.rtm) etc. I am having a problem with this, I want to
launch the designer and when the User clicks Save or Save as bring up the
SaveDialog and let them save, nothing happens. If I enable save to template
I get errors about missing files. This is before the report is created etc.
I would really appreciate any advise anyone has on this as I am a bit lost.
Daniel
This discussion has been closed.
Comments
create reports that will be run on your client's machines. Use DADE to
define the data access. There is a SQL Server ADO demo in the
RBuilder\Demos\End User Database\ folder of the installation which is a
place to start if you have't seen this demo before.
1. DADE should be able to see the ADOConnection that you have in your
project. Is this created at Delphi design time? If it is at runtime, then
make sure that the ADOConnection is owned by the datamodule. RB uses the
Screen.DataModules and Screen.Forms array properties to find the
ADOConnection by name when loading a template, so the owner has to be set
when you create the connection at runtime to be able to be visible in these
arrays. I just ran the SQL Server demo using ADO with the ADOConnection on a
different TDatamodule in the project and it found it. Make sure you connect
the Designer.Datasettings to the ADOConnection as well. Set
Designer.AllowDataSettingsChange = true to check the datasettings at runtime
in DADE before you create any dataviews.
2. The easiest way to have ask at runtime parameters is to use DADE. You
create search criteria in DADE dataviews and then check the Autosearch
checkbox to make them autosearch fields. Then RB automatically creates
autosearch fields at runtime to be used in the autosearch dialog. When you
do this in DADE, it is all automatic and pain free. All you have to do is
set Report.ShowAutosearchDialog to true and when the report runs it should
show the autosearch dialog and you can filter the report by simply typing in
what you want to see in the report. There are autosearch demos in the
standard end user database (Report Exporer) demo. They are already in the
paradox tables we provide in the installation for these demos.
3. Report.SaveAsTemplate is a property that you should set to false when
trying to get things working initially. See the help file on this property.
It is definign wether the report you have currently in the designer will be
saved to the report object on the form or a report template (file or
database). Do you want to have only file based templates or also have
database templates? To create a file template, simply save the report to
file as you have described it should work. Make sure that you set the
Designer.AllowSaveToFile to true. The saving to file should be automatic. I
created a simple TppDesigner and a TppReport: Save and SaveAs work fine when
saving to file. If you would like, feel free to send me a simple example
project that has the error and I'll take a look at it. Send all attachements
to support@digital-metaphors.com
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
from other companies you get.
1. I fixed this after sorting out the ConnectionName just required
MainConnection not ConnectionDM.MainConnection.
Any thoughs on 1b? I what to be able to provide my standard login screen etc
to the users and when successful launch the Designer, but right now I am
having to have a form in the middle to do this. Any thoughts?
2. Although this does provide a method that can be used, I would like to
provide an easier to use method for the End user. I am also concerned that
when the report is run it will retrieve ALL data until the AutoSearch fields
have been filtered. Is this accurate?
My thoughts are giving them a screen BEFORE the report is run that fills the
AutoSearch fields? what are your thoughts, any examples would be greatly
appreciated.
3. I have working thanks.
Daniel
1. This problem is still here even though the TADOConnection is on the
TDatamodule at design time not runtime,
an app, use an invisible main form and a timer to show the designer in a
timer event handler. See the main report explorer demo for the technique. It
shows the report explorer as the first form.
2. No, you can set the search criteria value that will be used when
constructing the query in DADE. Then when the autosearch dialog is shown,
it should show this as the default value to search on. You can use this to
make sure the dataset is initially small.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
this, there is special code which tries to find out if there are any
autosearch criteria defined in the persistent dataviews. If there is, the
autosearch field object get created. The TppAutosearchField objects are not
persistent and are always created at runtime. The autosearch criteria are
defined on a dataview and are persistent. At runtime, if you have autosearch
criteria, then autosearch fields get created and you can reference them and
use them from a custom autosearch dialog. The autosearch fields are how DADE
knows what the user entered into the autosearch dialog. The End User Search
Criteria demo in teh main autosearhc demos. It uses DADE, but there are
autosearch fields which are used to set the value. This is what you can do
in code if because these values set on the autosearch fields are transferred
to DADE when the SQL goes to generate for a given dataview which has
autosearch criteria defined in it. The plus is that you can access the
Report.Autosearchfields array property at runtime as shown in the demo.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Your help is very appreciated
--
Serge Dosyukov
Borland Delphi 6 product certified
MCP
"Programming is not a job; it is a style of life."