Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

SOLUTION: UTF-8 in PDF

admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

flsd,

Before it prints, copy #dataTable# to another temp table so it won't get deleted.

Then see if the characters are correct in the table.

and what character set the table is ..

eg.



CREATE TABLE IF NOT EXISTS `___nu1501f37aeb655c___` (
`ID` int(11) NOT NULL DEFAULT '0',
`OrderID` int(11) NOT NULL DEFAULT '0',
`tra_number` varchar(11) CHARACTER SET utf8 NOT NULL DEFAULT '',
`pro_code` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '',
`Discount_Sum` double(19,2) DEFAULT NULL,
PRIMARY KEY (`ID`,`OrderID`,`tra_number`,`pro_code`),
KEY `ID` (`ID`),
KEY `OrderID` (`OrderID`),
KEY `tra_number` (`tra_number`),
KEY `pro_code` (`pro_code`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


Steven
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post by flsd »

Hi Steven,

All the characters in the temp table are correct, the character set is latin and the engine is InnoDB.
All the other tables, zzsys* included, are utf8 and MyISAM.

Thanks for your help
flsd
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

flsd,

You may have already answered this but, Does it work in an HTML report?

Steven
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post by flsd »

Hi Steven,

In HTML, the printing of RECEIPTS (FM008) and TAX INVOICES (FM009) has errors in header but has no errors in details. The printing of PURCHASE ORDERS (FM031) has no errors.

Thanks
flsd
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post by flsd »

Steven,

I think, I know what causes the problems with greek characters in HTML reports. Everything exists in the database tables, permanent or temporary, is printed correctly. Variables, strings etc, declared in the report and not exists in tables are printed wrong.

$BankInfo1= 'BSB:', $BankInfo2= 'Περιγραφή:', $BankInfo3= 'Αριθμός Λογαριασμού:', $BankInfo4= 'Bank Details:'

$seCompany=$fmsObj->fms_name, $seAddress=$fmsObj->fms_address, $seCity=$fmsObj->fms_city, $sePostcode =$fmsObj->fms_post_code, $seFax=$fmsObj->fms_fax, $sePhone=$fmsObj->fms_phone, $seState=$fmsObj->fms_state

All the above from FM009 report are printed wrong,

Regards
flsd
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

flsd,

If you send azipped (.zip) copy of the db to info@nubuilder.com I'll have a look.

Steven
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

flsd,

Are A and B the same font?

Untitled.png

Steven
You do not have the required permissions to view the files attached to this post.
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post by flsd »

Steven,

Yes, they are all arial fonts.

The difference is that 'fms_name', 'fms_address', 'fms_city' etc, are database field names, but SECompany', 'SEAddress', 'SECity' are variable names. So, in SQL statetments (nuRunQuery), which used for insert or update data into $datatable, if fms_* replace SE*, the problem is fixed.

To be more clear, 'tri_description' is database field name and is printed correctly, but 'SECompany' is not (gets value from fms_name).

Thanks for your time
flsd
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SOLUTION: UTF-8 in PDF

Unread post by admin »

flsd,

What version are you running?

I think this is fixed in version 2.7.4.4

Steven
flsd
Posts: 32
Joined: Tue Jul 03, 2012 6:50 pm

Re: SOLUTION: UTF-8 in PDF

Unread post by flsd »

Steven,

I am running 2.7.4.5

In HTML, most of the reports have been corrected.
In PDF, the problem persists.

flsd
Post Reply