Where do I put printIt() in button?

Where do I put printIt() in button?

Postby JohnKlassen » Fri Jan 25, 2013 1:49 pm

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
JohnKlassen
 
Posts: 148
Joined: Wed Dec 05, 2012 1:26 pm

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

Postby martbarr » Fri Jan 25, 2013 7:07 pm

printIt("REP001");
works fine for me in button dble click -
you need the report code in Dbl Quotes though
martbarr
 
Posts: 60
Joined: Sat Oct 27, 2012 3:39 am

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

Postby massiws » Sat Jan 26, 2013 4:16 am

You can use also Extra Action Button:
img.png
Open a report with Extra Action Button
img.png (9.55 KiB) Viewed 7825 times


Max
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

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

Postby JohnKlassen » Sun Jan 27, 2013 9:16 am

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
JohnKlassen
 
Posts: 148
Joined: Wed Dec 05, 2012 1:26 pm

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

Postby massiws » Sun Jan 27, 2013 11:34 pm

John,
create a button object like this:
img.png
All tab
img.png (21.53 KiB) Viewed 7816 times

img1.png
Button tab
img1.png (8.05 KiB) Viewed 7816 times

This is the form:
img2.png
Button object on the form
img2.png (2.24 KiB) Viewed 7816 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
massiws
 
Posts: 503
Joined: Thu May 24, 2012 9:38 am
Location: Milan, Italy

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

Postby JohnKlassen » Mon Jan 28, 2013 10:36 am

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
JohnKlassen
 
Posts: 148
Joined: Wed Dec 05, 2012 1:26 pm

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

Postby admin » Mon Feb 04, 2013 12:34 pm

.
admin
Site Admin
 
Posts: 3153
Joined: Mon Jun 15, 2009 9:53 am


Return to Report Writer