ASousa Posted February 11, 2026 at 10:08 AM Report #635582 Posted February 11, 2026 at 10:08 AM Bom dia, Tenho um anexo que inseri no dossier numero 14 dos dossiers internos no modulo de documentos. Criei 1 botão no Painel para que esse anexo abra quando o painel o selecionar. Entretanto não consegui que funcione e escolhi um anexostamp especifico inserido por mim e nem assim funcionou. O Botão cira o pdf mas ele aquando a abertura da erro de ficheiro no Acrobat, google ou edge. Cria o doc no C:\PHC como mando. Podem ajudar ? LOCAL lcSql, lcFicheiro, lcBin, lnRet CURSORSETPROP("MapBinary", .T., 0) lcSql = ; "SELECT ltrim(rtrim(fname)) + '.' + ltrim(rtrim(fext)) AS arquivo, bdados AS conteudo " + ; "FROM anexos " + ; "WHERE anexosstamp = 'JAL26011456855,909553256'" u_sqlexec(lcSql, "curArq") SELECT curArq IF RECCOUNT("curArq") > 0 lcFicheiro = FORCEPATH(ALLTRIM(curArq.arquivo), "C:\PHC") lcBin = curArq.conteudo IF STRTOFILE(lcBin, lcFicheiro) > 0 DECLARE INTEGER ShellExecute IN shell32.dll ; INTEGER hwnd, STRING lpOperation, STRING lpFile, ; STRING lpParameters, STRING lpDirectory, INTEGER nShowCmd lnRet = ShellExecute(0, "open", lcFicheiro, "", "", 1) IF lnRet <= 32 MESSAGEBOX("Falha ao abrir o ficheiro. ShellExecute retorno=" + TRANSFORM(lnRet)) ENDIF ELSE MESSAGEBOX("Falha ao gravar o ficheiro em " + lcFicheiro) ENDIF ENDIF
pc.cesar Posted February 12, 2026 at 11:25 AM Report #635585 Posted February 12, 2026 at 11:25 AM o ficheiro é guardado na base de dados, ou numa pasta se for pasta, todos os computadores tem de ter acesso á pasta se estiver na BD deve extrair o ficheiro Parameters iduvaltsql gnfile = '' If u_sqlexecbin([select * from anexos where recstamp=']+ bo.bostamp +['], 'crAnexos') If Reccount('crAnexos') > 0 m.imagem = crAnexos.bdados gnfile = 'c:\PHC\' + Alltrim(crAnexos.fname) + '.' + Alltrim(crAnexos.fext) m.bindados = Strtofile(m.imagem, gnfile, 0) Endif Endif Return gnfile César Faria
ASousa Posted March 2, 2026 at 08:29 AM Author Report #635607 Posted March 2, 2026 at 08:29 AM Muito obrigada pela ajuda. Já consegui .
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now