MMK wrote:Where to lay out or send this file?
Wich file?
MMK wrote:Where to lay out or send this file?
MMK wrote://You made everything well. Small inaccuracies. There is a working example
#INCLUDE "FiveWin.ch"
#include "richtext.ch"
******************
Function RftDemo()
**********************
Local anchos,j,lFormato:=.F.
//Local Mas_n:={}
local aTable:={}
local nRow,ncol
Local oRtf,aMarca, cOutFile :="Plata.RTF", Sob1
Local aFldNames:= {" Ok ", " 2", " 3", "4","5","6", "7", "8", "9"}
AaDd(aTable,{1,,23,,44,,61,,80} )
AaDd(aTable,{,16,,36,,59,68,,89} )
AaDd(aTable,{,,28,,49,58,,71,84} )
oRTF := SetRT( cOutFile )
NEW PARAGRAPH oRTF TEXT "Sample RTF Output" ;
FONTNUMBER 1 ;
APPEARANCE BOLD_ON+ITALIC_OFF+CAPS_OFF;
FONTSIZE 12 ;
ALIGN CENTER ;
SPACEBEFORE .12 ;
SETDEFAULT
NEW PARAGRAPH oRTF TEXT "" ;
APPEARANCE BOLD_OFF+ITALIC_OFF+CAPS_OFF
SETDATE oRtf FORMAT LONGFORMAT
NEW PARAGRAPH oRTF TEXT "" SETDEFAULT
aMarca=ARRAY(9)
AFILL(aMarca,0)
DEFINE NEWTABLE oRTF ; // Specify the RTF object
ALIGN CENTER ; // Center table horizontally on page
FONTNUMBER 1 ; // Use font #2 for the body rows
FONTSIZE 10 ; // Use 9 Pt. font for the body rows
CELLAPPEAR BOLD_OFF ; // Normal cells unbolded
CELLHALIGN LEFT ; // Text in normal cells aligned left
COLUMNS 9 ; // Table has n Columns
CELLWIDTHS {0.4,0.5,0.5,0.8,0.9,0.9,0.9,0.5,0.5} ; // Array of column widths
ROWHEIGHT .2 ; // Minimum row height is .25"
CELLBORDERS SINGLE ; // Outline cells with thin border
COLSHADE aMarca; // Sombras en columnas
HEADERROWS 1; // dos lineas de titulos
HEADER aFldNames;
HEADERFONTSIZE 10;
HEADERAPPEAR BOLD_ON;
HEADERHALIGN CENTER //;
DEFINE CELL FORMAT oRTF ;
CELLSHADE aMarca
lFormato:=.F.
For nRow= 1 to Len(aTable)
FOR nCol := 1 TO oRTF:nTblColumns
WRITE NEWCELL oRTF TEXT aTable[nRow][nCol] ALIGN CENTER
NEXT
next
END TABLE oRTF
CLOSE RTF oRtf
/*
Go top
Puti:=MSWORD_PATH()
WinExec(puti+" "+ cOutFile)
*/
Return .T.
**************************************
FUNCTION SetRT(cOutFile)
**************************************
LOCAL oRTF
Public oPrinter,aSize
DEFINE RTF oRTF FILE cOutFile ;
FONTS "Times New Roman", "Courier New", "Arial Cyr" ;
FONTFAMILY "froman","fswiss","fmodern";
CHARSET 0,0,10;
FONTSIZE 8 ;
TWIPFACTOR 1440
oRTF:lTrimSpaces := .T.
DEFINE PAGESETUP oRTF MARGINS 0.5,0.5, 0.3, 0.3 ; // ---, ---, сверху,----
ALIGN TOP ;
PAGEWIDTH 8.5 ;
PAGEHEIGHT 11
RETURN oRTF
Progetto: demommk, Ambiente: bcc7Harbor:
[1]:Harbour.Exe demommk.prg /m /n0 /gc1 /es2 /a /iC:\work\HARBOUR\Include /jC:\work\errori\RICHTE~1\I18n\Main.hil /iinclude;c:\work\fwh\include;C:\work\HARBOUR\include /oObj\demommk.c
Harbour 3.2.0dev (r2008190002)
Copyright (c) 1999-2020, https://harbour.github.io/
Compiling 'demommk.prg'...
demommk.prg(31) Error E0030 Syntax error "syntax error at 'ORTF'"
demommk.prg(53) Error E0030 Syntax error "syntax error at 'NEWTABLE'"
demommk.prg(56) Error E0030 Syntax error "syntax error at 'CELL'"
demommk.prg(61) Error E0030 Syntax error "syntax error at 'NEWCELL'"
demommk.prg(66) Error E0030 Syntax error "syntax error at 'TABLE'"
demommk.prg(86) Error E0030 Syntax error "syntax error at 'RTF'"
demommk.prg(96) Error E0020 Incomplete statement or unbalanced delimiters
demommk.prg(98) Error E0030 Syntax error "syntax error at '11'"
demommk.prg(99) Error E0030 Syntax error "syntax error at 'JAN'"
9 errors
No code generated.
MMK wrote:Let's begin with the last question
1. Mistakes
You have an old version of richtext
2. single rtf and six files
The END TABLE oRTF team closes the table, but does not close the file.
Therefore you just continue to fill out the file
If it is necessary - oRtf:NewPage(), and -
NEW PARAGRAPH oRTF TEXT....
..........................
DEFINE NEWTABLE oRTF;...
..............
END TABLE oRTF
............
And so all tables.
The CLOSE RTF oRtf team closes the file
3.Wich file?
Fresher version of richtext
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 84 guests