ppDBRichText and SelAttributes
Hi,
I'm using Delphi 7 and RB 10.02
I use a ppDBRichText field to display a long name. In the BeforePrint event
of the ppGroupHeaderBand, I modify the SellAttributes as displayed below.
My problem is, when I run the report the second time, without quitting it,
the ppDbRichText component is blank. If I do not modify the SelAttibutes,
then it displays data for consecutive runs.
procedure TfrmSiteInfo.ppGroupHeaderBand2BeforePrint(Sender: TObject);
begin
with ppDBRichTextSiteName do
begin
SelStart := 0;
SelLength := Length(IBQV_GeositesInfo.FieldByName('SiteName').AsString);
SelAttributes.Color := clBlack;
SelAttributes.Size := 12;
SelAttributes.Name := 'Trebuchet MS';
SelAttributes.Style := [fsBold];
end;
end;
Regards,
Nols Smit
I'm using Delphi 7 and RB 10.02
I use a ppDBRichText field to display a long name. In the BeforePrint event
of the ppGroupHeaderBand, I modify the SellAttributes as displayed below.
My problem is, when I run the report the second time, without quitting it,
the ppDbRichText component is blank. If I do not modify the SelAttibutes,
then it displays data for consecutive runs.
procedure TfrmSiteInfo.ppGroupHeaderBand2BeforePrint(Sender: TObject);
begin
with ppDBRichTextSiteName do
begin
SelStart := 0;
SelLength := Length(IBQV_GeositesInfo.FieldByName('SiteName').AsString);
SelAttributes.Color := clBlack;
SelAttributes.Size := 12;
SelAttributes.Name := 'Trebuchet MS';
SelAttributes.Style := [fsBold];
end;
end;
Regards,
Nols Smit
This discussion has been closed.
Comments
As a test, try placing a break point where you define the SelLength in the
event below and be sure it is a value above 0 when you run the report the
second time.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
seems to be ignored in the code below because with a breakpoint at the third
last line, the values of s1 = 0 and s2 = -1 for the consecutive runs.
procedure TfrmSiteInfo.ppGroupHeaderBand2BeforePrint(Sender: TObject);
const sName:string = 'Whetever';
var
s1, s2: string;
begin
with ppRichTextSiteName do
begin
RichText := sName;
SelStart := 0;
SelectAll;
s1 := IntToStr(SelLength);
SelLength := Length(sName);
s2 := IntToStr(SelLength);
SelAttributes.Color := clBlack;
SelAttributes.Size := 12;
SelAttributes.Name := 'Trebuchet MS';
SelAttributes.Style := [fsBold];
end;
end;
Regards,
Nols Smit
It seems the Band.BeforePrint event does not fire late enough perhaps for
the richtext component to contain the proper data. Try uisng the OnPrint
event or OnGetRichText event of the ppDBRichText component and see if that
gives you a better result.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
1400 Invalid window handle): ppDBRichText and ppDBRichText components give
problems in a IntraWeb application. I nearly re-installed RB
Regards,
Nols Smit