Can't generate report

Can't generate report

Postby jmusther » Wed Jan 23, 2013 7:46 am

Hi,
I'm just learning to use nuBuilder, and I'm having trouble creating a report. I've added an activity as a report and an trying to get my php code to work properly. Because I couldn't get it to work, I've simplified and simplified to try to get the hang of it, so now I have this code:

Code: Select all
$sql  = "CREATE TABLE $dataTable SELECT * FROM orders ";
$sql .= "JOIN customer ON orders.customerid=customer.id ";
$sql .= "WHERE orderid = 3";

nuRunQuery($sql);


And it isn't working. I get an SQL error when I try to run the activity, and it shows me this SQL:
Code: Select all
SELECT ``.* FROM `` WHERE = '150fdfe55007c0'


Note that the documentation says the #dataTable# should be used, but the included examples show $dataTable. I've tried both anyway, and get the same result.
If somebody could point me in the right direction I would be very grateful.

Thanks!
jmusther
 
Posts: 10
Joined: Thu Jan 10, 2013 1:21 pm

Re: Can't generate report

Postby jmusther » Wed Jan 23, 2013 8:32 am

Just to elaborate further, the above is when I run the activity with no criteria form specified. When I specify a form, and then click one of the action buttons (e.g. print to screen) I get a 500 Internal Sever Error:

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
http://localhost:8888/productionnu2/run ... receiptrpt

Thanks
jmusther
 
Posts: 10
Joined: Thu Jan 10, 2013 1:21 pm

Re: Can't generate report

Postby massiws » Wed Jan 23, 2013 9:06 am

jmusther,

1 - you put a nuDebug($sql) before nuRunQuery() function, so you can see in Setup > Debug the real SQL sentence;
2 - about $dataTable: have you read this post? http://forums.nubuilder.com/viewtopic.php?f=3&t=8075&p=11038&hilit=datatable#p11038;
3 - you can use a INNER JOIN or LEFT JOIN in SQL.

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

Re: Can't generate report

Postby jmusther » Thu Jan 24, 2013 6:49 am

Thanks Max,

It turns out the problem was my environment. I was running nuBuilder on MAMP (version 2.1.1). There must be something configured in MAMP which breaks reports. Ultimately, a system containing working reports doesn't work on MAMP. If you try to load a report, you get an error 500. Perhaps this is something which should be looked into?

I don't have a solution, I've migrated my nuBuilder sandbox to a linux server and all is well now.
jmusther
 
Posts: 10
Joined: Thu Jan 10, 2013 1:21 pm

Re: Can't generate report

Postby massiws » Thu Jan 24, 2013 7:34 am

jmusther,

I don't know MAMP but, maybe, more resource are necessary: try to insert this in .htacces file in your project folder, or modify the php.ini file in MAMP installation:
Code: Select all
php_value max_input_vars 8000
php_value post_max_size 16M
php-value max_execution_time 600
php_value memory_limit 512M
php_value magic_quotes_gpc Off


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

Re: Can't generate report

Postby jmusther » Fri Jan 25, 2013 9:50 am

Hi Max,

I've updated php.ini and restarted the web server. But unfortunately in MAMP I still can't get a report to work. I still get the 500 server error immediately after clicking the button. I don't think it's a timeout or memory size issue, simply because the 500 error pops up immediately.

I'm not sure what the problem is, but it would be nice to be able to track it down.

Cheers,
Jonathan
jmusther
 
Posts: 10
Joined: Thu Jan 10, 2013 1:21 pm

Re: Can't generate report

Postby massiws » Sat Jan 26, 2013 1:10 am

Jonathan,
any suggestions from php_error.log file?

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

Re: Can't generate report

Postby jmusther » Sat Jan 26, 2013 5:39 am

Here are the log entries from when I tried to run the report. There are plenty of warnings, but note the fatal error at the end.

Code: Select all
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 17
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 41
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 65
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 89
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 113
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 137
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 161
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 185
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 209
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 233
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 257
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 281
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 305
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 329
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 353
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 377
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 401
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 425
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 449
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 473
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 497
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 521
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 545
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 569
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 593
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 617
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 641
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 665
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 689
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 713
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 737
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 761
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 785
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 809
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 816
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 823
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 830
[25-Jan-2013 20:04:51 UTC] PHP Warning:  Creating default object from empty value in /Applications/MAMP/htdocs/productionnu2/runpdf.php(35) : eval()'d code on line 837
[25-Jan-2013 20:04:51 UTC] PHP Notice:  A session had already been started - ignoring session_start() in /Applications/MAMP/htdocs/productionnu2/run_report_pdf_v2.php on line 19
[25-Jan-2013 20:04:51 UTC] PHP Fatal error:  Cannot redeclare hex2bin() in /Applications/MAMP/htdocs/productionnu2/report_object.php on line 240
jmusther
 
Posts: 10
Joined: Thu Jan 10, 2013 1:21 pm

Re: Can't generate report

Postby martbarr » Sat Jan 26, 2013 6:41 am

Try commenting out the definition of hex2bin() at report_object.php line 240.

Martin
martbarr
 
Posts: 60
Joined: Sat Oct 27, 2012 3:39 am

Re: Can't generate report

Postby massiws » Sat Jan 26, 2013 10:03 am

jmusther wrote:I've migrated my nuBuilder sandbox to a linux server and all is well now.

It confirms the problem is in your local installation.

Have you a document root like: localhost/~<username>/sitename ? The '~' character create a problem in encode/decode functions.
If so, you need to set up a virtualhost for your site to skip the '~' character.

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

Next

Return to General