Welcome to the nuBuilder Forums!

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

button to start report with launch form

Questions related to nuBuilder Forte Reports and the Report Builder.
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

button to start report with launch form

Unread post by Henk_2a »

Hello all

I made a php-procedure which runs a FPDF-report.
procedure.jpg
This procedure requires a launch-form to make some selections.
launchform.jpg
When I run the procedure with the run-procedure-button on the home screen everything goes ok.
Then I made a run-button,
button.jpg
When I run the procedure with this button I tried two options,
1 run the procedure, but then the procedure skips the form
2 run the form, but then it gives a blank screen
screen.jpg
So both options fail.
Then i tried the nurunphp onclickevent but that didn't solve the problem

Any idea what I did wrong? Thanks for your answer.

BTW I had the "ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER" error, I skipped this part but now I am always afraid that is the reason for all my problems ;-)
You do not have the required permissions to view the files attached to this post.
Last edited by Henk_2a on Mon Apr 23, 2018 7:42 pm, edited 2 times in total.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: button to start report with launch form

Unread post by admin »

Henk_2a,

nuBuilder Forte already has a Report Builder.

I don't understand why you are using FPDF.

And so I don't understand what you are trying to do.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: button to start report with launch form

Unread post by toms »

Hi,

Regardless of which PDF library to use, the question is how to execute a procedure from a run button.
"Run procedure" calls an internal function nuGetPHP(f, r).

There are two parameters to pass:

f: Launch Form Id (see table zzzzsys_form)
r: zzzzsys_php_id (see table zzzzsys_php)

What remains is to modify the button's onclick handler so that nuGetPHP() is called.
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

Re: button to start report with launch form

Unread post by Henk_2a »

admin wrote:Henk_2a,

nuBuilder Forte already has a Report Builder.

I don't understand why you are using FPDF.

And so I don't understand what you are trying to do.

Steven
Hi Steven
I use nuBuilder a few years now and I have build about 10 different applications. That is not because I hate nubuilder, that is because I love to work with it.
I know of your reportbuilder and yes, I use it a lot. But sometimes it simply isn't advanced enough and sometimes I need a fully controllable reportwriter, like FPDF.
That's why.

Anyway, thanks for your product, I like it.
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

Re: button to start report with launch form

Unread post by Henk_2a »

toms wrote:Hi,

Regardless of which PDF library to use, the question is how to execute a procedure from a run button.
"Run procedure" calls an internal function nuGetPHP(f, r).

There are two parameters to pass:

f: Launch Form Id (see table zzzzsys_form)
r: zzzzsys_php_id (see table zzzzsys_php)

What remains is to modify the button's onclick handler so that nuGetPHP() is called.
Hi Toms
thanks for your response.
Whatever I do, the object-builder demands me to enter a 'Run', and there I entered the name of the procedure.
I found your id's, and entered them in the onclick handler. (I think you meant nuRunPHP instead of nu GetPHP?) But it looks like this onclick event is completely ignored since nothing changes.
Isn't it I make some stupid misinterpretation?

I tried to insert screenshots, but the only thing I get in my previous post is the text 'Image' instead of an image :?
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: button to start report with launch form

Unread post by toms »

You'll need to override the button's onclick handler, otherwise the button's default action is called and the form is not shown.
The function to run is really called "nuGetPHP" (although the function does not do what it claims)

Add this to your userhome's JavaScript field or under setup -> header.

Code: Select all

if (nuFormType() == 'edit') {
      $("#TestRunPHP").attr('onclick', '');  // <-- id of your button, disable the default onclick handler
        $("#TestRunPHP").click(function() { // <-- id of your button, add your own handler
                         nuGetPHP('5a543df52a0b944','5ad57cfdcb21bc8'); // <- replace with your ids
        });
}
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: button to start report with launch form

Unread post by admin »

Henk_2a,

Can you try posting your screenshot again?

Steven
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

Re: button to start report with launch form

Unread post by Henk_2a »

I succeeded in inserting them in my first post, however, the images are quite big ......
I hope this helps
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: button to start report with launch form

Unread post by toms »

Have you tried my suggestion?
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

Re: button to start report with launch form

Unread post by Henk_2a »

yes, but no success, I don't understand where to put what code
you said
if (nuFormType() == 'edit') {
$("#TestRunPHP").attr('onclick', ''); // <-- id of your button, disable the default onclick handler
$("#TestRunPHP").click(function() { // <-- id of your button, add your own handler
nuGetPHP('5a543df52a0b944','5ad57cfdcb21bc8'); // <- replace with your ids
});
}
I made that
if (nuFormType() == 'edit') {
$("#TestRunPHP").attr('onclick','id of my button' ''); // <-- id of your button, disable the default onclick handler
$("#TestRunPHP").click(function() { // <-- id of your button, add your own handler ???? now where to add what?
nuGetPHP('id_form','id_procedure'); // <- replace with your ids
});
}

sorry for my ignorance, my js-knowledge is very low
Post Reply