Summaries in TeeChart
Hi,
I have data coming from something like
SELECT X, Y ...
I need to draw a line representing
SELECT X, SUM(Y) ... GROUP BY X
I cannot simply add SUM in my SQL.
Really, X and Y are calculated fields, not a part of SQL.
The calculation formula is complex enough and cannot be placed in SQL.
If I put TDBChart on my form, I have an option "Summary" for Series. It does the thing I wish.
I searched Digital Metaphors archives, and I found a message stating that this feature is not available in RBuilder wrapper.
However, the message is rather old.
So, my first question - is it true also for the latest version?
Well, in assumption that I should prepare data myself, I started to search the simplest way to get summaries.
The simplest seems to be TAggregateField.
But TAggregateField values are not available in pipelines.
Therefore, the second question - can I obtain TAggregateField values in a pipeline?
Currently, I write a special procedure for every case of this sort pumping the aggregate data in a special ClientDataSet.
But it should be nice to have a simpler solution.
Thank you,
Mahris
I have data coming from something like
SELECT X, Y ...
I need to draw a line representing
SELECT X, SUM(Y) ... GROUP BY X
I cannot simply add SUM in my SQL.
Really, X and Y are calculated fields, not a part of SQL.
The calculation formula is complex enough and cannot be placed in SQL.
If I put TDBChart on my form, I have an option "Summary" for Series. It does the thing I wish.
I searched Digital Metaphors archives, and I found a message stating that this feature is not available in RBuilder wrapper.
However, the message is rather old.
So, my first question - is it true also for the latest version?
Well, in assumption that I should prepare data myself, I started to search the simplest way to get summaries.
The simplest seems to be TAggregateField.
But TAggregateField values are not available in pipelines.
Therefore, the second question - can I obtain TAggregateField values in a pipeline?
Currently, I write a special procedure for every case of this sort pumping the aggregate data in a special ClientDataSet.
But it should be nice to have a simpler solution.
Thank you,
Mahris
This discussion has been closed.
Comments
When using a DBChart with ReportBuilder, the data needs to be retrieved from
a pipeline. This is the reason that the summary option is not available for
charts created in ReportBuilder. There are however options to work around
this.
1. Create the chart in Delphi and simply show the chart as an image in the
report using a TppImage component.
var
lMetaFile: TMetaFile;
lRect: TRect;
begin
lRect.Left := 0;
lRect.Top := 0;
lRect.Right := ppImage1.spWidth;
lRect.Bottom := ppImage1.spHeight;
lMetaFile := Chart1.TeeCreateMetafile(True, lRect);
ppImage1.Picture.Metafile.Assign(lMetaFile);
2. Use a JITPipeline to manually access the client dataset and its
aggregate fields so the TeeChart in RB then has access to them.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com