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

Make function public in reportbuilder in run-time.

edited August 2002 in General
Hi.

I have made a function which you can see below, which a want to use.

function DateAHead(const aDate : TDateTime; Days : Integer = 1) : TDateTime;
begin
if (DayOfWeek(aDate + Days) = 7) then
result := aDate + Days + 2
else
if (DayOfWeek(aDate + Days) = 1) then
result := aDate + Days + 1
else
result := aDate + Days;
end;

I have a program that can launch the report builder in run-time. My question
is how can I make the function public in the report builder at run-time so
that I can parhappes use it in the OnGetText on a Label like :

procedure Label1OnGetText(var Text : string);
begin
Text := DateToStr(DateAHead('2002-08-23', 10);
end;


Thanks

J?rgen, Denmark

Comments

  • edited August 2002
    Hi,

    Include the name of the untit from your function in the uses clause of the
    unit where your report component resides.

    uses ...., UnitWithMyFunction, etc...

    procedure Label1OnGetText(var Text : string);
    begin
    Text := DateToStr(DateAHead('2002-08-23', 10);
    end;

    Nico

  • edited August 2002
    You event handler looks like a RAP one. You need to surface yoru method in
    RAP. There are examples of creating RAP passthrough functions in your
    RBuilder\Demos\RAP directory.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.