Welcome to the nuBuilder forums!

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

Can't change font in report

massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Can't change font in report

Unread post by massiws »

I've tried to change the font of some labels and text field in my reports, but the only fonts accepted are Arial, Courier, Times and Symbols.
If I select any other font I see a message like this:

Code: Select all

FPDF error: Undefined font: verdana B
FPDF error: Undefined font: tahoma B
Is this a bug?
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Can't change font in report

Unread post by admin »

massiws,

Yes its a bug but it will work in the next version.

Steven
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Can't change font in report

Unread post by massiws »

Steven,

the problem still remain for Webdings and Wingdings fonts.

Also, I tryed to change the font to these two fonts and now I have this error when I try to open the report:

Code: Select all

Parse error: syntax error, unexpected T_STRING in /home/[...]/productionnu2/runpdf.php(35) : eval()'d code on line 1145

Fatal error: Class 'Reporting' not found in /home/[...]/productionnu2/runpdf.php on line 36
In Add Activities, when I select my report and I press the ReportBuilder button in Report tab, I get a grey page with "<--!2011-08-29-->" on the top-left corner!

What happened?
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Can't change font in report

Unread post by admin »

massiws,

What version do you have?

Do you have a back?

If you do you could zip it up and send it to info@nubuilder.com and I'll take a look.

Steven
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Can't change font in report

Unread post by massiws »

Steven,

I send you a zip of the database (nuBuilder 2.7.4.3).
The application is here: http://bfarina.it (also, i send you credential to access it).

Thanks in advance.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Can't change font in report

Unread post by admin »

I was able to change fonts in one of your reports..
Capture.PNG
Capture.PNG (15 KiB) Viewed 6821 times

Which version of nuBuilder are you running. Do you have the directory under \production2\fpdf\font or do you have \production2\fpdf\fonts ?

It should be \production2\fpdf\font .

I can't tell you what went wrong with the other report (rptBOLLA).

I always copy an activity I want to work on to another copy before I start.


Steven
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Can't change font in report

Unread post by massiws »

Steven,

nuBuilder is the last version (2.7.4.3) and the correct directory is \production2\fpdf\font; inside this directory I have:

Code: Select all

#[...]/production2743/fpdf/font> ls -x
calibri.php      courierbi.php     courierb.php    courieri.php   courier.php  georgia.php  georgia.z
helveticabi.php  helveticab.php    helveticai.php  helvetica.php  impact.php   impact.z     symbol.php
tahoma.php       tahoma.z          timesbi.php     timesb.php     timesi.php   times.php    verdana.php
verdana.z        zapfdingbats.php
I don't see Webdings and Wingdings fonts.
admin wrote:I was able to change fonts in one of your reports..
Have you tryed Webdings and Wingdings fonts in this report?
admin wrote:I can't tell you what went wrong with the other report (rptBOLLA).

I always copy an activity I want to work on to another copy before I start.
I have a backup! :D
(Eventually I can restore only the zzsys_activity table or, maybe, only the record related with the wrong report)

Anyway, I don't want to use the mentioned fonts, but I was curious to know what could have happened!
I think if the two fonts don't work, maybe could be deleted from the choice list in ReportBuilder... ;)

Thanks for the time you've spent! :D
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Can't change font in report

Unread post by admin »

massiws,

It seems that both "dings" don't work in pdfs because I am unable to compile that .z file on fpdf's web site because it won't convert to utf-8.
They will however work in html reports, but like you, most people probably don't use them.

Sorry I couldn't solve the other problem. I'll be interested to know if it happens again, especially if you know how to reproduce the error.

Steven
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Can't change font in report

Unread post by massiws »

Steven,
admin wrote:It seems that both "dings" don't work in pdfs because I am unable to compile that .z file on fpdf's web site because it won't convert to utf-8.
They will however work in html reports, but like you, most people probably don't use them.
Ok, I don't use them!
But the problem is both in PDF and HTML report.
admin wrote:I'll be interested to know if it happens again, especially if you know how to reproduce the error.
Other error is related with font change and it can be reproduced setting one text field of a report to one of "dings" fonts.
If I set one of the two fonts in some report text field, when I run the report I have the parse error posted above.

I applied this change to the "Invoice list" (code FM010) report in nuBuilder demo site.
How you can see, in RunActivity (both PDF and HTML) the report display a PHP error (even if it is different from what I get):

