SlideShare una empresa de Scribd logo
1 de 2
#INCLUDE "rwmake.ch"
#INCLUDE "topconn.ch"
#INCLUDE "totvs.ch"
#INCLUDE "shell.ch"
#include "Fileio.ch"
User Function fContratos(cAlias,nReg,nOpc)
      Local _nI,nArq
      local oDlg, oTIBrowser, oBtnNav, oBtnPrint, oBtnHome
      Local cConteudo   := ""
      Local aButtons          := {}
      Local _cArquivo   := ""
      Local _cNomeArquivo := ""
      Local _cEstilo          :=""
      Local _cBody            :=""
      aSize := MsAdvSize()

     _cNomeArquivo:= lower("contrato"+SZD->ZD_CONTRATO+".html")
     _cArquivo := GetSrvProfString("Startpath","")+"contratos/"+_cNomeArquivo

      _cEstilo := '<style>'+chr(13)+chr(10)
      _cEstilo += 'body,table,td {font-family: Arial; font-size: 10pt; text-
align: justify;white-space: normal}'+chr(13)+chr(10)
      _cEstilo += 'p { page-break-after: always }'+chr(13)+chr(10)
      _cEstilo += '.estilo1 {font-size: 10pt; text-align: center; border-
top:1px solid #808080; border-bottom:1px solid #808080;font-weight:
bold;}'+chr(13)+chr(10)
      _cEstilo += '.estilo2 {font-size: 9pt; text-align: right; border-
bottom:1px solid #808080}'+chr(13)+chr(10)
      _cEstilo += '.estilo3 {font-size: 9pt; text-align: center; border-
bottom:1px solid #808080}'+chr(13)+chr(10)
      _cEstilo += '.estilo4 {font-size: 9pt; text-align: left; border-
bottom:1px solid #808080}'+chr(13)+chr(10)
      _cEstilo += '</style>'

      _cBody    := '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">'+chr(13)+chr(10)
      _cBody        += '<html>'+chr(13)+chr(10)
      _cBody        += '<head>'+chr(13)+chr(10)
      _cBody        += '<title> '+ALLTRIM(SZD->ZD_DESCRIC)+'
</title>'+chr(13)+chr(10)
      _cBody        += '<meta http-equiv="Content-Language" content="pt-
br">'+chr(13)+chr(10)
      _cBody        += '<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">'+chr(13)+chr(10)
      _cBody        += _cEstilo+chr(13)+chr(10)
      _cBody        += '</head>'+chr(13)+chr(10)
      _cBody        += '<body>'+chr(13)+chr(10)
      _cBody        += '<table border="0" width="100%" style=" background-color:
#FFFFFF" cellpadding="5" cellspacing="2">'+chr(13)+chr(10)


      nArq := FCreate( _cArquivo, 0 )
      FWrite( nArq , _cBody )
    dbSelectArea("SZE")
    SZE->(dbSetOrder(1))
    SZE->(dbGoTop())
    SZE->(dbSeek(xFilial("SZE")+SZD->ZD_CODIGO))
      while !SZE->(Eof())
            FWrite( nArq , "<tr><td><b>"+SZE-
>ZE_TITULO+"</b><br><br>"+AlteraDados(SZE->ZE_TEXTO,"")+"</td></tr>" )

           SZE->(DbSkip())
     enddo
     dbCloseArea("SZE")
FWrite( nArq , '<table></body></html>' )
     fClose( nArq )

      DEFINE MSDIALOG oDlg FROM aSize[1], aSize[2] TO aSize[6], aSize[5] PIXEL
TITLE "Impressão de Contratos"
            DEFINE BUTTONBAR _oBar2 SIZE 25,25 3D TOP OF oDlg
            DEFINE BUTTON _oBtnOk RESOURCE "IMPRESSAO" OF _oBar2 ACTION
Processa({||oTIBrowser:Print()}) PROMPT "Imprimir" TOOLTIP "Imprimir"
            DEFINE BUTTON _oBtnCanc RESOURCE "CANCEL" OF _oBar2 ACTION ::End()
PROMPT "Fechar" TOOLTIP "Fechar"
            _oBar2:bRClicked:={||AllwaysTrue()}
            oTIBrowser:= TIBrowser():New( 10,10, aSize[6], aSize[5],
_cArquivo,oDlg )
      oTIBrowser:Align := CONTROL_ALIGN_ALLCLIENT
      ACTIVATE MSDIALOG oDlg CENTERED


Return

Más contenido relacionado

La actualidad más candente

