Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

delphi - Fast reports - bulleted text

Is there a way you can have bulleted tekst in fast reports 4.13 ? I have a memo field which I would like to display bulleted. If not in fast reports are there any other delphi components that can do that ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The RichText object (TfrxRichView) supports bulleted text.

enter image description here

The question which may naturally raise up, is how to make that bulleted list from code. Well, that's quite easy. You just set the Numbering property of the current Paragraph for the inner RichEdit of the TfrxRichView object to nsBullet. Assuming you have a RichText object named Rich1 placed on a report frxReport1, you can use a code like this to make three bulleted items:

uses
  frxClass, frxRich, frxRichEdit;

procedure TForm2.Button1Click(Sender: TObject);
var
  Component: TfrxComponent;
begin
  Component := frxReport1.FindObject('Rich1');
  if Component is TfrxRichView then
  begin
    TfrxRichView(Component).RichEdit.Clear;
    TfrxRichView(Component).RichEdit.Paragraph.Numbering := nsBullet;

    TfrxRichView(Component).RichEdit.Lines.Add('Item 1');
    TfrxRichView(Component).RichEdit.Lines.Add('Item 2');
    TfrxRichView(Component).RichEdit.Lines.Add('Item 3');

    frxReport1.ShowReport;
  end;
end;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...