Page 1 of 2

Print button doesn't give a Report

Posted: Mon Mar 25, 2013 11:55 pm
by Eppo
Hi There,

First of all. Please excuse me for my bad English, but I’ll try my best.

In my custumor nuBuilder project I have made a report that makes a garanty invoice. The only problem is, it doesn't work.

Type is Report
Selection form is blank

The code I use is:

Code: Select all

$sql  = "CREATE TABLE #dataTable# SELECT * FROM aankopen INNER JOIN ";
$sql .= "klanten ON koop_klant_id = klanten_id INNER JOIN ";

nuRunQuery($sql);
and

Code: Select all

printIt("fac1")
And the result is:
Image

The funny thing is that in the Demo program "Financial Module" I get the same result when I press a print button.

What am I missing or what did I do wrong?

I hope you can help me.

Jeroen

Re: Print button doesn't give a Report

Posted: Thu Mar 28, 2013 10:35 pm
by massiws
Jeroen,

I see an error in SQL.
Try this:

Code: Select all

 $sql  = "CREATE TABLE #dataTable# SELECT * FROM aankopen INNER JOIN ";
$sql .= "klanten ON koop_klant_id = klanten_id";
nuDebug($sql);
nuRunQuery($sql);
With nuDebug() function you can see the real SQL sentence in Setup > Debug : copy/paste in phpmyadmin may give you more information about errors.

Max

Re: Print button doesn't give a Report

Posted: Sun Mar 31, 2013 9:24 pm
by Eppo
Max,

I've tryed your code, only it doesn't gave me more information. About what there is wrong in my script.
Ik hope you or someone else can help me with my problem.

It's also in the Sample nuFinancial module.

Thanks for helping.

Jeroen

Re: Print button doesn't give a Report

Posted: Tue Apr 02, 2013 10:42 pm
by johan
Jeroen,

Just paste your sql - starting with select- in phpMyadmin (sql) to find out more about the error in sql.
(of in het nederlands : plak je sql in je phpMyadmin van Mysql om meer te weten over de foutmelding. Plak enkel het deel vanaf select)

Johan

Re: Print button doesn't give a Report

Posted: Wed Apr 03, 2013 9:01 pm
by Eppo
Johan,

Thanks for the tip, I've read over it.

When I put the code in phpmyadmin it only says :
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"; $sql .= "klanten ON koop_klant_id = klanten_id"; nuDebug($sql); ' at line 1

When i have een good code in PHPmyadmin and ik press button "Generate PHP code" that also doesn't work.

And the only thing I want it to do is to print some information. It Doesn't have to make some calculations or whatsoever.

I hope some one can Help me.

Re: Print button doesn't give a Report

Posted: Wed Apr 03, 2013 10:38 pm
by johan
Jeroen,

Try this code

Code: Select all

$sql = "


CREATE TABLE #dataTable# SELECT * FROM aankopen INNER JOIN klanten ON koop_klant_id = klanten_id ";

nuRunQuery($sql);
Instead of select all * it's even better to just select the columns you really need in your report.

If this doesn't work try left join.

Hope this works.

Johan

Re: Print button doesn't give a Report

Posted: Wed Apr 03, 2013 11:26 pm
by Eppo
Johan,


Thanks. I don't get the red screen again, it stays white and says waiting for localhost... and stays white.... So I'm one stap further.
Even whith the PDF option.

Some more tips?


Jeroen

PS: can somebody tell me why the demo module doesn't work or is there a posibility that there is something wrong with my computer?

Re: Print button doesn't give a Report

Posted: Thu Apr 04, 2013 9:10 am
by johan
Jeroen,

Did you create a report with the report builder?
http://youtu.be/G1JrJqZRg3o

Johan

Re: Print button doesn't give a Report

Posted: Thu Apr 04, 2013 12:26 pm
by Eppo
Johan,

Yes I dit....

Re: Print button doesn't give a Report

Posted: Thu Apr 04, 2013 1:55 pm
by johan
Jeroen,

I realy don't know what the problem is.

Maybe you can check this :

Have you tested it with another browser?
Do you have the right permission on productionnu2?
Are you using the latest version of Nubuilder? Did you run all the updates on the mysql tables?

Succes
Johan