ランダム文字ぽいものをつくる
ランダム文字ぽいものをつくるランダム文字ぽいものをつくる
ランダム文字ぽいものをつくるTetsuji Koyama
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora 3camp
 
ORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricksORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricksDmytro Istratkin
 
3分くらいで分かるassert()
3分くらいで分かるassert()3分くらいで分かるassert()
3分くらいで分かるassert()Ippei Ogiwara
 
The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 46 of 202The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 46 of 202Mahmoud Samir Fayed
 
JavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauJavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauReact London 2017
 
Hadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and PigHadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and PigTomasz Bednarz
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 51 of 210
The Ring programming language version 1.9 book - Part 51 of 210The Ring programming language version 1.9 book - Part 51 of 210
The Ring programming language version 1.9 book - Part 51 of 210Mahmoud Samir Fayed
 
New text document
New text documentNew text document
New text documentPavel111212
 
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212Mahmoud Samir Fayed
 
MongoDBと位置情報 ~地理空間インデックスの紹介
MongoDBと位置情報 ~地理空間インデックスの紹介MongoDBと位置情報 ~地理空間インデックスの紹介
MongoDBと位置情報 ~地理空間インデックスの紹介Koji Iwazaki
 
Ch3(working with file)
Ch3(working with file)Ch3(working with file)
Ch3(working with file)Chhom Karath
 
Not Really PHP by the book
Not Really PHP by the bookNot Really PHP by the book
Not Really PHP by the bookRyan Kilfedder
 
MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.Nurul Ferdous
 
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드Taeho Kim
 

La actualidad más candente (19)

ランダム文字ぽいものをつくる
ランダム文字ぽいものをつくるランダム文字ぽいものをつくる
ランダム文字ぽいものをつくる
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora
 
R code
R codeR code
R code
 
ORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricksORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricks
 
3分くらいで分かるassert()
3分くらいで分かるassert()3分くらいで分かるassert()
3分くらいで分かるassert()
 
Git as NoSQL
Git as NoSQLGit as NoSQL
Git as NoSQL
 
Cracking for the Blue Team
Cracking for the Blue TeamCracking for the Blue Team
Cracking for the Blue Team
 
The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 46 of 202The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 46 of 202
 
JavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher ChedeauJavaScript Code Formatting With Prettier by Christopher Chedeau
JavaScript Code Formatting With Prettier by Christopher Chedeau
 
Hadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and PigHadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and Pig
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
 
The Ring programming language version 1.9 book - Part 51 of 210
The Ring programming language version 1.9 book - Part 51 of 210The Ring programming language version 1.9 book - Part 51 of 210
The Ring programming language version 1.9 book - Part 51 of 210
 
New text document
New text documentNew text document
New text document
 
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212
 
MongoDBと位置情報 ~地理空間インデックスの紹介
MongoDBと位置情報 ~地理空間インデックスの紹介MongoDBと位置情報 ~地理空間インデックスの紹介
MongoDBと位置情報 ~地理空間インデックスの紹介
 
Ch3(working with file)
Ch3(working with file)Ch3(working with file)
Ch3(working with file)
 
Not Really PHP by the book
Not Really PHP by the bookNot Really PHP by the book
Not Really PHP by the book
 
MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.
 
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
(안드로이드 개발자를 위한) 오픈소스 라이브러리 사용 가이드
 

Similar a Fcontratos

The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196Mahmoud Samir Fayed
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
The Ring programming language version 1.9 book - Part 53 of 210
The Ring programming language version 1.9 book - Part 53 of 210The Ring programming language version 1.9 book - Part 53 of 210
The Ring programming language version 1.9 book - Part 53 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31Mahmoud Samir Fayed
 
Writing DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfWriting DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfJason Garber
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202Mahmoud Samir Fayed
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivityMouli Chandira
 
The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31Mahmoud Samir Fayed
 
ELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardGeorg Sorst
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)zahid-mian
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensionserwanl
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomerzefhemel
 
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184Mahmoud Samir Fayed
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
 

Similar a Fcontratos (20)

Books
BooksBooks
Books
 
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196
 
Md5 decrypter
Md5 decrypterMd5 decrypter
Md5 decrypter
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
The Ring programming language version 1.9 book - Part 53 of 210
The Ring programming language version 1.9 book - Part 53 of 210The Ring programming language version 1.9 book - Part 53 of 210
The Ring programming language version 1.9 book - Part 53 of 210
 
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31
 
Writing DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfWriting DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby Conf
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
 
The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31
 
ELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboard
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)
 
Mongo db dla administratora
Mongo db dla administratoraMongo db dla administratora
Mongo db dla administratora
 
Convidar para page !!
Convidar para page !!Convidar para page !!
Convidar para page !!
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
mobl presentation @ IHomer
mobl presentation @ IHomermobl presentation @ IHomer
mobl presentation @ IHomer
 
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212
 

Fcontratos

  • 1. #INCLUDE "rwmake.ch" #INCLUDE "topconn.ch" #INCLUDE "totvs.ch" #INCLUDE "shell.ch" #include "Fileio.ch" User Function fContratos(cAlias,nReg,nOpc) Local _nI,nArq local oDlg, oTIBrowser, oBtnNav, oBtnPrint, oBtnHome Local cConteudo := "" Local aButtons := {} Local _cArquivo := "" Local _cNomeArquivo := "" Local _cEstilo :="" Local _cBody :="" aSize := MsAdvSize() _cNomeArquivo:= lower("contrato"+SZD-&gt;ZD_CONTRATO+".html") _cArquivo := GetSrvProfString("Startpath","")+"contratos/"+_cNomeArquivo _cEstilo := '<style>'+chr(13)+chr(10) _cEstilo += 'body,table,td {font-family: Arial; font-size: 10pt; text- align: justify;white-space: normal}'+chr(13)+chr(10) _cEstilo += 'p { page-break-after: always }'+chr(13)+chr(10) _cEstilo += '.estilo1 {font-size: 10pt; text-align: center; border- top:1px solid #808080; border-bottom:1px solid #808080;font-weight: bold;}'+chr(13)+chr(10) _cEstilo += '.estilo2 {font-size: 9pt; text-align: right; border- bottom:1px solid #808080}'+chr(13)+chr(10) _cEstilo += '.estilo3 {font-size: 9pt; text-align: center; border- bottom:1px solid #808080}'+chr(13)+chr(10) _cEstilo += '.estilo4 {font-size: 9pt; text-align: left; border- bottom:1px solid #808080}'+chr(13)+chr(10) _cEstilo += '</style>' _cBody := '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'+chr(13)+chr(10) _cBody += '<html>'+chr(13)+chr(10) _cBody += '<head>'+chr(13)+chr(10) _cBody += '<title> '+ALLTRIM(SZD->ZD_DESCRIC)+' </title>'+chr(13)+chr(10) _cBody += '<meta http-equiv="Content-Language" content="pt- br">'+chr(13)+chr(10) _cBody += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'+chr(13)+chr(10) _cBody += _cEstilo+chr(13)+chr(10) _cBody += '</head>'+chr(13)+chr(10) _cBody += '<body>'+chr(13)+chr(10) _cBody += '<table border="0" width="100%" style=" background-color: #FFFFFF" cellpadding="5" cellspacing="2">'+chr(13)+chr(10) nArq := FCreate( _cArquivo, 0 ) FWrite( nArq , _cBody ) dbSelectArea("SZE") SZE->(dbSetOrder(1)) SZE->(dbGoTop()) SZE->(dbSeek(xFilial("SZE")+SZD->ZD_CODIGO)) while !SZE->(Eof()) FWrite( nArq , "<tr><td><b>"+SZE- >ZE_TITULO+"</b><br><br>"+AlteraDados(SZE->ZE_TEXTO,"")+"</td></tr>" ) SZE->(DbSkip()) enddo dbCloseArea("SZE")
  • 2. FWrite( nArq , '<table></body></html>' ) fClose( nArq ) DEFINE MSDIALOG oDlg FROM aSize[1], aSize[2] TO aSize[6], aSize[5] PIXEL TITLE "Impressão de Contratos" DEFINE BUTTONBAR _oBar2 SIZE 25,25 3D TOP OF oDlg DEFINE BUTTON _oBtnOk RESOURCE "IMPRESSAO" OF _oBar2 ACTION Processa({||oTIBrowser:Print()}) PROMPT "Imprimir" TOOLTIP "Imprimir" DEFINE BUTTON _oBtnCanc RESOURCE "CANCEL" OF _oBar2 ACTION ::End() PROMPT "Fechar" TOOLTIP "Fechar" _oBar2:bRClicked:={||AllwaysTrue()} oTIBrowser:= TIBrowser():New( 10,10, aSize[6], aSize[5], _cArquivo,oDlg ) oTIBrowser:Align := CONTROL_ALIGN_ALLCLIENT ACTIVATE MSDIALOG oDlg CENTERED Return