Caro Francisco,
Não sei nem como agradecer.
Era exatamente isto que eu estava precisando, funcionou perfeitamente!

Muito obrigado,

Alessandro






From: "FRANCISCO FRANK" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [sqlwin] Passar imagem
Date: Wed, 27 Nov 2002 11:56:25 +0000


_________________________________________________________________
MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com
--- Begin Message ---
Alessandro não sei exatamente o q vc pretende mas a forma q uso para enviar imagem para um relatório é a seguinte:
No relatório
1- Declaro um input variavel com nome Symbol do tipo objecto
2- coloco uma figura (picture) no relatório
3- no input da figura declaro input variable symbol - Symbol é a varável criada.

No programa

1- crio a função picTo Report - Esta função existe no Sample do Centura

!!CB!! 134
Function: PicToReport
 Description: Accept a filename, report window handle and
   report object variable name
   and set that report object variable to the
   picture (a BMP) in the filename file.
 Returns
  Boolean:
 Parameters
  Window Handle: hWndRep
  String: sFileName
  String: sVariableName
 Static Variables
 Local variables
  Long String: sPicture
  Number: nPicLength
  File Handle: fhPictureFile
  Boolean: bRet
 Actions
  !
  ! This function opens the file with the desired picture
      and reads the picture into a string, then passes that
      to the passed report variable.
  !
  Call SalFileOpen(fhPictureFile, sFileName, OF_Read)
 ! ; Set nPicLength = SalFileRead(fhPictureFile, sPicture, 500000)
  Call SalFileClose(fhPictureFile)
  !
  Set bRet = SalReportSetObjectVar( hWndRep, sVariableName, sPicture)
  Return bRet

2- On SAM_ReportFetchInit - uso aquí por se tratar do lotipo da empresa. Se for imagem do empregado por exemplo, posso usar no On SAM_ReportFetchNext

! inserir o logotipo
Set hWndReport = hWndNULL
Set hWndReport = SalNumberToWindowHandle(wParam)
Call PicToReport(hWndReport, 'Logoemp.bmp', 'Symbol')
!
A imagém é Logoemp.bmp e uso na pasta onde o programa deve iniciar no meu caso é Centura. Vc pode usar uma variável com o nome da imagem à ser transportada para o relatório basta para tal fazer uma atribuição direita ou com um select, guardar o resultado em uma variável (nome_da_imagem) antes de chamar a função

"Call PicToReport(hWndReport, 'Logoemp.bmp', 'Symbol')"

Neste caso a última linha seria:

Call PicToReport(hWndReport, nome_da_imagem, 'Symbol')

Espero q isso te ajude



MSN Messenger: converse com os seus amigos online. Instale grátis. Clique aqui. ============================================== Lista de Centura SQLWindows Administrador : [EMAIL PROTECTED] [ http://www.centuraexplorer.com ] Para sair desta lista mande mensagem para: [EMAIL PROTECTED] sem nada no Subject e com o comando a seguir no corpo da msg: "unsubscribe sqlwin" (sem as aspas) ============================================== --- End Message ---

Responder a