RTF from Variable
Re: RTF from Variable
Please look this topic and tell me
viewtopic.php?f=3&t=34042&p=201596&hilit=PRINT+RTF&sid=5c18e0935f895ae1021775503df96ca7#p201607
viewtopic.php?f=3&t=34042&p=201596&hilit=PRINT+RTF&sid=5c18e0935f895ae1021775503df96ca7#p201607
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: RTF from Variable
No my questions were not answered in that post. I had already reviewed it many times but look again. Let me be specific:
DOES ANYONE USE RTF with a FW Memo field ? Does anyone print RTF along with regular code in a custom PRINTER class printout ? I have heard it is possible, but have seen no completed code or documentation to demonstrate this.
ISSUE 1:
Using the updated RichEdit5.prg, with a resource file, I can read text from a memo field ( DBFCDX ) into a variable, and then modify it with RichEdit including highlighting, spell checking, etc. Now, I want to save that modified text ( with RichEdit formatting ) back to the MEMO field in the .dbf. For years I heard this was possible, but see no examples or documentation. I've looked at the code, tried many different things, and have not found the solution.
ISSUE 2:
I have an invoice that uses the PRINTER class ( NOT THE REPORT OPTION ). There are a lot of formatting options in the structure, with calculations. and decision trees, throughout. This cannot be done with the report class. I previously shared how I print MEMO fields. My question was specific: Is there a PRINTER command to output the RTF data which I can replace the example I used? Remember, this is just one small part of the full invoice which is written 100% with PRINTER syntax.
Once I can see how these methods are applied, then I can implement them specifically in my application.
Thank you.
DOES ANYONE USE RTF with a FW Memo field ? Does anyone print RTF along with regular code in a custom PRINTER class printout ? I have heard it is possible, but have seen no completed code or documentation to demonstrate this.
ISSUE 1:
Using the updated RichEdit5.prg, with a resource file, I can read text from a memo field ( DBFCDX ) into a variable, and then modify it with RichEdit including highlighting, spell checking, etc. Now, I want to save that modified text ( with RichEdit formatting ) back to the MEMO field in the .dbf. For years I heard this was possible, but see no examples or documentation. I've looked at the code, tried many different things, and have not found the solution.
ISSUE 2:
I have an invoice that uses the PRINTER class ( NOT THE REPORT OPTION ). There are a lot of formatting options in the structure, with calculations. and decision trees, throughout. This cannot be done with the report class. I previously shared how I print MEMO fields. My question was specific: Is there a PRINTER command to output the RTF data which I can replace the example I used? Remember, this is just one small part of the full invoice which is written 100% with PRINTER syntax.
Once I can see how these methods are applied, then I can implement them specifically in my application.
Thank you.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: RTF from Variable
Tim,
c:\fwh\samples\report\rep22.prg is an example of using RTF from a report
both questions answered
c:\fwh\samples\report\rep22.prg is an example of using RTF from a report
both questions answered

- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: RTF from Variable
Antonio,
1) Using the save puts the text into the memofield with the formatting commands. However, when I retrieve that text the next time, it is NOT in RTF format. It shows all the formatting commands. I have reviewed this thread about a dozen times and tried every option provided for retrieving the text and making it ready for the RTF edit, but none of them work. All of the efforts were made several years ago, so I assume updates to the code may have changed.
Here is the code I have:
Suggestions ? I've tried the various Set and Load options described in this thread. There does not seem to be a final one.
2) rep22.prg does not demo anything with .RTF. Also, my question is doing a printout of RTF text with the PRINTER class, and NOT with a report. As stated above, for the complexity of my need, I cannot use a REPORT. I need the equivalent for RTF of this output:
oPrn:SayText( nRow, 10 * nCsp, MemoLine( oEndText:tagtext, 60, lx,, .T. ),,, oFnorm )
I would expect a SayRTF() Method but in the tPrinter class there is absolutely nothing that addresses RTF in any way. Perhaps there is another way ?
1) Using the save puts the text into the memofield with the formatting commands. However, when I retrieve that text the next time, it is NOT in RTF format. It shows all the formatting commands. I have reviewed this thread about a dozen times and tried every option provided for retrieving the text and making it ready for the RTF edit, but none of them work. All of the efforts were made several years ago, so I assume updates to the code may have changed.
Here is the code I have:
Code: Select all | Expand
FUNCTION setup3
// Text Editor for disclosures
// Updated: 7/30/2015 5:55:48 PM
LOCAL oEndText, oDlg, nRcrd, oRich
PRIVATE cText := " ", cTitle := " ", cRtf := " "
// Open the text database
oEndText := tEndText():New( )
oEndText:gotop( )
// Load the text
cText := oEndText:tagtext
// Create the dialog
DEFINE DIALOG oDlg RESOURCE "SETUP3" BRUSH oBrush transparent OF oWnd
oDlg:nHelpID := 6
REDEFINE BUTTONBAR oBarS3 ID 100 SIZE 60,60 OF oDlg 2015
oBarS3:bClrGrad := aPubGrad
DEFINE BUTTON oWBtn3 OF oBarS3 RESOURCE "HRSAVE" ;
ACTION ( oEndText:tagtext := oRich:SaveasRTF( cText ), oEndText:save() )
DEFINE BUTTON oWBtn5 OF oBarS3 RESOURCE "HREXIT" ;
ACTION oDlg:end()
// Create edit control
REDEFINE RICHEDIT5 oRich VAR cText ID 2155 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes" BARBUTTON
ACTIVATE DIALOG oDlg CENTERED
// Close the file
oEndText:close()
RETURN NIL
Suggestions ? I've tried the various Set and Load options described in this thread. There does not seem to be a final one.
2) rep22.prg does not demo anything with .RTF. Also, my question is doing a printout of RTF text with the PRINTER class, and NOT with a report. As stated above, for the complexity of my need, I cannot use a REPORT. I need the equivalent for RTF of this output:
oPrn:SayText( nRow, 10 * nCsp, MemoLine( oEndText:tagtext, 60, lx,, .T. ),,, oFnorm )
I would expect a SayRTF() Method but in the tPrinter class there is absolutely nothing that addresses RTF in any way. Perhaps there is another way ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: RTF from Variable
Tim,
RTF means "Rich Text format" which means different font sizes and colors and thats exactly what you can see in rep22.prg
If you need to use different font sizes and colors just using a Printer object, there are lots of examples we can provide you.
Simplicity is the key
RTF means "Rich Text format" which means different font sizes and colors and thats exactly what you can see in rep22.prg
If you need to use different font sizes and colors just using a Printer object, there are lots of examples we can provide you.
Simplicity is the key
- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: RTF from Variable
Antonio,
Thanks for the first response. I can now save and retrieve from the memo field. That is perfect.
The data in that field is many lines long. It is disclaimer text printed at the end of every invoice. Here is the code to print the contents:
You said you have many examples of using the printer class to handle this. I would love to see the examples. Right now it prints the text with all the formatting symbols ( and displays it that way in Preview ). So my question is: What is the format to use with tPrinter class code to accomplish what I am showing you.
Thanks for the first response. I can now save and retrieve from the memo field. That is perfect.
The data in that field is many lines long. It is disclaimer text printed at the end of every invoice. Here is the code to print the contents:
Code: Select all | Expand
IF cPRNTYP = "I"
oEndText:goto( 3 )
nRow += nRsp
FOR lx := 1 TO MLCount( oEndText:tagtext, 60,, .T. )
WOPAGEHEAD( oPrn, aHead )
oPrn:SayText( nRow, 10 * nCsp, MemoLine( oEndText:tagtext, 60, lx,, .T. ),,, oFnorm )
nRow += nRsp
NEXT
ENDIF
You said you have many examples of using the printer class to handle this. I would love to see the examples. Right now it prints the text with all the formatting symbols ( and displays it that way in Preview ). So my question is: What is the format to use with tPrinter class code to accomplish what I am showing you.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Re: RTF from Variable
Dear Tim,
This is the syntax for Class TPrinter Method SayText()
METHOD SayText( nRow, nCol, cText, nWidth, nHeight, oFont, cAlign, nClrText, nClrBack, cUnits, ;
nOutLineClr, nPenSize )
Please notice that you can use ANY font in oFont parameter, different colors, pensize...
That is RTF power
This is the syntax for Class TPrinter Method SayText()
METHOD SayText( nRow, nCol, cText, nWidth, nHeight, oFont, cAlign, nClrText, nClrBack, cUnits, ;
nOutLineClr, nPenSize )
Please notice that you can use ANY font in oFont parameter, different colors, pensize...
That is RTF power

- TimStone
- Posts: 2955
- Joined: Fri Oct 07, 2005 1:45 pm
- Location: Trabuco Canyon, CA USA
- Has thanked: 25 times
- Been thanked: 2 times
- Contact:
Re: RTF from Variable
TO ALL =
I have started this in a NEW thread called "Print RTF using tPRINTER class ?????"
Maybe someone will read the post and understand what I need to do. Maybe I'm just getting too old to do this, but the comments keep missing the point of my need. I wish I could express it better.
Maybe a fresh start on the RTF printing question will be helpful.
Tim
I have started this in a NEW thread called "Print RTF using tPRINTER class ?????"
Maybe someone will read the post and understand what I need to do. Maybe I'm just getting too old to do this, but the comments keep missing the point of my need. I wish I could express it better.
Maybe a fresh start on the RTF printing question will be helpful.
Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact: