Page 1 of 2

Print from Edit screen w/ Subform

Posted: Tue May 22, 2012 1:55 pm
by mlgeek
Hoping this isn't a dumb question because it has stumped me for two days. I have searched the forum and the wiki.

Following the instructions in the video tutorial (http://www.youtube.com/watch?v=qrRYagms ... ature=plcp), I created a button on my Edit form:
Image

Following the instructions in the video tutorial on the report builder (http://www.youtube.com/watch?v=G1JrJqZR ... ature=plcp), I made a report. When I run it from the Edit form, I always get this error:
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 '.agency_name , "bogus@bogus.net" AS agencies.contact_email , "Bogus Bogusstein' at line 1
Here's the SQL on the error page:

Code: Select all

CREATE TABLE a___nu14fbb7a6a29c35___ SELECT NOW() as timestamp , "Bogus Agency, Inc." AS agencies.agency_name , "bogus@bogus.net" AS agencies.contact_email , "Bogus Bogusstein" AS agencies.contact_name , "3" AS recordID , "Single Issue Report with Followups" AS ReportTitle , "" AS subform_followups , "followup1" AS subform_followups0000followup_detail , "May-07-2012" AS subform_followups0000followup_dt , "followup2" AS subform_followups0001followup_detail , "May-09-2012" AS subform_followups0001followup_dt , "followup3" AS subform_followups0002followup_detail , "May-10-2012" AS subform_followups0002followup_dt , "followup4" AS subform_followups0003followup_detail , "May-13-2012" AS subform_followups0003followup_dt , "followup5" AS subform_followups0004followup_detail , "May-17-2012" AS subform_followups0004followup_dt , "followup6" AS subform_followups0005followup_detail , "May-17-2012" AS subform_followups0005followup_dt , "followup7" AS subform_followups0006followup_detail , "May-21-2012" AS subform_followups0006followup_dt , "" AS subform_followups0007followup_detail , "" AS subform_followups0007followup_dt , ___nu14fbb7a6a29c35___.* FROM ___nu14fbb7a6a29c35___
One thing I noticed was

Code: Select all

" "AS suform_followups ,
I tried rewriting the PHP Data Code to make sure subform_followups (the subform object in the issues form) was NOT selected:
Image

Same problem, though.

I'm using MySQL 5.1.54.

Any thoughts?

Many thanks in advance.

Re: Print from Edit screen w/ Subform

Posted: Wed May 23, 2012 7:56 pm
by mlgeek
Oh boy. Bigger problem than I thought. In an attempt to further narrow down the problem, I tried something *really* simple in the PHP Data Code:

Image

When I tried this from the printIt button on the edit form, I got this error:

Image

Now I'm really, truly baffled. Help?

Re: Print from Edit screen w/ Subform

Posted: Sat May 26, 2012 5:43 am
by massiws
Can you try to use simple aliases?
agencies.agency_name -> try agency_name

Re: Print from Edit screen w/ Subform

Posted: Mon May 28, 2012 3:39 am
by shane
Does the report work when you run it from a normal report form instead of the edit screen?

Re: Print from Edit screen w/ Subform

Posted: Wed May 30, 2012 6:33 pm
by mlgeek
shane wrote:Does the report work when you run it from a normal report form instead of the edit screen?
That's a confusing question. I thought from the tutorials that it is impossible for the same report to work from a report form AND from an Edit form.

Re: Print from Edit screen w/ Subform

Posted: Wed May 30, 2012 8:58 pm
by mlgeek
Okay.

ONLY having this problem now when trying to run report from Edit screen of a form that has a subform.

When my report does not attempt to query for any subform data, why am I seeing in the error message that the printIt function is gathering them anyway? (as seen below)
Image

Re: Print from Edit screen w/ Subform

Posted: Fri Jun 01, 2012 1:47 am
by shane
Hi,

I think I will need a copy of your .sql to load up on my system to be able to solve your question, also what version of nuBuilder are you using?

Re: Print from Edit screen w/ Subform

Posted: Fri Jun 01, 2012 2:31 pm
by mlgeek
Thanks, Shane! I'm using v2.5.

What .sql do you need? Entire database (quite small, really)? Just what is entered at Add Activities > Report Tab > PHP Data Code?

Re: Print from Edit screen w/ Subform

Posted: Mon Jun 04, 2012 6:21 pm
by mlgeek
My apologies for being a pest, Shane- but if I don't get this issue resolved soon, I have to go with a different solution. Please advise?

Re: Print from Edit screen w/ Subform

Posted: Wed Jun 06, 2012 1:38 am
by shane
sorry for the delay, please send me the entire backup/dump of your .sql file to info@nusoftware.com.au, I will look into it straight away