Solved

Delphi Programming question

Posted on 1997-09-23
6
501 Views
Last Modified: 2010-04-03
I am writing a form letter.  The client wants the first sentence of the paragraph bold.  How do I do this?

I assume I will use a qrRichEdit control but that is about as far as I have gone....  This needs to be done by the program with no user intervention.
0
Comment
Question by:loucks
6 Comments
 
LVL 4

Expert Comment

by:itamar
ID: 1346056
Where the text to be written come from ? (database, typed, another control...)
0
 
LVL 1

Expert Comment

by:anilms
ID: 1346057
We also had similar problems to solve. I presume that you would
like the first line to be bold while printing. Be sure that the
Printer/s unit is included.

var PText : TextFile;

begin
     AssignPrn(PText);
     Rewrite(PText);
     Printer.Canvas.Font :=   ; {Use whatever font/bold you want}
     Writeln(PText,'Heading for Report');
     Printer.Canvas.Font :=  ; {Change back to default font}
     { Do your printing using Writeln statements}
     {                                          }
     CloseFile(PText);
end



0
 

Author Comment

by:loucks
ID: 1346058
The title of the question got screwed up...

This is delphi 3.0 and QuirkReports :) 2.0i

I would really like to stay away from printing directly on the canvas....    Is it hard to print on the canvas?  
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Accepted Solution

by:
sassas081597 earned 130 total points
ID: 1346059
Hi.
I hope you can find the selection yourself.
Copy the text from QRRichText to RichEdit. Make last the ParentRichEdit of the first.

Here is the rest code.
procedure ChangeAllINeed(Sender: TObject);
begin
    if FindSentence(1,1) then  RichEdit1.SelAttributes.Style := RichEdit1.SelAttributes.Style + [fsBold];
end;

where the
FindSentence(NP, NS: Integer): Boolean;
looks for and selects the nesessary sentence in nesessary paragraph if they exist.

0
 

Author Comment

by:loucks
ID: 1346060
Sorry to take so long to grade this, but I have a question which relates to this (if you decide not to answer, I will give you full points, but I would like to get your opinion...)  

When I assign the RichEdit as the parent of the qrRichEdit, all I get is the first line on my report... Otherwise, it shows up fine in the RichEdit that I manipulate it in, but as I said, only the first line appears in the qrRichEdit, no matter what I do...  I will put the total points to 200 if you can give me a pointer on where to go with this..
0
 

Author Comment

by:loucks
ID: 1346061
This is really starting to be a pain in the butt!!! QuickReport2.0i still has major bugs....  Hope someone else doesn't have to go through this... At least I am on my way now...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now