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

Dynamic TeeCharts

edited April 2004 in General
Due to the nature of the report i have to create the chart dynamically, as i
do not know how many will be needed.
This is my PassTrough function, no errors are occuring but nothign is
visible, and i'm sure that the function print, as the 'Version1', with is on
the page before uses the same code to 'plot' values.
Are there other values that have to be set execpt the Band ??


procedure TSdwRapTeeChartActualVsBudget2Function.ExecuteFunction(aParams:
TraParamList);
var
CompId : String;
LstItm : Integer;
aPipLine : TppDataPipeLine;
aBand : TppBand;
aChart : TppTeeChart;
aSeries : TChartSeries;
begin
CompId := '';
aSeries := nil;
GetParamValue(0, aPipLine);
GetParamValue(1, aBand);
aChart := TppTeeChart.Create(aBand);
aChart.Band := aBand;
aChart.Top := 50;
aChart.Width := 1000;
aChart.Height := 500;
aChart.Chart.RemoveAllSeries;

Comments

  • edited April 2004
    Hi Harry,

    I would first suggest getting this working in Delphi before moving it to a
    RAP passthru function. Do you get the same behavior when creating a
    TeeChart in Delphi? If you are seeing the chart object, then you have
    initialized the chart correctly for ReportBuilder but as for the minumum
    settings required to see the chart information, you may need to consult the
    TeeChart help file.

    --
    Best Regards,

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

    I'm trying it from Delphi and having the same problems.
    Dynamically creating a Chart is no problem, but the several ways i'm trying
    to do it with a tppchart or i'm getting nothign printed or the chart is on a
    form on the screen instead of on the report.
    I suppose when looking in the Sources of RB i might find something but i
    prefer the easy (read faster) way, you guys ....

    It just knowing what function/procedures/properties to be called/set in what
    order to get it right.

    Thx
  • edited April 2004
    Hi Harry,

    I went ahead and created you an example that creates a TppTeeChart in code
    and places it on an empty report. I hope this helps.

    http://www.digital-metaphors.com/tips/CreateChartInCode.zip

    --
    Best Regards,

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

    Thx, but take a look at www.extrem.se, i'm skiing those and offpiste,
    superb.
  • edited April 2004
    Nico,

    I've implemented it, but as i have to pass this to rap i'm looking
    for the right event to call the create graph, first i did it in the
    before generate of the band, there it didn't work eigther, no error
    but not visible. when i place it in the before print of the report it
    works fine, but isn't that a dangerous event.

    I thought that the before print can be fired several times (of a
    band) and the on generate only once,it this the same for the report
    before print, because if so i must keep trak of the dynamically
    created graphs ? series in order to free them when the report is
    'killed/stopped'.

    Is this thinking correct ?
  • edited April 2004
    Hi Harry,

    Actually the Report.BeforePrint will only fire once per print. The band
    events all have the possibility of firing multiple times per record. If the
    Report.BeforePrint works, I would say stick with it. To be sure the object
    is only created once, you can always set a flag once it is created the first
    time and check it each time the event code is executed.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    They look nice...

    I'm on the Dynastar Twister (twin tip mogul ski) and will be getting the
    Rossi Scratch FS soon.

    --
    Best Regards,

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

    Next Problem,

    When coding in Rap i have the before print event on the report, but
    no such event on the subreport. But, if i would use the before print
    of the main report, how can i reference a band in a subreport .....

    Thx
  • edited April 2004
    Hi Harry,

    From the BeforePrint Event in RAP, you can access the
    SubReport.Report.Bands[] property to reference a band in a given subreport.
    You could also create a global variable that references a certain band
    inside a subreport in RAP.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.