I'm creating a report in Delphi using QuickReport
.
In the database I write formatted text (ie, with justified parts, other aligned left-centered ones).
To justify the text in TDBrichedt
I used the following code:
procedure TfrmAnotacoes.FormShow(Sender: TObject);
begin
inherited;
SendMessage(edtAnot.handle,
EM_SETTYPOGRAPHYOPTIONS,
TO_ADVANCEDTYPOGRAPHY,
TO_ADVANCEDTYPOGRAPHY)
end;
procedure TfrmAnotacoes.JustifyRichEdit(RichEdit :TCustomRichEdit; AllText :Boolean);
var
ParaFormat :TParaFormat;
SelStart,
SelLength :Integer;
begin
ParaFormat.cbSize := SizeOf(ParaFormat);
SelStart := RichEdit.SelStart;
SelLength := RichEdit.SelLength;
if AllText then
RichEdit.SelectAll;
ParaFormat.dwMask := PFM_ALIGNMENT;
ParaFormat.wAlignment := PFA_JUSTIFY;
SendMessage(RichEdit.handle, EM_SETPARAFORMAT, 0, LongInt(@ParaFormat));
// Restaura seleção caso tenhamos mudado para All
RichEdit.SelStart := SelStart;
RichEdit.SelLength := SelLength;
end;
I would like to justify the text in QRDBRichText
as it comes from the bank, but I can not!