EASYREPORT and RTF

EASYREPORT and RTF

Postby Otto » Wed May 23, 2018 10:13 am

RTF inside EASYREPORT would be so great.

I have the need to print RTF text inside my EasyReports.
It seems that RTF is not supported.

To all class experts

Where should I try to extend the class. Is this the right way.

METHOD PrintItem( nArea, nItemID, cValue, nAddToTop, lMemo, nEntry ) CLASS VRD

Should I try with


IF oItem:cType = "TEXT" .AND. oItem:nShow = 1
cText := ::EvalExpression( oItem:cText )

ELSEIF oItem:cType = "IMAGE" .AND. oItem:nShow = 1

//NEW
ELSEIF oItem:cType = "RTF" .AND. oItem:nShow = 1

Endif


Maybe someone has done it and can share his code.

Best regards,
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6020
Joined: Fri Oct 07, 2005 7:07 pm

Re: EASYREPORT and RTF

Postby cnavarro » Wed May 23, 2018 11:20 am

Otto
I do not find EvalExpression in my version
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
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: EASYREPORT and RTF

Postby Otto » Wed May 23, 2018 12:24 pm

Dear Cristobal,

RTF as far as I see is not integrated in EasyReport.
But as I need to print some RTF text on a report along the normal text labels I thought of enhancing.

Maybe we can extend the
METHOD PrintItem in CLASS VRD of vrd.prg.

I saw a RTF example from you.
In this example you check in
Static Function SayMemo( lBox )

if Left( cText, 5 ) == "{\rtf"
lRTF := .T.
endif

if !lRTF

Endif

If a text is a RTF text.

I thought we could check in
Vrf.prg METHOD PrintItem() of CLASS VRD


IF oItem:cType = "TEXT" .AND. oItem:nShow = 1

cText := ::EvalExpression( oItem:cText )
IF .NOT. EMPTY( oItem:cSource ) .AND. ::lNoExpr = .F.
cText := ::EvalSourceCode( oItem:cSource )
ENDIF

if Left( cText, 5 ) == "{\rtf"
lRTF := .T.
endif

if !lRTF
************************************
Here we could handle the RTF printing.
************************************

Endif

But how can I print a RTF file.
Is Reinaldos suggestion on the forums the way to go?

viewtopic.php?f=3&t=25805&p=141190&hilit=RePrintBox#p141190


Thank you in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6020
Joined: Fri Oct 07, 2005 7:07 pm

Re: EASYREPORT and RTF

Postby cnavarro » Wed May 23, 2018 12:51 pm

Dear Otto
Yes, this is the function for print RTF text
Or REPrintBox5 for new version of RICHEDIT control
But, what are the EvalExpression and EvalSourceCode methods ?
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
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: EASYREPORT and RTF

Postby Otto » Wed May 23, 2018 2:03 pm

Dear Cristobal,
I send you the copy I use.
Here I have a
METHOD EvalSourceCode( cSource )
METHOD EvalExpression( cText )
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6020
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 23 guests