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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RTF Printing & VFP 1

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,814
JP
All,
I've spent several days creating these beautiful RTF controls in my VFP 7.0 application. So, today when I went to create some reports to see this stuff on paper, I was horrified to discover that what I got was a bunch of RTF control codes in my text boxes. (Just created a quick report with some fields that are RTF, and did a page preview).
So the new problem du jour, what is the best way to go about creating reports that can take advantage of this spiffy RTF data I've created in my memo fields?

Thanks,
-Scott

s-) Please let me know if this has helped s-)
 
Chris,
Thanks. There are actually 2 articles which deal with RTF & printing. I see their point. Funky, but works. Thanks for the tip.
If anyone else should happen by this article, both the

HOWTO: Apply Rich Text Effects in Visual FoxPro Reports (Q246088)

and
FIX: Using the SelPrint Method of the Rich Text Conrol (Q170126)

are very informative on the subject.


Thanks,
-Scott

s-) Please let me know if this has helped s-)
 
Also if you have crystal 8 or newer available, you can set a property of the textbox in crystal reports to render the text as either RTF or HTML.
 
Fluteplr,
I've not worked with Crystal, but am curios. Can you create "Distributable" canned reports, in crystal, that can be rolled into your compiled app, without needing extra licenses?

Thanks,
-Scott

s-) Please let me know if this has helped s-)
 
Their licensing is sort of weird, and you might want to ask this question on the Crystal forum. But that is my understanding.
 
I'm already capable of printing rtf in Fox Reports, but since the ole/picture control does not stretches with overflow, only the first lines print out.

how can I print out the whole field?
[hourglass]

 
Lurias,
Quite unfortunatly, as I have come to find, using the Fox Report Writer, you've done everything you can. There is no way to dynamically stretch an OLE Bound object in a report form, as you can a text block in a detail area. It is an unfortunate missgiving of the OLE object, otherwise, RTF would be a plausable alternative in the Fox Report writer. You have basically two options:
1) Write your reports in code, where you have more control. The down side to this, it takes a long time, and modifications/maintenance are difficult.
2) Obtain a 3rd party report writer that can deal with RTF content, such as Crystal Reports. The down side to this, additional layers of complexity for distribution, learn curve, and cost.

I continue to look for a better answer, but thus far, one has not presented itself.

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
We also store RichText in memo fields. To print them on a report we use VirtualPrintEngine.
Like the name: this is an engine. In other words you have to create classes etc to get things working...but if you have them there is nothing (and I really mean nothing) that will beat its speed, accuracy and capabilities.
It is still the only tool that can handle columns (cells) where you are entering more than one (!) rtf-field into. It will render everything within the cell without a glitch. It not cheap but it will knock the socks of your customers...
The latest version can also print a document to pdf. Once again there is nothing that matches this speed as well.....
 
nc1264,
How difficult is it to implement this in VFP? Is there a runtime license? Is it freely distributable with your app??? You have me salivating! As I've still not found a really viable solution to my RTF problems, and I am desperate to find one that is suitable. Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I found a piece of code call RTFPrinter and APIPrinter, which I've been using for a while in one of my giveaway products.

I can't remember where it came from, but it doesn't use the VFP report generator - and is free.

If I can find where I got it from, do you want a copy?

regards
Regards

Griff
Keep [Smile]ing
 
This is the 'readme' that comes with it:

Code:
API printing and RTF printing

This project demonstrates how you can bypass FoxPro's report generator and print directly through the Windows API. Two class libraries are included: 'APIprinter' is a generic class for printing through the API using StartDoc, StartPage, EndPage, and EndDoc functions. It can be used for printing from controls which write directly to a device context. 'RTFprinter' uses 'APIprinter' to preview and print the contents of a rich text control with user defined margins, header, footer, and page numbers. The demonstration program should explain how to uses the classes.

Rasmus Moustgaard, November 2001
r.moustgaard@cochrane.dk
Regards

Griff
Keep [Smile]ing
 
Griff,
I'd be very interested. Can you e-mail it to scottvpayton@hotmail.com?
Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,
I have sent more info about this to your email account. Hope it helps. If you need any more info and/or help let me know.
 
Griff:

can you send me such info to olimaz@intelnet.net.gt

Lurias
 
Hi I am Interested in anything RTF.
Could you kindly send me at uafox@hotmail.com.

TIA

AjoyK
 
Griff:

Wow. I would love a copy of the RTF/API printing project. Please E-Mail to fmoore@pasesoftware.com !! Thanks for the offer!

Frank
 
Lurias,

Thanks, someone else I sent the .zip to spotted the .vcx files were missing!

I have remailed it to people, and replaced the one on my link!

Sorry all!

PS - the address Lurias is almost certainly where I got it from!

Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top