TeeChart in Subreport
Hi,
I just purchased ReportBuilder 7 together with the newest TeeChart 7 and
I am very pleased with it! I read allready alot of the manual an the
posts in the your newsgroups. But right now I am stuck with the one
problem, which I would like to ask to the newsgroup.
I have a complex nested report. I have several nested subreports. And
some of them have data-aware TeeCharts components. I am facing some
strange behaviours with the data-series in the charts.
For me, the Chart is something similar like a subreport. It is based on
his own pipeline, which in turn is up-linked to the pipeline of the
subreport where the chart is placed in.
Sometimes I get no data, some charts have kind of doubled data, or not
even show up. I am really confused.
My question: Are there some basic precautions when using charts in
subreports? Do I have to manually reload (or similar actions) the
datapipeline for each chart?
Thanks for any help!
Andreas Brodbeck
I just purchased ReportBuilder 7 together with the newest TeeChart 7 and
I am very pleased with it! I read allready alot of the manual an the
posts in the your newsgroups. But right now I am stuck with the one
problem, which I would like to ask to the newsgroup.
I have a complex nested report. I have several nested subreports. And
some of them have data-aware TeeCharts components. I am facing some
strange behaviours with the data-series in the charts.
For me, the Chart is something similar like a subreport. It is based on
his own pipeline, which in turn is up-linked to the pipeline of the
subreport where the chart is placed in.
Sometimes I get no data, some charts have kind of doubled data, or not
even show up. I am really confused.
My question: Are there some basic precautions when using charts in
subreports? Do I have to manually reload (or similar actions) the
datapipeline for each chart?
Thanks for any help!
Andreas Brodbeck
This discussion has been closed.
Comments
My first guess is that perhaps the data is not linked correctly. Try
building the report incrementally. First create a simple report that
traverses the master datapipeline. Next add a subreport that traverse the
detail datapipeline. Then add a DBChart and connect the data-aware series to
the subdetail datapipeline, etc. Preview at each step to check the results.
Each time a childreport generates it will traverse the datapipeline to which
it is attached. Each time a DBChart prints on a page, it the data-aware
chart series will traverse the datapipeline to which it is attached.
By default master records that do not contain any detail records will be
skipped. To include them, set the detail datapipeline.SkipWhenNoRecords
property to False.
Below is an article on linking queries.
------------------------------------------------------
Tech Tip: Linking SQL Queries for Master/Detail Data
------------------------------------------------------
The following example shows two options for linking SQL queries to create a
master/detail relationship.
In this example, we are using Delphi's DBDemos data to create a
Customer/Order relationship. Thus we wish to link the Orders detail to the
Customer master.
I. Delphi Query Linking
------------------------
a. Set the detail TQuery.DataSource property to point to the master
query's TDataSource component.
b. In the SQL "Where" clause for the detail query use a ':' followed by
the linking field name from the master:
example
select *
from orders
where orders.CustNo = :CustNo
Now each time the master record position changes, the detail query will
automatically be refreshed with the correct result set.
II. RB DataPipeline Linking
-----------------------------
a. Set the detail DataPipeline.MasterDataPipeline to point to the master
DataPipeline.
b. Use the detail DataPipeline.MasterFieldLinks property to define the
linking relationship
c. In the SQL for the detail, retrieve all records and sort them by the
linking master field:
select *
from Orders
order by CustNo
Notes:
1. Using RB DataPipeline, each query is executed only a single time - thus
performance is much faster.
2. RB Professional and Enterprise Editions include a visual Data environment
for creating SQL queries, defining linking relationships, and creating
Ask-At-Runtime parameters. Using the RB tools you could create the above
linked queries in about 10 seconds.
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com