report only generated for some records - SOLVED

report only generated for some records - SOLVED

Postby Tinka » Fri Jun 06, 2014 7:06 pm

Hi

Hopefully, someone can use this information. Please consider me still a bloody beginner in mysql, php and Javascript!

I have a "Print Record" button on my edit form, which runs a report nuPrintPDF('001') on the click event.

I had the problem that for some records the report looked fine, while for others it was empty (when not all db fields had a value). I first thought that the problem was in the generation of the temporary table or my php version (php 5.3.27). I changed some parameters in the .htaccess file as suggested here:

http://forums.nubuilder.com/viewtopic.php?f=4&t=8158&p=11827&hilit=can%27t+generate+report#p11827

But I found out that the error was in my sql query, where I had used INNER JOIN for a number of tables, like in the Edit form.

When changing this to LEFT JOIN it worked, because the right data gets selected.
Liked this illustration from http://stackoverflow.com/questions/5706437/whats-the-difference-between-inner-join-left-join-right-join-and-full-join:

SQL JOIN.png
SQL JOIN.png (158.86 KiB) Viewed 2002 times


Thank you for continously developing and supporting users of NuBuilder!

Tinka
Tinka
 
Posts: 72
Joined: Mon Feb 24, 2014 11:28 pm

Re: report only generated for some records - SOLVED

Postby massiws » Tue Jun 10, 2014 6:57 am

.
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy


Return to Report Writer