Report Components after generate
Hi @ all,
We use Delphi Xe2. We create a Report at runtime and then load the
template into the report.
Is there a way,for example, to get the width of a variable after the
Report was generated?
With this:
http://www.digital-metaphors.com:8080/Delphi_Code/Layouts/Report_Object_Loop
I only get the values before the report was generated.
For example a variable has a width of 26 before print.
Then after print the variable has a width of 210. How can i get the
value of 210?
Thanks.
Nick
We use Delphi Xe2. We create a Report at runtime and then load the
template into the report.
Is there a way,for example, to get the width of a variable after the
Report was generated?
With this:
http://www.digital-metaphors.com:8080/Delphi_Code/Layouts/Report_Object_Loop
I only get the values before the report was generated.
For example a variable has a width of 26 before print.
Then after print the variable has a width of 210. How can i get the
value of 210?
Thanks.
Nick
This discussion has been closed.
Comments
The easiest way is to create a local bitmap object and use its canvas to
measure the text. For instance...
procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant);
var
lBitmap: TBitmap;
liTextWidth: Integer;
begin
Value := ppReport1.DataPipeline['Company'];
lBitmap := TBitmap.Create;
try
liTextWidth := lBitmap.Canvas.TextWidth(Value);
//Convert from Screen Pixels here using ppUtils.ppFromScreenPixels
if needed.
finally
lBitmap.Free;
end;
end;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
But the problem is, that our customers design their Reports with the
ReportDesigner and we load the template at runtime and not at design
time, so I dont have the access to this variable in delphi on designtime.
Should I maybe send you an example project?
Best Regards,
Nick.
Am 12.02.2015 16:40, schrieb Nico Cizik (Digital Metaphors):