How can I print a Rich Text Format? 
Author Message
 How can I print a Rich Text Format?

Hi to all of you!

How can I print a Rich Text Format contents with the other field contents of
my dbf file on the same printer page?
I mean with its formatting (fonts, bold, italics, colors, ...)
i.e.

NAME: Nick Porfiris        <-- contents of a textBox
COMMENTS:
                        xxxxxXXXXXXxxxxxXXXXXxxxxxx    <-- contents of Rich
Text Format
                        xxXXXXXxxxxXXXxx xxx Xxx xx x

I have Vfp 6.0 SP3.

Thank you very much for your replay,

Nick Porfiris,
Ermis-Pliroforiki
Athens-Greece



Sun, 11 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
Hello, I went through what you are going through about a month ago.  With the
help of several others on this NG I finally got it working.  First, I think you
have to have VFP 6 SP3 (too many bugs in the previous versions) but I'm not
positive.

I'd suggest you look at Article Q170126 from Microsoft.  Also, look at the
selPrint method in the ole activex control that displays the text in RTF on the
screen.

For me the code to print RTF was so useful that I actually put the entire form
along with the print code in a class.  Here's the code I use to print in rich
text format.  When the user clicks my Print command button on the toolbar it
calls this code which then prints the rich text format.  It works great for me.

cdlPDReturnDC=256
cdlPDNoPageNums=8
cdlPDSelection=1
cdlPDAllPages=0

on error m.llErrFlag = .t.
with thisform
 .CommonDialog1.object.Flags = cdlPDReturnDC
  if .oleNotes.object.SelLength = 0
   .CommonDialog1.object.Flags = .CommonDialog1.object.Flags +      
cdlPDAllPages
   else
     .CommonDialog1.object.Flags = .CommonDialog1.object.Flags +      
cdlPDSelection
    endif
    thisform.commonDialog1.object.ShowPrinter()
  thisform.oleNotes.object.SelPrint(thisform.CommonDialog1.object.hDC)
endwith
on error dodefault()
return

Mike



Mon, 12 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
By the way,

ignore my on error routines.  That's my own stuff. However, you will need to
set up your own on error routines in case they click the Cancel button at the
print dialog.

Regards,

Mike



Mon, 12 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
Hi Mike,

How can I put the contents of a RTF into my VFP report?

Thank you very much for your replay,

Have a nice day (or night)
Nick Porfiris,
Ermis-Pliroforiki
Athens-Greece



Quote:
> Hello, I went through what you are going through about a month ago.  With
the
> help of several others on this NG I finally got it working.  First, I
think you
> have to have VFP 6 SP3 (too many bugs in the previous versions) but I'm
not
> positive.

> I'd suggest you look at Article Q170126 from Microsoft.  Also, look at the
> selPrint method in the ole activex control that displays the text in RTF
on the
> screen.

> For me the code to print RTF was so useful that I actually put the entire
form
> along with the print code in a class.  Here's the code I use to print in
rich
> text format.  When the user clicks my Print command button on the toolbar
it
> calls this code which then prints the rich text format.  It works great
for me.

> cdlPDReturnDC=256
> cdlPDNoPageNums=8
> cdlPDSelection=1
> cdlPDAllPages=0

> on error m.llErrFlag = .t.
> with thisform
>  .CommonDialog1.object.Flags = cdlPDReturnDC
>   if .oleNotes.object.SelLength = 0
>    .CommonDialog1.object.Flags = .CommonDialog1.object.Flags +
> cdlPDAllPages
>    else
>      .CommonDialog1.object.Flags = .CommonDialog1.object.Flags +
> cdlPDSelection
>     endif
>     thisform.commonDialog1.object.ShowPrinter()
>   thisform.oleNotes.object.SelPrint(thisform.CommonDialog1.object.hDC)
> endwith
> on error dodefault()
> return

> Mike



Mon, 12 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
First thing you want to do is create a form and put an Active X ole object on
the form.  Then set the control source to the rich text format.  For example,
if the RTF is stored as a file on the disk you can read the file and store it
in something like thisform.cRTFNotes  then set the rtf ole control source to
thisform.cRTFNotes.  Then when you run the form you should see everything
formatted in the OLE object.  If so, you can easily use the code in my last
reply to print the RTF.  In fact, you do not even need to actually display the
form since if you wanted to you could access the selPrint even from the form's
init routine and thus bypass the displaying of the RTF text when printing it.

Quote:
>Subject: Re: How can I print a Rich Text Format?

