FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Printing a memo field
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Printing a memo field
Posted: Thu Feb 17, 2011 07:56 PM

I've tried a number of ways but can't get it right.
I have a memo field with a bunch of lines and I need to print it with each line displayed.
Help.

Thank you

Harvey
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Printing a memo field
Posted: Thu Feb 17, 2011 10:28 PM

::oApt:aptnot is a memo field in a database.

// Print comment text
    nLinCnt := MLCOUNT( ::oApt:aptnot, 80,, .t. )
    IF nLinCnt > 0
        nRow += 1.5 * nRsp
        FOR lx := 1 TO nLinCnt
            PAGEHEAD( oPrn, aHead )
            oPrn:Say( nRow, 4 * nCsp, MEMOLINE( ::oApt:aptnot, 80, lx,, .t. ), oFcond )
            nRow += nRsp
        NEXT
    ELSE
        nRow += nRsp
    ENDIF
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
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Printing a memo field
Posted: Fri Feb 18, 2011 01:40 AM
Thanks Tim for the help. Not working.

Heres the code but not printing/
Print.ch and report.ch are set.


Code (fw): Select all Collapse
unction prnMemo(cMemo4)
   local nPixel 
   local linum := 1,xCol := 1
   local nRow   := 1
   local nRsp,nCsp,say
   local oReport, oPrn, oPen1
   local oFcond,lx   

   DEFINE FONT oFont1 NAME "Arial"  SIZE 12,10 of oPrn
    
   PRINT oPrn NAME "Salesbyproduct" 
   prnlandscape()
ENDPRINT

PRINT oPrn NAME "Up Your Cash Flow - Sales by Product" //PREVIEW    

nRSp := oPrn:nVertRes() / 50   
nCSp := oPrn:nHorzRes() / 180   

nLinCnt := MLCOUNT(cMemo4, 80,, .t. )
IF nLinCnt > 0
nRow += 1.5 * nRsp
FOR lx := 1 TO nLinCnt
 oPrn:Say( nRow, 4 * nCsp, MEMOLINE(cMemo4 , 80, lx,, .t. ),oFont1  )
nRow += nRsp
NEXT
ELSE
nRow += nRsp
ENDIF

return nil
Thank you

Harvey
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Printing a memo field
Posted: Fri Feb 18, 2011 05:34 AM

Harvey

oprn:startpage() and oprn:endpage() are missing

Hth

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Printing a memo field
Posted: Fri Feb 18, 2011 05:42 AM

Thanks
So simple. Works..

Thank you

Harvey

Continue the discussion