Welcome to the nuBuilder forums!

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

Where do I put printIt() in button?

Locked
JohnKlassen
Posts: 148
Joined: Wed Dec 05, 2012 4:56 am

Where do I put printIt() in button?

Unread post by JohnKlassen »

Hi,

I have created a report which I want to display when I click on a button. Based on another post, I understand that I need to use a function called 'printIt' with a parameter of the 'pcode' for the report.

My question is where to enter 'printIt(PEOPLERPT1)'? I tried it in the 'On Double Click' field on the 'All' tab for the button. I then chose the 'Run' option under 'Form to Launch via Browser' on the 'Button' tab.

When I click on the button, it takes me to the list of reports rather than displaying the specific report.

What do I need to do to fix that?

Thanks,

John
martbarr
Posts: 60
Joined: Fri Oct 26, 2012 8:09 pm

Re: Where do I put printIt() in button?

Unread post by martbarr »

printIt("REP001");
works fine for me in button dble click -
you need the report code in Dbl Quotes though
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Where do I put printIt() in button?

Unread post by massiws »

You can use also Extra Action Button:
Open a report with Extra Action Button
Open a report with Extra Action Button
img.png (9.55 KiB) Viewed 13894 times
Max
JohnKlassen
Posts: 148
Joined: Wed Dec 05, 2012 4:56 am

Re: Where do I put printIt() in button?

Unread post by JohnKlassen »

Martin and Max,

Thanks for your responses. I was able to get Max's suggestion of using 'Extra Action Buttons' to work with a form.

When I tried Martin's suggestion of putting
printIt("PEOPLERPT1");
in the "On Double Click", I was only able to get the list of reports instead of opening the actual report. This only worked if I had 'Run' in 'Form To Launch via Browse' option on the 'Button' tab which makes me think the 'Run' option was taking me to the reports list.

If I used the "On Double click" without 'Run' in 'Form To Launch via Browse' option on the 'Button' tab. I would get the following error:
Error Reference: 3ead253
An error occurred while running the following query:
CREATE TABLE a___nu15104633e7185a___ SELECT NOW() as timestamp , "" AS accessLevelButton , "" AS AddActivities , "" AS AddLists , "" AS Code Library , "" AS Debugbt , "" AS FormsButton , "" AS fwiz , "-1" AS id , "" AS Inage , "" AS ObjectsButton , "" AS people , "" AS pets , "-1" AS recordID , "" AS ReportButton , "All People by Unit" AS ReportTitle , "" AS rules , "" AS RunActivity , "" AS Setup , "" AS sfwiz , "" AS StyleButton , "" AS transbt , "" AS unit , "" AS UserGroups , "" AS Users , "" AS vehicle , "" AS violations , ___nu15104633e7185a___.* FROM ___nu15104633e7185a___
Ideally I would like to get both options to work. Martin, I am open to any suggestions. Meanwhile I can use the 'Extra Actions Button'.

Thanks to both of you.

John
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Where do I put printIt() in button?

Unread post by massiws »

John,
create a button object like this:
All tab
All tab
img.png (21.53 KiB) Viewed 13885 times
Button tab
Button tab
img1.png (8.05 KiB) Viewed 13885 times
This is the form:
Button object on the form
Button object on the form
img2.png (2.24 KiB) Viewed 13885 times
If I used the "On Double click" without 'Run' in 'Form To Launch via Browse' option on the 'Button' tab. I would get the following error:
Maybe an error in SQL sentence? Try insert a nuDebug() before nuRunQuery().

Hope this helps.
Max
JohnKlassen
Posts: 148
Joined: Wed Dec 05, 2012 4:56 am

Re: Where do I put printIt() in button?

Unread post by JohnKlassen »

Max,

Thanks for the information. I tried to get it to work using your instructions but I kept getting erors.

I actually like your original suggestion better and I am using that in my application.

Thanks,

John
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Where do I put printIt() in button?

Unread post by admin »

.
Locked