Bom dia Alê,
Lembro de você em um evento do Fivewin que aconteceu em Minas, acho que no SESC, foi top aquele evento, por aqui tudo corrido e por ai ? tudo bem ?
Segue abaixo o exemplo, como eu disse não está 100% mas da para partir dai para fazer algo bem legal.
FUNCTION MyManualReport( cTXT2FR3 )
/*
Recebe por parâmetro o arquivo .txt ou .prn para mostrar na tela do fastreport
exemplo: c:\syg_temp\relatorio.txt
*/
local oFrPrn
IF !FILE(cTXT2FR3)
ShowMsg("Erro ao localizar o arquivo para impressão " +cTXT2FR3 )
RETURN(.F.)
ENDIF
oFrPrn := frReportManager():new()
//oFrPrn:LoadLangRes(PEGA_ARQUIVO_SAGI(1,.T.)) // aqui é o icone da tela
oFrPrn:PreviewOptions:SetShowCaptions(.T.)
oFrPrn:SetIcon(1001)
oFrPrn:SetTitle("Visualizador de Relatórios do Sistema.")
oFrPrn:StartManualBuild( { || MyManualReport2(oFrPrn,cTXT2FR3) }, FR_LANDSCAPE, , FR_PIXELS )
oFrPrn:PrepareReport()
oFrPrn:ShowPreparedReport()
oFrPrn:Clear()
oFrPrn:DestroyFR() // detona com o fastreporte e a dll da memoria.
oFrPrn:=nil
RETURN(.t.)
FUNCTION MyManualReport2(oFrPrn,cTXT2FR3)
/*
Exemplo de uso sem arquivo .FR3
*/
local tmp_Name:='', cText_ARQ:='', nLINES:=0, nA:=0, nINIT_LINE:=0, cIMPTEXT:=''
//local cLOGO:=ARQUIVOLOGOMARCA() // pega o logotipo do cliente para mostrar no relatorio
local cLOGO:=''
oFrPrn:SetDefaultFontProperty( "Name", "Arial" )
oFrPrn:SetDefaultFontProperty( "Size", 10 )
IF !EMPTY(cLOGO)
oFrPrn:PictureAt( cLOGO , 30, 200, 150, 150 )
nINIT_LINE:=300
ENDIF
cText_ARQ := memoread( cTXT2FR3 ) // carrega o TXT
nLINES := mlcount( cText_ARQ, 250 ) // total de linhas
FOR nA := 1 to nLINES
cLINE := MEMOLINE( cText_ARQ, 250, nA, 1, .F., .T. )
IF Left(AllTrim( cLine ), 1 ) == Chr( 15 ) .or. Left( AllTrim(cLine), 1 ) == Chr( 18 )
loop
ENDIF
If Left(AllTrim(cLine),1)==Chr(12) //SALTO DA PAGINA
LOOP
//oFrPrn:NewPage()
ENDIF
IF AT('[',cLine)>0 .OR. AT(']',cLine)>0
cLine:=Stuff(cLine, AT('[',cLine),1,'-')
cLine:=Stuff(cLine, AT(']',cLine),1,'-')
ENDIF
IF !EMPTY(ALLTRIM(cLINE))
//oFrPrn:MemoAt(cLINE, 100, (nA*100)+nINIT_LINE, 350, 50 )
nINIT_LINE:=0
cIMPTEXT:=cIMPTEXT+cLINE+CR_LF
//MemoAt(cStr, nLeft, nTop, nWidth, nHeight)
ENDIF
NEXT
oFrPrn:MemoAt(cIMPTEXT, 10, 350, 1500, 1500 )
* tmp_Name := oFrPrn:MemoAt( "Some memo with bottom frame ...", 30, 30, 300, 50 )
* oFrPrn:SetManualObjProperty( tmp_Name + ".Frame", "Typ", "[ftBottom]" )
// oFrPrn:LineAt( 30, 200, 100, 100 )
// oFrPrn:MemoAt( "<-- It's a some line ...", 200, 250, 350, 50 )
// oFrPrn:NewPage()
// oFrPrn:MemoAt( "It's a second page..................", 30, 30, 100, 1000 )
RETURN(.T.)