Welcome to the nuBuilder forums!

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

Print button doesn't give a Report

Eppo
Posts: 29
Joined: Mon Jan 14, 2013 3:49 pm
Location: The Netherlands, Leiden

Print button doesn't give a Report

Unread post 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
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Print button doesn't give a Report

Unread post 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
Eppo
Posts: 29
Joined: Mon Jan 14, 2013 3:49 pm
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Unread post 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
johan
Posts: 392
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium

Re: Print button doesn't give a Report

Unread post 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
Eppo
Posts: 29
Joined: Mon Jan 14, 2013 3:49 pm
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Unread post 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.
johan
Posts: 392
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium

Re: Print button doesn't give a Report

Unread post 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
Eppo
Posts: 29
Joined: Mon Jan 14, 2013 3:49 pm
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Unread post 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?
johan
Posts: 392
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium

Re: Print button doesn't give a Report

Unread post by johan »

Jeroen,

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

Johan
Eppo
Posts: 29
Joined: Mon Jan 14, 2013 3:49 pm
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Unread post by Eppo »

Johan,

Yes I dit....
johan
Posts: 392
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium

Re: Print button doesn't give a Report

Unread post 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
Locked