Error al

HMG en Español

Moderator: Rathinagiri

Post Reply
alfaqui
Posts: 11
Joined: Wed Oct 17, 2018 4:49 am
DBs Used: DBF

Error al

Post by alfaqui »

Hola a Todos,
Encontré un ejemplo de como enviar información de una dbf a word, el cual me parece espectacular. Dicho ejemplo funciona muy bien el problema es que al hacerle modificaciones me presenta el error :
"Lo sentimos. No se puede abrir el documento creado porque existe un problema con el contenido"

1. Cree el archivo .rtf en wordpad como lo recomiendan
2. Uso el Hmg 3.44
3. uso word 2016
4. El Windows que utilizo es 7 Profesional

Le agradezco su colaboración
alfaqui
Posts: 11
Joined: Wed Oct 17, 2018 4:49 am
DBs Used: DBF

Re: Error al

Post by alfaqui »

Anexo archivo
Attachments
Foro.rar
(3.08 MiB) Downloaded 146 times
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: Error al

Post by SALINETAS24 »

Hola alfaqui.., creo que MEMOWRIT no graba en formato .RTF.

Dale un vistazo a este enlace para Harbour.

https://vivaclipper.wordpress.com/2014/02/12/trtf/

Y en HMG puedes usar RICHEDITBOX. Yo creo que podrías definir el control, mantenerlo oculto, cargar tu variable en el RICHEDITBOX y acto seguido guardarla en formato ".RTF"
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
alfaqui
Posts: 11
Joined: Wed Oct 17, 2018 4:49 am
DBs Used: DBF

Re: Error al

Post by alfaqui »

hola a todos,
El Ejemplo que hablo es para MiniGui Extended lo encontré en este enlace http://hmgforum.com/viewtopic.php?t=1247 no soy muy bueno pero estoy practicando todos los días para mejorar viendo los ejemplos que encuentro.

Hay alguna posibilidad de usar este ejemplo con HMG minigui ya que esto es lo que estoy necesitando.

****
Hi everyone,
The example I speak is for MiniGui Extended I found it on this link http://hmgforum.com/viewtopic.php?t=1247 I am not very good but I am practicing every day to improve seeing the examples I find.

Is there any possibility to use this example with HMG minigui since this is what I am needing
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Error al

Post by AUGE_OHR »

the Dbf2Word.RAR Sample also use MEMOREAD() so it is the same Problem when got CHR(26)

you need to use low level function to read those data

Code: Select all

#include "Fileio.ch" 
 
PROCEDURE Main(cFile)    
LOCAL cData
   IF FILE((cFile)    
      cData := LowLevelRead(cFile)
and this function to read

Code: Select all

FUNCTION LowLevelRead(cFile)
LOCAL nHandle, cBuffer

   nHandle := FOpen(cFile, FO_READWRITE+FO_DENYWRITE) 
   nEnd := FSeek(nHandle, 0 , FS_END ) 
   cBuffer := SPACE(nEnd)

   FSeek( aFile[F_HANDLE], 0 , FS_SET ) 
   FRead( nHandle, @cBuffer)
   FClose( nHandle)
RETURN cBuffer
have fun
Jimmy
Post Reply