Welcome to the nuBuilder Forums!

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

Conditional formating in PDF reports

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

Conditional formating in PDF reports

Unread post by Fike »

First of all, I am thrilled to learn that nuBuilder can now be mashed into a web page using an iframe. This makes nuBuilder a perfect tool for developing interactive kiosk applications. Thank you very much for keeping the imporvement of this great tool.

I am currently using v2.7.4.7-12.08.29-Build516, but I will definiteley upgrade to the newest version ASAP.

In the version I am using, when I use conditional formatting for reports, the HTML reports display correctly. However, the PDF reports show the conditional formatting hashes and the value of the fiels. In other words, they display -#BOLD#Joe Bloggs- instead of Joe Bloggs.

I checked the "run_report_pdf_v2.php" file and I changed the line 148 from:

if(count($string_array) == 0){
to:
if(count($string_array) != 0){

PDF reports are now displaying correctly the formattings and values. However, if someone detects that additional changes should be made please tell me.

Regards!

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

Re: Conditional formating in PDF reports

Unread post by admin »

Fike,

I'll add this into the next build

Thanks

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

Re: Conditional formating in PDF reports

Unread post by Fike »

Hi Steven,

You are welcome, but I've just realized that this change made other pdf reports (with no conditional formatting) print duplicated rows, so changing the line 148 does not fix the problem properlly.

I will try to make the code work for both PDF reports (with and without conditional formatting) and post my findings.

Regrads,

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

Re: Conditional formating in PDF reports

Unread post by Fike »

I have tested the following change for PDF reports with and without conditional formatting, and both are printing correctly, so I hope this is a proper fix.

I replaced lines 148 to 152 in run_report_pdf_v2.php from:

if(count($string_array) == 0){
$data = $lineFormat['string']; //-- string with formatting removed
}else{
$data = $string_array[$ts];
}

to:

if(count($string_array) == 0){
$data = $lineFormat['string']; //-- string with formatting removed
}else{
$data = $string_array[$ts];
$data_arr = formatForPDFandHTML($data);
$data = $data_arr['string'];
}

Please note that lines 148 to 151 remain exactly the same than in the original code. I just added two lines between lines 151 and 152 of the original code.

Again, if someone finds out that this is not a proper fix, please post your findings.

Regards,


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

Re: Conditional formating in PDF reports

Unread post by admin »

Fike,

Thanks again, it will be in the next release.

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

Re: Conditional formating in PDF reports

Unread post by Fike »

You are welcome Steven!

Regards,

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

Re: Conditional formating in PDF reports

Unread post by admin »

.
Locked