Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Special characters in report output

Fike
Posts: 79
Joined: Thu Oct 20, 2011 9:13 pm

Special characters in report output

Unread post by Fike »

Hi,

I was having trouble with special characters (á, é, í, ó, ú, ñ) when prinitng a PDF report.

I ended up replacing the last line of the function nuPrintField at the nurunpdf.php file

from:

Code: Select all

 $PDF->MultiCell($width, $height,  implode("\n", $contents->lines), $borderWidth == 0 ? 0 : 1, $textAlign, true);
to:

Code: Select all

$text = implode("\n", $contents->lines);
$text = utf8_decode($text);
$PDF->MultiCell($width, $height, $text, $borderWidth == 0 ? 0 : 1, $textAlign, true);
Hope this helps someone having the same issue.

Kind regards,

Fike
roaridse
Posts: 6
Joined: Fri Jan 18, 2013 7:52 am

Re: Special characters in report output

Unread post by roaridse »

Hi,

This helped for static labels on my system, but special characters loaded from the query ends up as a questionmark .

My reports works great at nuBuilder 2.0, but my replicated in 3.0 have issues with the norwegian special characters.


Any suggestions how to fix this?


Regards,
Roar
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Special characters in report output

Unread post by admin »

roar,

What character sets are you using in your tables?

Steven
roaridse
Posts: 6
Joined: Fri Jan 18, 2013 7:52 am

Re: Special characters in report output

Unread post by roaridse »

Steven,

Sorry for late answer.

My tables uses latin1_swedish_ci as default.

I tried to convert one table to utf8_general_ci , without any differences.

The zzz_tables uses utf8_general_ci , and before applying the codechanges from Fike i also had problems with several characters on lables in the report. Now it's just the data from my tables which is replaced with a questionmark.


Roar
kkatsaros
Posts: 12
Joined: Thu Sep 25, 2014 1:58 pm

Re: Special characters in report output

Unread post by kkatsaros »

Same here (with greek special characters). All of my tables are utf8_general_ci.
Any ideas?
Kostas
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Special characters in report output

Unread post by admin »

Kostas,

Do they read correctly in phpmyadmin?

Steven
kkatsaros
Posts: 12
Joined: Thu Sep 25, 2014 1:58 pm

Re: Special characters in report output

Unread post by kkatsaros »

Yes Steven, this is what I get on the pdf:
nureport.png
nureport.png (1.26 KiB) Viewed 29931 times
and this is the third column of the same query in phpMyAdmin:
phpMyAdmin.png
phpMyAdmin.png (4.01 KiB) Viewed 29931 times
The first column on the pdf is a label.
Kostas
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Special characters in report output

Unread post by admin »

Kostas,

Have you tried other fonts.

I don't know, can you send me a table to test?

Steven
nekpap
Posts: 27
Joined: Wed Dec 03, 2014 7:41 am

Re: Special characters in report output

Unread post by nekpap »

Same problem with greek special characters!

Teke into account this problem, I can't build any report (all my tables have greek special characters - utf8_general_ci) :cry:

Please Help!
nekpap
Posts: 27
Joined: Wed Dec 03, 2014 7:41 am

Re: Special characters in report output

Unread post by nekpap »

This must be a problem of FPDF please take a look at : http://stackoverflow.com/questions/6334 ... ing-how-to
Post Reply