>Date: 2/24/00 2:46 AM Pacific Standard Time

>Hi Mike,

>How can I put the contents of a RTF into my VFP report?

>Thank you very much for your replay,

>Have a nice day (or night)
>Nick Porfiris,
>Ermis-Pliroforiki
>Athens-Greece

Mike


Mon, 12 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
Thank you Mike very much.
Have you ever try to put a RTF OLE object into a report created with the VFP
report designer?

Have a nice day (or night)
Nick Porfiris,
Ermis-Pliroforiki
Athens-Greece



Quote:
> First thing you want to do is create a form and put an Active X ole object
on
> the form.  Then set the control source to the rich text format.  For
example,
> if the RTF is stored as a file on the disk you can read the file and store
it
> in something like thisform.cRTFNotes  then set the rtf ole control source
to
> thisform.cRTFNotes.  Then when you run the form you should see everything
> formatted in the OLE object.  If so, you can easily use the code in my
last
> reply to print the RTF.  In fact, you do not even need to actually display
the
> form since if you wanted to you could access the selPrint even from the
form's
> init routine and thus bypass the displaying of the RTF text when printing
it.

> >Subject: Re: How can I print a Rich Text Format?

> >Date: 2/24/00 2:46 AM Pacific Standard Time

> >Hi Mike,

> >How can I put the contents of a RTF into my VFP report?

> >Thank you very much for your replay,

> >Have a nice day (or night)
> >Nick Porfiris,
> >Ermis-Pliroforiki
> >Athens-Greece

> Mike



Mon, 12 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
You cannot use objects in VFP reports other than the standard report
controls that are on the report controls toolbar. I think you're out of luck
trying to include RTF content in a VFP report; same goes for Crystal
Reports.

--
William Fields
US Bankruptcy Court
Phoenix, AZ


Quote:
> Thank you Mike very much.
> Have you ever try to put a RTF OLE object into a report created with the
VFP
> report designer?

> Have a nice day (or night)
> Nick Porfiris,
> Ermis-Pliroforiki
> Athens-Greece



> > First thing you want to do is create a form and put an Active X ole
object
> on
> > the form.  Then set the control source to the rich text format.  For
> example,
> > if the RTF is stored as a file on the disk you can read the file and
store
> it
> > in something like thisform.cRTFNotes  then set the rtf ole control
source
> to
> > thisform.cRTFNotes.  Then when you run the form you should see
everything
> > formatted in the OLE object.  If so, you can easily use the code in my
> last
> > reply to print the RTF.  In fact, you do not even need to actually
display
> the
> > form since if you wanted to you could access the selPrint even from the
> form's
> > init routine and thus bypass the displaying of the RTF text when
printing
> it.

> > >Subject: Re: How can I print a Rich Text Format?

> > >Date: 2/24/00 2:46 AM Pacific Standard Time

> > >Hi Mike,

> > >How can I put the contents of a RTF into my VFP report?

> > >Thank you very much for your replay,

> > >Have a nice day (or night)
> > >Nick Porfiris,
> > >Ermis-Pliroforiki
> > >Athens-Greece

> > Mike



Mon, 12 Aug 2002 03:00:00 GMT  
 How can I print a Rich Text Format?
No and I don't think that would work because the report writer is not "truly"
object oriented (yet).  FYI neither is the menu wizard.

Anyways, it would not work anyways because remember, you need to call the
SelPrint method in the object.  Let me know how it all works out for you.  It
works great for me.  Now, what you can do is run a report with some general
information (fields and stuff) and then run the selprint method to print the
rich text format as an attachment.

Regards,

Quote:
>ubject: Re: How can I print a Rich Text Format?

>Date: 2/24/00 1:13 PM Pacific Standard Time

>Thank you Mike very much.
>Have you ever try to put a RTF OLE object into a report created with the VFP
>report designer?

>Have a nice day (or night)
>Nick Porfiris,
>Ermis-Pliroforiki
>Athens-Greece

Mike


Tue, 13 Aug 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Rich Text Format Printing Problem

2. Printing Rich Text Format in VFP

3. Rich Text Format Print Problem

4. Rich Text Format Printing

5. Printing rich text format

6. Rich Text Nightmare (merging two rich text files)

7. Rich Text Format / WP style in Fox?

8. Rich Text Format etc.

9. Rich Text format

10. Rich text format

11. Need Help With (RTF) rich text format

12. Rich Text Format - Next Page and Codes

 

 
Powered by phpBB® Forum Software