Page 1 of 2
Imprimir acentos y ñ Ñ
Posted: Sat Jul 11, 2026 10:34 pm
by jorge.posadas
Grupo,
Por fin he podido imprimir acentos y letras ñ y Ñ pero eso sucede cuando imprimo así:
@ 30,20 HPDFPRINT "letras acentuadas Á É Í Ó Ú Ñ á é í ó ú ñ " ITALIC
hasta aqui sale bien en el reporte sin embargo cuando leo un dato en una tabla SQLite por ejemplo MORELIA MÉXICO ahí es donde ya no imprime
las letras acentuadas
Hago notar que estoy leyendo una base de datos de SQLITE
¿Alguna sugerencia?
PD Gracias por la ayuda
Re: Imprimir acentos y ñ Ñ
Posted: Sun Jul 12, 2026 6:14 am
by serge_girard
Jorge,
try with this:
Code: Select all
SET HPDFDOC ENCODING TO "WinAnsiEncoding"
Re: Imprimir acentos y ñ Ñ
Posted: Mon Jul 13, 2026 5:19 pm
by jorge.posadas
THNK serge
But It didn't work
Re: Imprimir acentos y ñ Ñ
Posted: Mon Jul 13, 2026 5:56 pm
by serge_girard
Jorge,
Please send piece of your code.
Serge
Re: Imprimir acentos y ñ Ñ
Posted: Mon Jul 13, 2026 7:55 pm
by jorge.posadas
#INCLUDE <hmg.ch>
#INCLUDE <ord.ch>
#INCLUDE <ps.ch>
#INCLUDE <hbver.ch>
#INCLUDE <hfcl.ch>
#INCLUDE <hmg_hpdf.ch>
PROCEDURE Imprime_PDF()
REQUEST HB_CODEPAGE_ESWIN // Para Windows (ANSI)
// Me conecto a la base de datos SQLITE
GConectMe(Gs_Ruta_DB, .T.)
Gs_Sub_Titulo = 'REPORTE DE LOTES Y DEP�SITOS'
G_Lee_Datos_Estaca()
archivopdf = "Reporte_Lotes.pdf"
//Ls_Lotes := GsRutaRPT + "Lote_Ofrendas_Depositos" + ".pdf"
//hb_cdpSelect( "ESWIN" )
SELECT HPDFDOC archivopdf TO lSuccess papersize HPDF_PAPER_LEGAL ORIENTATION HPDF_ORIENT_PORTRAIT
SET HPDFDOC COMPRESS ALL
SET HPDFDOC ENCODING TO "CP1252"
SET HPDFDOC ENCODING TO "WinAnsiEncoding"
IF lSuccess
START HPDFDOC
START HPDFPAGE
// La sguiente l�nea es cuando se usa el costado derecho, si se abra aparece el titulo de "Lotes"
SET HPDFDOC PAGEOUTLINE TITLE "Lotes"
lin:=33
incre:=5
// Imprime encabezado.
@ 008, 100 HPDFPRINT UPPER(Gs_Nombre_Estaca) FONT "Times-Bold" SIZE 18 CENTER BOLD
/*
Aqu� debe de ir el ciclo de lectura de los lotes
*/
END HPDFPAGE
END HPDFDOC
SET CODEPAGE TO UNICODE
Execute File archivopdf
ENDIF
RETURN
Re: Imprimir acentos y ñ Ñ
Posted: Tue Jul 14, 2026 5:18 am
by serge_girard
Is your PRG saved as UTF-8 ?
Re: Imprimir acentos y ñ Ñ
Posted: Tue Jul 14, 2026 6:06 pm
by jorge.posadas
Serge
I saved the PRG file as ISO 8859-1 using Visual Studio Code as my text editor.
This is my PRG FILE
#INCLUDE <hmg.ch>
#INCLUDE <ord.ch>
#INCLUDE <ps.ch>
#INCLUDE <hbver.ch>
#INCLUDE <hfcl.ch>
#INCLUDE <hmg_hpdf.ch>
PROCEDURE Imprime_PDF()
REQUEST HB_CODEPAGE_ESWIN // Para Windows (ANSI)
// Me conecto a la base de datos SQLITE
GConectMe(Gs_Ruta_DB, .T.)
Gs_Sub_Titulo = 'REPORTE DE LOTES Y DEP�SITOS'
G_Lee_Datos_Estaca()
archivopdf = "Reporte_Lotes.pdf"
//Ls_Lotes := GsRutaRPT + "Lote_Ofrendas_Depositos" + ".pdf"
//hb_cdpSelect( "ESWIN" )
SELECT HPDFDOC archivopdf TO lSuccess papersize HPDF_PAPER_LEGAL ORIENTATION HPDF_ORIENT_PORTRAIT
SET HPDFDOC COMPRESS ALL
SET HPDFDOC ENCODING TO "CP1252"
SET HPDFDOC ENCODING TO "WinAnsiEncoding"
IF lSuccess
START HPDFDOC
START HPDFPAGE
// La sguiente l�nea es cuando se usa el costado derecho, si se abra aparece el titulo de "Lotes"
SET HPDFDOC PAGEOUTLINE TITLE "Lotes"
lin:=33
incre:=5
// Imprime encabezado.
@ 010, 020 HPDFPRINT "Las siguiente línea son caracteres fijo, para verificar"
@ 020, 020 HPDFPRINT "que SI imprime letras acentuadas, el PRG esta grabado como ISO-8859-1."
@ 030, 020 HPDFPRINT "The following lines contain fixed characters, to verify that it DOES print accented letters."
@ 040, 020 HPDFPRINT "The PRG file is formatted as ISO-8859-1."
@ 060, 020 HPDFPRINT "Á É Í Ó Ú Ñ á é í ó í ñ"
@ 080, 020 HPDFPRINT "The following lines are taken from a column in an SQLite table, and the values"
@ 090, 020 HPDFPRINT "in this column contain accented letters."
@ 110,100 HPDFPRINT UPPER(Gs_Nombre_Estaca) FONT "Times-Bold" SIZE 18 CENTER BOLD
/*
Aquí es la lectura de la tabla
*/
END HPDFPAGE
END HPDFDOC
SET CODEPAGE TO UNICODE
Execute File archivopdf
ENDIF
RETURN
Thank you very much in advance for your help.
Re: Imprimir acentos y ñ Ñ
Posted: Thu Jul 16, 2026 6:10 am
by serge_girard
Jorge ,
What is your email address?
Serge
Re: Imprimir acentos y ñ Ñ
Posted: Fri Jul 17, 2026 3:45 pm
by martingz
Jorge si te muestra los acentos en la tabla?
como tienes el Database Encoding?
saludos
Re: Imprimir acentos y ñ Ñ
Posted: Sat Jul 18, 2026 5:59 am
by serge_girard
It has indeed to do with database encoding.
S