Page 1 of 1

Where do I put printIt() in button?

Posted: Fri Jan 25, 2013 5:19 am
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

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

Posted: Fri Jan 25, 2013 10:37 am
by martbarr
printIt("REP001");
works fine for me in button dble click -
you need the report code in Dbl Quotes though

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

Posted: Fri Jan 25, 2013 7:46 pm
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 14068 times
Max

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

Posted: Sun Jan 27, 2013 12:46 am
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

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

Posted: Sun Jan 27, 2013 3:04 pm
by massiws
John,
create a button object like this:
All tab
All tab
img.png (21.53 KiB) Viewed 14059 times
Button tab
Button tab
img1.png (8.05 KiB) Viewed 14059 times
This is the form:
Button object on the form
Button object on the form
img2.png (2.24 KiB) Viewed 14059 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

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

Posted: Mon Jan 28, 2013 2:06 am
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

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

Posted: Mon Feb 04, 2013 4:04 am
by admin
.