Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

DBTeechart and D7

edited March 2004 in General
Ok, I just found that I cannot use a dataset oriented TChart in RB 7.03 with
Delphi 7 and bundled Teechart components.

Can someone tell me why there is such limitation ? Even Quick(argh!)Report
allows that :-(

Thanks.

Comments

  • edited March 2004
    Carlos,

    TeeChart 4.04 is fully operational with ReportBuilder 7.03 at runtime. The
    only limitations are at Delphi design time. If you would like a fully
    operational version at design time, you will need to purchase a registered
    version of TeeChart from http://www.teemach.com.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    Thanks Nico. I'm curious about the technical reason of this design time
    limitation. Can you explain that to me?

    Actually it imposes that I cannot create any TDBChart with RB in design time
    so, at last for me, its a major limitation since my customer dont want to
    register Teechart Pro, but want to get graphics in pre-compiled reports :-(

    Carlos

  • edited March 2004
    Hi Carlos,

    The reason for the limitation is complicated. Since Steema does not ship
    the source with version 4.04, we are unable to find the source of the
    problem. The TeeChart ReportBuilder code has not changed so either changes
    were made to TeeChart or there were limiting changes made in Delphi. You
    could perhaps create the charts outside the report, export them to an image
    or metafile and then load them into a TppImage component on a report. The
    easiest way of course would be to convince your customer to buy a registered
    version of TeeChart 6.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    hey carlos,

    I have the same issue, so what I did was have a method on my form that
    builds the graph for me.

    You do not need to connect to a dataset, you can manually send the data to
    the graph.

    This is the code that I used for one of my graphs.

    procedure TdmSectorTables.MakeSectorGraph;
    var
    lMin, lMax, lScore: integer;
    begin
    chrtSectors.Top := subSectorAverage.Top + 64;
    lMin := 0;
    lMax := 0;
    lScore := 0;
    chrtSectors.Chart[0].Clear;
    (chrtSectors.Chart[0] as THorizBarSeries).CustomBarHeight := 10;
    chrtSectors.Chart.LeftAxis.Inverted := true;
    plSectorAverage.First;
    while not plSectorAverage.EOF do
    begin
    lScore := plSectorAverage.FieldValues['avg_score'];
    if lScore < 0 then
    begin
    (chrtSectors.Chart[0] as THorizBarSeries).AddBar(lScore, '', clRed);
    if lScore < lMin then
    lMin := lScore;
    end
    else
    begin
    (chrtSectors.Chart[0] as THorizBarSeries).AddBar(lScore, '', clBlack);
    if lScore > lMax then
    lMax := lScore;
    end;
    plSectorAverage.Next;
    end;
    chrtSectors.Chart.BottomAxis.Labels := false;
    chrtSectors.Chart.TopAxis.Automatic := false;
    chrtSectors.Chart.TopAxis.Maximum := lMax + (lMax * 20 / 100);
    chrtSectors.Chart.TopAxis.Minimum := lMin + (lMin * 20 / 100);
    end;

    I do use teechart 6, so you might have to change this code. Also this is for
    a Horizontal Bar series.

    Basically, just put a regular chart(not dbchart) on the report, and then you
    will be able to access it in the form.
    All you really need to use is the AddBar method (There are many of these Add
    methods depending on what you cast the series as).

    if you need any other help, maybe I can.

    Cheers
    Shaine Gordon


  • edited March 2004
    Thanks, I was just trying to avoid the extra-work ;)

    Anyway, I convinced my customer to buy TeeChart Pro.

    Thanks anyway!


This discussion has been closed.