TeeChart "Single Record" choice in Dataset
Hi Anyone,
The dbChart in Report Builder's Report Designer has some options for the
data source; When I edit a dbChart (7.04) at design time using the built in
Chart Editor, there are many choices in the "Data Source" tab for the
series, as in:
Manual
Random
Function
Single Record
Summary
DataSet
CrossTab
Text File
XML File
Yet, when I create reports using the Report Designer user interface at
runtime, when you open the dbchart editor's Data Souirce property for a
dbchart, you only see these choices:
Manual
Random
Function
Data Pipeline
To get the extra options in a Delphi 7 Pro application, you have to add this
to the uses clause in the unit:
Uses DBEditCh; { to show Database DBChart editor dialogs }
How do I add that to the dbChart's Data Source in Report Builder so that I
get those options when the user edits a dbchart in the report designer at
runtime? I really need the "Single Record" option because that seems to be
the only one that will permit you to add slices to a pie chart consisting of
different fields from the same record..
Thank you. Your help is greatly appreciated.
The dbChart in Report Builder's Report Designer has some options for the
data source; When I edit a dbChart (7.04) at design time using the built in
Chart Editor, there are many choices in the "Data Source" tab for the
series, as in:
Manual
Random
Function
Single Record
Summary
DataSet
CrossTab
Text File
XML File
Yet, when I create reports using the Report Designer user interface at
runtime, when you open the dbchart editor's Data Souirce property for a
dbchart, you only see these choices:
Manual
Random
Function
Data Pipeline
To get the extra options in a Delphi 7 Pro application, you have to add this
to the uses clause in the unit:
Uses DBEditCh; { to show Database DBChart editor dialogs }
How do I add that to the dbChart's Data Source in Report Builder so that I
get those options when the user edits a dbchart in the report designer at
runtime? I really need the "Single Record" option because that seems to be
the only one that will permit you to add slices to a pie chart consisting of
different fields from the same record..
Thank you. Your help is greatly appreciated.
This discussion has been closed.
Comments
The TeeChart component in RB is simply a wrapper around an ordinary TeeChart
object. You will need to add the proper TeeChart references to your uses
clause to enable certain features at runtime.
The best way to find out which Steema units you need to add to the uses
clause of your application to enable certain features at runtime is to
create a sample TeeChart on a form at design time and see what units are
automatically added. For instance, for a lot of the function values to be
available, you will need to add TeeFunci to the uses clause. You might also
check the TeeChart help for more information.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Sorry, though adding the proper unit to the uses clause may expose this type
of datasource, it will probably not function correctly with ReportBuilder.
RB is meant to be used with the DataPipeline option. You will need to use
the datapipeline settings to retrieve a single record from the dataset and
use it with a TeeChart.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
This is bad news. That does not work. Even if you have only one record
(which I can do using SQL tables and linking), you still can't add multiple
fields from the record to one pie chart.
The only way the end-user can create a pie chart with multiple series in
it from the same record is by using the "Single Record" option in the data
source on the Tee Chart. (which is not there).
You see, when you select the "Single Record" option in the Data Source tab
for a pie chart, a panel appears where can pick multiple fields to display
in the pie. Without the "Single Record" option, that panel never appears, so
you can't pick multiple fields for that pie chart series..
For example, I have an application which is a diet planner. The food items
contain various nutrients, including protein, fat and carbs. Each food item
has protein, fat and carbs. The end user wants to add a pie chart to the
report that displays the protein, fat and carbs per food. How do you do it?
I've spent hours trying to get something that will work, but no luck. Tee
Chart just doesn't talk to RAP (or does it?).
There must be a lot of applications out there that have this need for the
pie chart series to display multiple fields per record.
Can't you build in another pipeline and call it "SingleRecPipeline" and
make it work with the pie chart series?
How can I get this working?
Thanks for your time.
Sorry, I initially did not understand your requirements.
Unfortunately this is not possible with the current TeeChart wrapper built
into ReportBuilder. One option (which is used by many of our other
customers) is to create the TeeChart on a form as you need it to look and
display it inside the report as an image object. This is easily done using
the Chart.Draw routine.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thank you for your response.
I do not understand what you are saying. Are you saying that I can create
a RAP event, declare a teechart, add series to a pie chart in there and then
copy it's bitmap to an image which I put on the report detail line? I've
tried adding a series to a pie chart from a RAP event (onPrint.. etc) and it
doesn't recognize the "series" term. For example, if I try this it won't
compile:
TeeChart3.series.add('one', 1);
Do you have an example? Any documentation or help on how to do that?
Note: The whole point of this exercise is to be able to have the end-user
to be able to add multiple series from a single record's fields to a pie
chart at run time. If I have to code something that can't be distributed in
the report (like Rap can), then I might as well just create the report
myself and include it in the executable (which is not what I want to do).
Another point: why, when you add several series to a bar chart using the
pipeline, it adds the bars to the same chart? Why can't the pie chart work
like that? I think that is more the norm than the current way the pie chart
functions...
Thanks.
pl
Unfortunately I do not believe this can be done solely in RAP. You will
need to create a pass-thru function to dynamically create and export the
TeeChart to the Report.
Adding the SingleRecord capibility to the RB TeeChart wrapper would be a
nice feature. Thank you for the feedback, we will consider it for a later
release of ReportBuilder.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Yes, it would be a very nice feature to have. I'm surprised that nobody
has asked for this before.
Thank you for all your help and consideration.
pl
I was wondering if this feature made it into any current release.
Thanks.
pl
One option would be to use a JITPipeline to traverse a single record in a
dataset, and connect that to the TeeChart. I believe this would give the
same effect as the SingleRecord feature in TeeChart.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com