Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELPHI quick report cahnge value at runtime 1

Status
Not open for further replies.

kyriakos70

Programmer
Jul 24, 2008
87
GR
Hi,
I have a question which is not derectly to Delphi, I have a quick report form in my application and want to change a value of a database field (qrdbtext) at run time or if not possible of a quick report label.

Thank you
Kyriakos
 
you say you want to change a value of a database field. that would mean the value comes from the database so you need to change it there, not in the report.


Aaron
 
Yes, actually you can. Most QuickReport objects have an OnPrint event that look like this:
Code:
procedure TQReport.QRLabel20Print(sender: TObject; var Value: String);
begin
  Value:= MyData.FieldByName('MyField').AsInteger + 100
end;
In the example above, the "value" displayed will be 100 greater than the value in the DB.

HTH

Roo
Delphi Rules!
 
OOPS: To funtion properly, it would need to be
Code:
procedure TQReport.QRLabel20Print(sender: TObject; var Value: String);
begin
  Value:= IntToStr(MyData.FieldByName('MyField').AsInteger + 100)
end;

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top