Imprimir acentos y ñ Ñ

HMG en Español

Moderator: Rathinagiri

jorge.posadas
Posts: 205
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Morelia, Mich. México
Contact:

Imprimir acentos y ñ Ñ

Post 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
Cordialmente

POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: jorge.posadas@posoft.mx
User avatar
serge_girard
Posts: 3412
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Imprimir acentos y ñ Ñ

Post by serge_girard »

Jorge,

try with this:

Code: Select all

	SET HPDFDOC ENCODING TO "WinAnsiEncoding"
There's nothing you can do that can't be done...
jorge.posadas
Posts: 205
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Morelia, Mich. México
Contact:

Re: Imprimir acentos y ñ Ñ

Post by jorge.posadas »

THNK serge

But It didn't work
Cordialmente

POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: jorge.posadas@posoft.mx
User avatar
serge_girard
Posts: 3412
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Imprimir acentos y ñ Ñ

Post by serge_girard »

Jorge,

Please send piece of your code.

Serge
There's nothing you can do that can't be done...
jorge.posadas
Posts: 205
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Morelia, Mich. México
Contact:

Re: Imprimir acentos y ñ Ñ

Post 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
Attachments
Imagen_2.png
Imagen_2.png (17.66 KiB) Viewed 959 times
Imagen_1.png
Imagen_1.png (12.98 KiB) Viewed 959 times
Cordialmente

POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: jorge.posadas@posoft.mx
User avatar
serge_girard
Posts: 3412
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Imprimir acentos y ñ Ñ

Post by serge_girard »

Is your PRG saved as UTF-8 ?
There's nothing you can do that can't be done...
jorge.posadas
Posts: 205
Joined: Mon May 19, 2014 7:43 pm
DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
Location: Morelia, Mich. México
Contact:

Re: Imprimir acentos y ñ Ñ

Post 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.
Attachments
PDF_File.png
PDF_File.png (66.97 KiB) Viewed 932 times
Cordialmente

POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: jorge.posadas@posoft.mx
User avatar
serge_girard
Posts: 3412
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Imprimir acentos y ñ Ñ

Post by serge_girard »

Jorge ,

What is your email address?

Serge
There's nothing you can do that can't be done...
martingz
Posts: 408
Joined: Wed Nov 18, 2009 11:14 pm
Location: Mexico

Re: Imprimir acentos y ñ Ñ

Post by martingz »

Jorge si te muestra los acentos en la tabla?
como tienes el Database Encoding?


saludos
User avatar
serge_girard
Posts: 3412
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Imprimir acentos y ñ Ñ

Post by serge_girard »

It has indeed to do with database encoding.
S
There's nothing you can do that can't be done...
Post Reply