How to set the label caption on the report
I put labels on the report header which is to be set at run time or before
print.
In Delphi, I tried
with ppReport1 do
begin
lblCompanyName.Caption := 'XYZ Company';
Print;
end;
This 'XYZ Company' is read from ini file, not from database.
It does not set the caption of the label when the report is shown in
preview. I just showed as lblCompanyName.
print.
In Delphi, I tried
with ppReport1 do
begin
lblCompanyName.Caption := 'XYZ Company';
Print;
end;
This 'XYZ Company' is read from ini file, not from database.
It does not set the caption of the label when the report is shown in
preview. I just showed as lblCompanyName.
This discussion has been closed.
Comments
it should work, you must be doing something wrong.
Note that lblCompanyName is not a property of ppReport1 so you don't have to
apply the 'with' statement to it.
so you can do it in 2 lines:
lblCompanyName.Caption := ...
ppReport1.Print
so the question is why isn't it working--some debugging. Check the
following:
1) the class name of lblCompanyName
2) the value of lblCompany.Caption in the reports' BeforePrint event.
3) check the band of the label is correct.
Ed Dressel
Team DM
to
--
Ed Dressel
Team DM
band.
--
Ed Dressel
Team DM