Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Print from Edit screen w/ Subform

mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Print from Edit screen w/ Subform

Unread post 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.
mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Re: Print from Edit screen w/ Subform

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

Re: Print from Edit screen w/ Subform

Unread post by massiws »

Can you try to use simple aliases?
agencies.agency_name -> try agency_name
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Print from Edit screen w/ Subform

Unread post by shane »

Does the report work when you run it from a normal report form instead of the edit screen?
mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Re: Print from Edit screen w/ Subform

Unread post 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.
mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Re: Print from Edit screen w/ Subform

Unread post 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
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Print from Edit screen w/ Subform

Unread post 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?
mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Re: Print from Edit screen w/ Subform

Unread post 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?
mlgeek
Posts: 23
Joined: Tue May 08, 2012 8:24 pm

Re: Print from Edit screen w/ Subform

Unread post 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?
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Print from Edit screen w/ Subform

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