Salve Colegas. Estou precisando de uma ajuda. Numa rotina, eu criei uma child table e
estou tendo problemas quando tento exportar para um arquivo ou imprimir. O problema ocorre porque acrescentei
rotinas para inserir ou deletar linhas e quando essas ações são executadas a
table só imprime até o ponto onde houve o delete da linha. !!CB!! 114 Pushbutton: pbDELETAR
Message Actions
On SAM_Click
! Set nNewRow = SalTblSetRow ( tblPRODUTOS, nRowPos )
Call SalWaitCursor( TRUE )
! !
Set nNewRow = TBL_MinRow
While SalTblFindNextRow( tblPRODUTOS, nNewRow, ROW_Selected, ROW_Hidden )
Call SalTblDeleteRow( tblPRODUTOS, nNewRow, TBL_Adjust )
Set nNewRow = TBL_MinRow
! !
Call SalWaitCursor( FALSE ) !!CB!! 114 Pushbutton: pbArquivo
Message Actions
On SAM_Click
If IDNO = SalMessageBox( "Confirma a
exportação para arquivo? ", 'Mensagem',
MB_YesNo | MB_IconExclamation )
Return FALSE
If NOT fARQEXPORTA()
Call SalWaitCursor(FALSE )
Call SqlImmediate( 'ROLLBACK' )
Call SalMessageBox( 'NÃO foi possivel exportar
Arquivo’,'ERRO', MB_Ok|MB_IconExclamation )
Return FALSE
Call SalMessageBox( 'O Arquivo foi gerado com sucesso...','MENSAGEM',
MB_Ok|MB_IconExclamation ) !!CB!! 278 Function:
fARQEXPORTA
!!!
Actions
Set nFvaCONTLINHA = 0
Set sAvaDIRS = "C:\\FISCO\\"
! !!
! !!
Set dtDTHOJE = fDATAZERO( SalDateCurrent( ) )
Set aARQ = aDIRA || 'FIS' || fFill( SalDateDay( dtDTHOJE ), 2) ||
fFill( SalDateMonth( dtDTHOJE ), 2) || SalNumberToStrX(
nSEQDIA, 0) || '.txt'
Set sNMARQ = SalStrRightX( sARQ, SalStrLength( sARQ ) - SalStrLength( aDIRA )
)
!!!
! !!!
If NOT SalFileOpen( hARQ, aARQ, OF_Create | OF_Write )
Call SalWaitCursor( FALSE )
Call SalMessageBox( "Não foi possível abrir o arquivo de
exportação.", "Erro", MB_IconStop )
Return FALSE
Set nSEQLINHA = 0
Set sSTR = ""
Set sSTR = sSTR || "100713060600019077843442
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
RJ0000000000"
Set sSTR = sSTR || SalFmtFormatDateTime( dfDATA, "yyyyMMdd" )
Set sSTR = sSTR || SalFmtFormatDateTime( dfDATAFIM, "yyyyMMdd" )
Set sSTR = sSTR || "331"
Call SalFilePutStr( hARQ, sSTR )
Set nCONTLINHA = nCONTLINHA + 1
Set sSTR = ""
Set sSTR = sSTR || "11Rua
xxxxxxxxxxxxxxxxx
00110SL, Ljs 25 e 27 xxxxxxxxxxxxx Vieira da
Silva Neto 00xxxxxx"
Call SalFilePutStr( hARQ, sSTR )
Set nCONTLINHA = nCONTLINHA + 1
Set nTOTREG = 0
Set nTOTAUX = 0
Set nCONTLINHA = 0
! !!
Call SalTblSortRows( tblPRODUTOS, 8, TBL_SortIncreasing )
! !!
While SalTblSetContext( tblPRODUTOS, nWvaCONTLINHA )
! !!
! !!
Set sFvaSTR = ""
Set sFvaSTR = sSTR || "50"
Set sFvaSTR
= sSTR || fDPadZero( fSONUMERO1( tblPRODUTOS.Cnpj ), 14
)
!!! POSICAO 221/234
Set sFvaSTR = sSTR || fPadBranco(SalStrLeftX( tblPRODUTOS.Insc, 14 ), 14)
Set sFvaSTR = sSTR || SalFmtFormatDateTime( tblPRODUTOS.Dtemiti,
"yyyyMMdd" )
Set sFvaSTR = sSTR || SalStrTrimX(tblPRODUTOS.Uf)
Set sFvaSTR = sSTR || "01 "
Set sFvaSTR = sSTR || SalStrRightX( tblPRODUTOS.Numero, 6 )
Set sFvaSTR = sSTR || SalStrTrimX(tblPRODUTOS.Cfop)
Set sFvaSTR = sSTR || "P"
Set sFvaSTR = sSTR || fFill( tblPRODUTOS.Vltotal, 13 )
Set sFvaSTR = sSTR ||
fFill( tblPRODUTOS.Base, 13 )
Set sFvaSTR = sSTR || fFill( tblPRODUTOS.Vlicms, 13 )
Set sFvaSTR = sSTR || SalStrRepeatX( "0", 13 )
Set sFvaSTR = sSTR || SalStrRepeatX( "0", 13 )
! Set sFvaSTR = sSTR || tblPRODUTOS.Aliquota
Set sFvaSTR = sSTR || "2600N"
Call SalFilePutStr( hARQ, sSTR )
Set dtFvaDTHOJE = fDATAZERO( SalDateCurrent( ) )
Set dtFvaHRHOJE = SalDateCurrent( )
Set nTOTREG = nTOTREG + 1
Set nTOTAUX = nTOTAUX + 1
Set nCONTLINHA = nCONTLINHA + 1
Set nSEQLINHA = nSEQLINHA + 1
Set sSTR = ""
Set sSTR = sFvaSTR || "900713060600019077843442
50"
Set sSTR = sFvaSTR || fFill( nFvaSEQLINHA, 8 )
Set sSTR = sFvaSTR || "99"
Set sSTR = sFvaSTR || fFill( nFvaSEQLINHA+3, 8 )
Set sSTR = sFvaSTR || SalStrRepeatX( " ", 75 )
Set sSTR = sFvaSTR || "1"
Call SalFilePutStr( hARQ, sSTR )
Set nCONTLINHA = nCONTLINHA + 1
Call SalFileClose( hARQ )
Return TRUE Agradeço se alguem puder me orientar no
que estou fazendo de errado. Grato [[]] Ledo |
- [sqlwin] Livro no Blog. Leandro Neves
- Re: [sqlwin] Livro no Blog. Marcelo Guimarães
- [sqlwin] Child Table pela metade <<ledo>>