Code: Select all

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/dem47942/public_html/productionnu2/runreport.php(32) : eval()'d code on line 3

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/dem47942/public_html/productionnu2/runreport.php(32) : eval()'d code on line 3
Also, in AddActivity the ReportBuilder button now open a grey screen with a date in the top-left corner!
This is what you can get after change font in report fields to &quot;dings&quot; fonts
This is what you can get after change font in report fields to "dings" fonts
page.png (9.51 KiB) Viewed 6810 times
Don't shoot me, please!! :oops:
Sorry if I did not create a copy of the report!
If I have created a serious damage I can always pay you back as soon as you will come in Italy with a good Mediterranean lunch! ;)
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Can't change font in report

Unread post by massiws »

Steven,
I made some tests to find the problem.

The problem occurs changing the font in the report text-fields: when you save the changes the ending part of the generated Reporting class is cut off with a "LS" string.
Class stored in database
Class stored in database
phpmyadmin.png (36.3 KiB) Viewed 6808 times
I restore from a backup the content of sat_report_display_code field in zzsys_activity table and the report restart to work properly.
Can you see if this happened also in nuBuilder demo site for report FM010?

I attach the class generated after change font and the one from backup so you can see.
Here the differences (# diff -y --suppress-common-lines reportBeforeChange.txt reportAfterChange.txt):

Code: Select all

      $this->Controls[5]->FontName            = 'Courier';    |	      $this->Controls[5]->FontName            = 'Wingdings';
      $this->Controls[6]->FontName            = 'Courier';    |	      $this->Controls[6]->FontName            = 'Webdings';
      $this->Controls[7]->FontName            = 'Courier';    |	      $this->Controls[7]->FontName            = 'Symbol';
      $this->Controls[11]->FontName            = 'Courier';   |	      $this->Controls[11]->FontName            = 'Arial';
      $this->Controls[13]->FontName            = 'Courier';   |	      $this->Controls[13]->FontName            = 'Arial';
      $this->Controls[16]->FontName            = 'Courier';   |	      $this->Controls[16]->FontName            = 'Arial';
      $this->Controls[17]->FontName            = 'Courier';   |	      $this->Controls[17]->FontName            = 'Arial';
      $this->Controls[19]->FontName            = 'Courier';   |	      $this->Controls[19]->FontName            = 'Verdana';
      $this->Controls[31]->FontName            = 'Courier';   |	      $this->Controls[31]->FontName            = 'Times';
      $this->Controls[41]->FontName            = 'Courier';   |	      $this->Controls[41]->FontName            = 'Arial';
      $this->Controls[43]->FontName            = 'Courier';   |	      $this->Controls[43]->FontName            = 'Arial';
      $this->Controls[45]->FontName            = 'Courier';   |	      $this->Controls[45]->FontName            = 'Arial';
      $this->Controls[47]->Name                = 'object154'; /	      $this->Controls[47]->Name          LS
      $this->Controls[47]->Section             = '0';	      <
      $this->Controls[47]->ControlType         = 'Field';     <
      $this->Controls[47]->Tag                 = 'Field';     <
      $this->Controls[47]->ControlSource       = 'Y19uYW1l';  <
      $this->Controls[47]->Caption             = 'Y19uYW1l';  <
      $this->Controls[47]->Value               = 'Y19uYW1l';  <
      $this->Controls[47]->Top                 = '234px';     <
      $this->Controls[47]->Left                = '445px';     <
      $this->Controls[47]->Width               = '300px';     <
      $this->Controls[47]->Height              = '20px';      <
      $this->Controls[47]->ForeColor           = 'black';     <
      $this->Controls[47]->FontSize            = '16px';      <
      $this->Controls[47]->fontWeight          = '';	      <
      $this->Controls[47]->FontName            = 'Courier';   <
      $this->Controls[47]->BackColor           = 'white';     <
      $this->Controls[47]->BorderWidth         = '0px';	      <
      $this->Controls[47]->BorderColor         = 'black';     <
      $this->Controls[47]->BorderStyle         = 'solid';     <
      $this->Controls[47]->Graph               = '';	      <
      $this->Controls[47]->CanGrow             = 'false';     <
      $this->Controls[47]->TextAlign           = 'left';      <
      $this->Controls[47]->Format              = '';	      <
							      <
      $this->Controls[48]->Name                = 'object140'; <
      $this->Controls[48]->Section             = '0';	      <
      $this->Controls[48]->ControlType         = 'Label';     <
      $this->Controls[48]->Tag                 = 'Label';     <
      $this->Controls[48]->ControlSource       = '';	      <
      $this->Controls[48]->Caption             = '';	      <
      $this->Controls[48]->Value               = '';	      <
      $this->Controls[48]->Top                 = '225px';     <
      $this->Controls[48]->Left                = '8px';	      <
      $this->Controls[48]->Width               = '750px';     <
      $this->Controls[48]->Height              = '0px';	      <
      $this->Controls[48]->ForeColor           = 'black';     <
      $this->Controls[48]->FontSize            = '14px';      <
      $this->Controls[48]->fontWeight          = '';	      <
      $this->Controls[48]->FontName            = 'Arial';     <
      $this->Controls[48]->BackColor           = 'transparent <
      $this->Controls[48]->BorderWidth         = '2px';	      <
      $this->Controls[48]->BorderColor         = 'black';     <
      $this->Controls[48]->BorderStyle         = 'solid';     <
      $this->Controls[48]->Graph               = '';	      <
      $this->Controls[48]->CanGrow             = 'false';     <
      $this->Controls[48]->TextAlign           = 'left';      <
      $this->Controls[48]->Format              = '';	      <
							      <
      $this->Controls[49]->Name                = 'object141'; <
      $this->Controls[49]->Section             = '0';	      <
      $this->Controls[49]->ControlType         = 'Label';     <
      $this->Controls[49]->Tag                 = 'Label';     <
      $this->Controls[49]->ControlSource       = '';	      <
      $this->Controls[49]->Caption             = '';	      <
      $this->Controls[49]->Value               = '';	      <
      $this->Controls[49]->Top                 = '310px';     <
      $this->Controls[49]->Left                = '8px';	      <
      $this->Controls[49]->Width               = '750px';     <
      $this->Controls[49]->Height              = '0px';	      <
      $this->Controls[49]->ForeColor           = 'black';     <
      $this->Controls[49]->FontSize            = '14px';      <
      $this->Controls[49]->fontWeight          = '';	      <
      $this->Controls[49]->FontName            = 'Arial';     <
      $this->Controls[49]->BackColor           = 'transparent <
      $this->Controls[49]->BorderWidth         = '2px';	      <
      $this->Controls[49]->BorderColor         = 'black';     <
      $this->Controls[49]->BorderStyle         = 'solid';     <
      $this->Controls[49]->Graph               = '';	      <
      $this->Controls[49]->CanGrow             = 'false';     <
      $this->Controls[49]->TextAlign           = 'left';      <
      $this->Controls[49]->Format              = '';	      <
							      <
      $this->Sections[1]->Name                = 'Report_Heade <
      $this->Sections[1]->ControlType         = '1';	      <
      $this->Sections[1]->Tag                 = '1';	      <
      $this->Sections[1]->Height              = '0';	      <
      $this->Sections[1]->BackColor           = '#ebebeb';    <
      $this->Sections[1]->SectionNumber       = '1';	      <
							      <
      $this->Sections[3]->Name                = 'Page_Header' <
      $this->Sections[3]->ControlType         = '3';	      <
      $this->Sections[3]->Tag                 = '3';	      <
      $this->Sections[3]->Height              = '121';	      <
      $this->Sections[3]->BackColor           = '#ebebeb';    <
      $this->Sections[3]->SectionNumber       = '3';	      <
							      <
      $this->Sections[0]->Name                = 'Detail';     <
      $this->Sections[0]->ControlType         = '0';	      <
      $this->Sections[0]->Tag                 = '0';	      <
      $this->Sections[0]->Height              = '320';	      <
      $this->Sections[0]->BackColor           = '#ebebeb';    <
      $this->Sections[0]->SectionNumber       = '0';	      <
							      <
      $this->Sections[4]->Name                = 'Page_Footer' <
      $this->Sections[4]->ControlType         = '4';	      <
      $this->Sections[4]->Tag                 = '4';	      <
      $this->Sections[4]->Height              = '5';	      <
      $this->Sections[4]->BackColor           = '#ebebeb';    <
      $this->Sections[4]->SectionNumber       = '4';	      <
							      <
      $this->Sections[2]->Name                = 'Report_Foote <
      $this->Sections[2]->ControlType         = '2';	      <
      $this->Sections[2]->Tag                 = '2';	      <
      $this->Sections[2]->Height              = '0';	      <
      $this->Sections[2]->BackColor           = '#ebebeb';    <
      $this->Sections[2]->SectionNumber       = '2';	      <
							      <
							      <
							      <
   }							      <
}							      <
Hope this helps.

EDIT: Uploading again the productionnu2 directory (nuBuilder 2.7.4.3) to my server fix the problem in HTML report; PDF report display:

Code: Select all

FPDF error: Undefined font: webdings 
So, the two "dings" fonts can't be used!

Steven, which version of nuBuilder is running the demo site?? Maybe an older version?
Attachments
reportChanging.tar.gz
Classes generated BEFORE and AFTER font changing
(9.67 KiB) Downloaded 349 times
Locked