Print button doesn't give a Report

Print button doesn't give a Report

Postby Eppo » Tue Mar 26, 2013 8:25 am

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
Eppo
 
Posts: 29
Joined: Tue Jan 15, 2013 12:19 am
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Postby massiws » Fri Mar 29, 2013 7:05 am

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
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

Re: Print button doesn't give a Report

Postby Eppo » Mon Apr 01, 2013 4:54 am

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
Eppo
 
Posts: 29
Joined: Tue Jan 15, 2013 12:19 am
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Postby johan » Wed Apr 03, 2013 6:12 am

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
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: Print button doesn't give a Report

Postby Eppo » Thu Apr 04, 2013 4:31 am

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.
Eppo
 
Posts: 29
Joined: Tue Jan 15, 2013 12:19 am
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Postby johan » Thu Apr 04, 2013 6:08 am

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
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: Print button doesn't give a Report

Postby Eppo » Thu Apr 04, 2013 6:56 am

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?
Eppo
 
Posts: 29
Joined: Tue Jan 15, 2013 12:19 am
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Postby johan » Thu Apr 04, 2013 4:40 pm

Jeroen,

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

Johan
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: Print button doesn't give a Report

Postby Eppo » Thu Apr 04, 2013 7:56 pm

Johan,

Yes I dit....
Eppo
 
Posts: 29
Joined: Tue Jan 15, 2013 12:19 am
Location: The Netherlands, Leiden

Re: Print button doesn't give a Report

Postby johan » Thu Apr 04, 2013 9:25 pm

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
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Next

Return to Report Writer