Add string to memo box from subreport.
Hi.
I have made a subreport with a Variable component which is invisibel. The
code in the OnCalc event look like this :
procedure Variable1OnCalc(var Value : Variant);
begin
Value := Value + ', ' + ppDBPipeline1[PladsNr];
end;
What I get out of this code is a string that look something like this :
A1, B2, B3
On the headreport I have a memo box which I added some other data in the
BeforeGenerate event.
What I want is to add the string to memo box that was genereted by the
Variable component, but I have tried all the events but it does not seem to
work. Can anyone help me.
Thanks
J?rgen
I have made a subreport with a Variable component which is invisibel. The
code in the OnCalc event look like this :
procedure Variable1OnCalc(var Value : Variant);
begin
Value := Value + ', ' + ppDBPipeline1[PladsNr];
end;
What I get out of this code is a string that look something like this :
A1, B2, B3
On the headreport I have a memo box which I added some other data in the
BeforeGenerate event.
What I want is to add the string to memo box that was genereted by the
Variable component, but I have tried all the events but it does not seem to
work. Can anyone help me.
Thanks
J?rgen
This discussion has been closed.
Comments
You could place all of the code to populate the memo lines inside of the
variable's OnCalc event handler. This would guarantee that the variable
value would be included in the memo.
Cheers,
Jim Bennett
Digital Metaphors Corp.
http://www.digital-metaphors.com
info@digital-metaphors.com
I have tried what you have wrote, but it seem that it does not work, maybe I
have done something wrond. If I ask you nicely parhaps you could send me an
exemple in code that I could implementat.
Thanks
J?rgen
bad, then you are ok. Does the memo shift relative to the subreport? How
are they positioned? If the memo is above the subeport, the the memo will
have already generated before the subreport has a chance to print.
procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant);
begin
Value := 'A1, B2, C3';
ppMemo1.Lines.Add('Hello World');
ppMemo1.Lines.Add(Value);
end;
Cheers,
Jim Bennett
Digital Metaphors Corp.
http://www.digital-metaphors.com
info@digital-metaphors.com