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

Problem with Charts; Converting form Qick Reports

edited July 2002 in General
I am trying to add a pie chart to a RB report and I cannot make it work. I
am converting a report from QR to RB and it seems that the tChart compnent
works a little different. I am using the non data aware chart component and
fill in the values programatically.

I added the chart component to the report and edited the properties.
I then added a pie chart series, Series. I usually get a new object
(Series1) of type tSeries in QR but I do not in RB.
I figured out that I can still access the Series properties like this:
MyChart.Chart.Series[0].Add but it does not have an AddPie method. It seems
that the Add method does not work because the pie is blank in the report.
There are labels and a legend but no pie. I looked in the developer's manual
but I see very little mentioned about pie charts.

Any help would be greatly appreciated,

J. Michael Eubanks
Ideal Software Systems, Inc.

Comments

  • edited July 2002
    The RB Teechart wrapper class provides access to the chart object via its
    Chart property. The series is hidden from being accessed in the form since
    the form doesn't own it directly as in previous versions of RB or like in
    QR. This was done in order to support D6 and keep the object tree view from
    becoming too large with our components. The Chart property is a
    TCustomChart. Here is how to create a simple pie chart:

    uses
    Series;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppreport1.Print;
    end;

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    var
    lSeries: TPieSeries;
    begin

    lSeries := TPieSeries.Create(Self);

    lSeries.ParentChart := ppTeeChart1.Chart;
    lSeries.Add( 1234, 'Hello' + ' ' + 'world' , clRed );
    lSeries.Add( 2000, 'Good' + ' ' + 'Day' , clBlue );
    end;



    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.