

LOC:DataFinal = Date(Month(LOC:DataInicial) + 1 , 1 , Year(LOC:DataInicial)) - 1
Exemplo básico de leitura de um arquivo XLS, criando uma Queue
SETCURSOR(CURSOR:Wait)
?Excel{PROP:Create} = 'Excel.VBAModule'
?Excel{PROP:DoVerb} = -2
?Excel{'Application.Application.Visible'} = FALSE
?Excel{'Application.Workbooks.Open("'& NomeArquivoPlanilha &'")'}
?Excel{'Application.Sheets.Item('& QualPlanilha &').Select'}
DISPLAY
?Excel{'Application.Range("A1").Select'} !Selecionar a Celula A1
?Excel{'Application.Selection.SpecialCells(11).Select'} !Selecionar a ultima linha da planilha
end# = ?Excel{'Application.Selection.Row'} !Pegar o numero da ultima linha da planilha
?Excel{'Application.Range("A1").Select'}
FREE(QFilial)
?Excel{'Application.Range("A1").Select'} !Verifica se é para ler a legenda
IF CLIP(?Excel{'Application.ActiveCell.Value'}) = 'LEGENDA'
?Excel{'Application.Range("A2").Select'}
IF CLIP(?Excel{'Application.ActiveCell.Value'}) = 'Filial'
LOOP IX# = 3 TO end# !Iniciar na linha 3 até a ultima linha
?Excel{'Application.Range("A' & IX# & '").Select'}
IF NOT CLIP(?Excel{'Application.ActiveCell.Value'}) > 0 THEN BREAK. !Verificando se a celula está sem valor,
QF:CodFilial = CLIP(?Excel{'Application.ActiveCell.Value'}) !Pegar o valor da celular selecionada
QF:Cor = ?Excel{'Application.Selection.Interior.ColorIndex'} !Pegar a cor da celular selecionada
ADD(QCoresFilial)
END
END
END
Se você possui o Clarion 6 versão Enterprise ou comprou separadamente os templates de Relatórios avançados, pode gerar um relatório diretamente para um arquivo PDF, sem que o usuário precise acessar a opção no menu de Visualização. Para fazer isto, uma vez habilitado o uso do Template, na extensão local do relatório, na guia General, configure o output name type para uma variável, e crie uma variável local que receberá o nome do relatorio, por exempo: LOC:Relpdf, do tipo sring com 256 caracteres. A variável pode ser selecionada para a extensão, uma vez que tenha sido criada.
Nas propriedades do Relatório, na giua Report Targets, selecione Report Target como Other, e Other Target como PDF.
Nas opções do Preview, configure o Skip Preview como True.
No embed Begining of Procedure After Opening Files, defina o nome do relatório.
O relatório será impresso diretamente para um PDF, sem que o usuário precise intervir.
_________________
Julio César Pedroso é analista desenvolvedor Clarion. Programa em Clarion, Windev, c# e PlPgsql. Atualmente desenvolve projetos na empresa Pedroso Informática, www.pedrosoinformatica.com.br e trabalha com a ferramenta Visual Studio 2005
PROGRAM
!--------------------------------------------------------------------------
! AUTHOR: Larry Sand
! Sample program to illustrate the use of PlaySound() API to play
! a wave file from disk and linked as a resource of the program.
!
! This program requires the Drum.wav file from the Clarion event manager
! example program. It also requires that the Drum.wav file be converted to
! a resource and linked into the program for the SND_RESOURCE version of the
! API call to work.
!
! The WavRes.RC contains a sample script to create the .RES for this project.
!---------------------------------------------------------------------------
MAP
MODULE('Win32')
PlaySound(*CSTRING pszSound, UNSIGNED hMod, UNSIGNED fdwSound),BOOL, PROC, PASCAL, RAW, NAME('PlaySoundA')
END
END
SND_NOWAIT EQUATE(002000h) !0x00002000L /* don't wait if the driver is busy */
SND_ALIAS EQUATE(010000h) !0x00010000L /* name is a registry alias */
SND_ALIAS_ID EQUATE(110000h) !0x00110000L /* alias is a predefined ID */
SND_FILENAME EQUATE(020000h) !0x00020000L /* name is file name */
SND_RESOURCE EQUATE(040004h) !0x00040004L /* name is resource name or atom */
WaveFileName CSTRING(257)
CODE
WaveFileName = 'Drum.wav'
IF PlaySound(WaveFileName, 0, SND_FILENAME)
MESSAGE('Played wav file from disk')
END
WaveFileName = 'DRUMROLL'
IF PlaySound(WaveFileName, SYSTEM{PROP:AppInstance}, SND_RESOURCE)
MESSAGE('Played wav file linked as a resource')
END