button to start report with launch form

Questions related to nuBuilder Forte Reports and the Report Builder.

button to start report with launch form

Postby Henk_2a » Tue Apr 17, 2018 1:58 am

Hello all

I made a php-procedure which runs a FPDF-report.
procedure.jpg
procedure.jpg (44.77 KiB) Viewed 2965 times

This procedure requires a launch-form to make some selections.
launchform.jpg
launchform.jpg (36.02 KiB) Viewed 2965 times

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
button.jpg (46.62 KiB) Viewed 2965 times

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
screen.jpg (13.75 KiB) Viewed 2965 times

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 ;-)
Last edited by Henk_2a on Tue Apr 24, 2018 3:12 am, edited 2 times in total.
Henk_2a
 
Posts: 25
Joined: Mon Feb 15, 2016 5:12 am
Location: Nederland

Re: button to start report with launch form

Postby admin » Tue Apr 17, 2018 8:25 am

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
admin
Site Admin
 
Posts: 3162
Joined: Mon Jun 15, 2009 9:53 am

Re: button to start report with launch form

Postby toms » Tue Apr 17, 2018 2:11 pm

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.
toms
 

Re: button to start report with launch form

Postby Henk_2a » Tue Apr 17, 2018 5:03 pm

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: 25
Joined: Mon Feb 15, 2016 5:12 am
Location: Nederland

Re: button to start report with launch form

Postby Henk_2a » Tue Apr 17, 2018 5:09 pm

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 :?
Henk_2a
 
Posts: 25
Joined: Mon Feb 15, 2016 5:12 am
Location: Nederland

Re: button to start report with launch form

Postby toms » Tue Apr 17, 2018 5:35 pm

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
        });
}
toms
 

Re: button to start report with launch form

Postby admin » Sun Apr 22, 2018 10:11 am

Henk_2a,

Can you try posting your screenshot again?

Steven
admin
Site Admin
 
Posts: 3162
Joined: Mon Jun 15, 2009 9:53 am

Re: button to start report with launch form

Postby Henk_2a » Tue Apr 24, 2018 3:13 am

I succeeded in inserting them in my first post, however, the images are quite big ......
I hope this helps
Henk_2a
 
Posts: 25
Joined: Mon Feb 15, 2016 5:12 am
Location: Nederland

Re: button to start report with launch form

Postby toms » Tue Apr 24, 2018 3:34 am

Have you tried my suggestion?
toms
 

Re: button to start report with launch form

Postby Henk_2a » Tue Apr 24, 2018 5:20 am

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
Henk_2a
 
Posts: 25
Joined: Mon Feb 15, 2016 5:12 am
Location: Nederland

Next

Return to Reports



cron