Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print rich text in vfp report?

Status
Not open for further replies.

Paco75

Programmer
Oct 11, 2001
239
US
Hi,

I have a database with a memo containing textRTF from a RichTextBox. I want to know how to print the contents in a report... i want to add it in an existing report made with vfp report editor.

thanks
 
i found this example


but you are right it does not seem to print more than one page :(

Also when i try to print directly from memo it does not work... it says it must be a general field... i dont know general fields type it's the first time i use these. According to that example it seems i will have to copy memo field contents into a .rtf file then append the file content into another field of general type then print the report o_O sounds strange to me, it must have a better way to do it!
 
Yes, that's basically correct

What you should do is create a cursor (not a table), with all the fields that you need for the report, plus a field of type General.

Then, use the APPEND GENERAL command to place your RTF file into the General field. If your RTF is in a memo field rather than a file, you will have to save it as a temporary file first.

I know it sounds complicated, but the reason is that the RTF control (in the report) is not a native VFP control, and knows nothing about VFP memo fields.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
it works this way but one problem still remain i can't print more than one page...

* Note that to copy a memo to a file you should use COPY MEMO <memofield> TO <filename> instead of COPY TO

thanks for helping!
 
to print more than one page use moxie report objects

i know of no other way within a VFP report


it's cheap and easy to use and royalty free.

The only downside is the RTF is rendered as an image in the report and will remain an image in any PDF you export to (e.g. using XFRX).

n

 
the demo download link seem to be broken i cant download it
 
Nigel,

I've nothing against the TX text control, but it seems like a drastic solution. It's a very big control, with a high overhead; it's complicated to use; and it's expensive.

If it's the only way of achieving what Paco wants, then so be it. But if this was me, I'd rather find a simpler solution.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
To print multi-pages i think i need to break the document down in separated documents appended in separated fields.
 
Mike,

agreed the text control is drastic - i just mentioned it for completeness (but it may be more appropriate if there is a large document generating component to paco's project).

Paco,

I just emailed Bo Durban (the developer of Moxie) to let him know the download link is not working... perhaps if you told us a little more about your project we could suggest other options.

n
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top