onGetText
I'm using RB7.02 Pro (Delphi 7). I dynamically create DBText. I need to
print value of onGetText event of field of dataset.
I figured the easiest thing to do would be to do the formatting
myself in an OnGetText event for the DBText field.
Is there something else I need to do to get the results
I Try to do this:
DBTekst:=TLppDBText.Create(self);
DBTekst.Band := ppReportBazowy.DetailBand;
DBTekst.Laser.Column:=ColumnNr;
DBTekst.Width:=liWidth-3;
DBTekst.Left := liPosition;
DBTekst.Top := 2;
DBTekst.Font.Size:=7;
DBTekst.DataPipeline:=ppDBPipelineGrid;
if Assigned(FGrid.Columns[i].DataBinding.Field.OnGetText) then
begin
DBTekst.DataField:=FGrid.Columns[i].DataBinding.FieldName;
TField(DBTekst).OnGetText:=FGrid.DataController.DataSet.FieldByName(FGrid.Columns[i].DataBinding.FieldName).OnGetText;
end
else
DBTekst.DataField:=FGrid.Columns[i].DataBinding.FieldName;
Any info would be appreciated.
Maciej Majewski
print value of onGetText event of field of dataset.
I figured the easiest thing to do would be to do the formatting
myself in an OnGetText event for the DBText field.
Is there something else I need to do to get the results
I Try to do this:
DBTekst:=TLppDBText.Create(self);
DBTekst.Band := ppReportBazowy.DetailBand;
DBTekst.Laser.Column:=ColumnNr;
DBTekst.Width:=liWidth-3;
DBTekst.Left := liPosition;
DBTekst.Top := 2;
DBTekst.Font.Size:=7;
DBTekst.DataPipeline:=ppDBPipelineGrid;
if Assigned(FGrid.Columns[i].DataBinding.Field.OnGetText) then
begin
DBTekst.DataField:=FGrid.Columns[i].DataBinding.FieldName;
TField(DBTekst).OnGetText:=FGrid.DataController.DataSet.FieldByName(FGrid.Columns[i].DataBinding.FieldName).OnGetText;
end
else
DBTekst.DataField:=FGrid.Columns[i].DataBinding.FieldName;
Any info would be appreciated.
Maciej Majewski
This discussion has been closed.
Comments
Sorry, but I'm a bit confused by your code below. Is this working code?
DBTekst:=TLppDBText.Create(self); (Do you mean TppDBText or is this a
custom component of some sort?).
DBTekst.Laser.Column:=ColumnNr; (The DBText component in ReportBuilder does
not have a "Laser" property).
TField(DBTekst)... (The DBText component and TField are not the same type, I
do not see how this could work).
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com