Welcome to the nuBuilder Forums!

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

nuRunReports issue

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

nuRunReports issue

Unread post by treed »

Hello when nuRunReports is used under an input button it opens JUST the report. The report I'm opening has a parameters screen which opens properly from the run reports section, however when trying to open it from a button with nuRunReports it just opens the report.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuRunReports issue

Unread post by kev1n »

Use the undocumented function nuGetReport() instead.

1st parameter: form Id
2nd parameter: report id

E.g.:

Code: Select all

nuGetReport('5d145a80c4cea5b','5f1e7039eb8b99a');
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nuRunReports issue

Unread post by treed »

Almost works, the run button appears, but no form.
Report settings which does work correctly when run from the reports button
Screenshot from 2020-10-06 12-27-40.png
Java under button
nuGetReport('BinOutRpt','BO1');

Also when the run button is pressed, what appears is a blank screen, not a blank report header/footer.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuRunReports issue

Unread post by kev1n »

Pass the IDs, not the codes. (See my example)
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: nuRunReports issue

Unread post by Janusz »

and maybe another try ...
If the run button works OK copy it on the form as html object.
typically it looks like:

Code: Select all

<input id="nurunButton" type="button" class="nuActionButton" value="Run" onclick="nuRunReport("FR_PART_RAP")">
so create HTML object on your form and in the HTML section paste the code from button Run
(the best run console navigate to Run button, select and copy element next paste the code to the HTML object)
If you like nuBuilder, please leave a review on SourceForge
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nuRunReports issue

Unread post by treed »

Ok that was the issue and it works fine now. Is there a way to find these id's without poking around in the database?

Also for the sake of others and readability/maintainability of the code, may I request that the java functions use a parameter to pass either an ID or Code? Or perhaps a CODE wrapper function to lookup the ID for an form or report.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuRunReports issue

Unread post by kev1n »

treed wrote:Ok that was the issue and it works fine now. Is there a way to find these id's without poking around in the database?
Head over to the Developer Console (F12) and

... enter nuCurrentProperties().record_id to retrieve the current record id

.. enter nuCurrentProperties().form_id to retrieve the current form id
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuRunReports issue

Unread post by kev1n »

If you add the additional developer buttons, you can view all this information - and more - on a button click:

https://github.com/smalos/nuBuilder4-Co ... ev_buttons
Form_Info.png
I find that these "developer buttons" make developing much easier.
You do not have the required permissions to view the files attached to this post.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: nuRunReports issue

Unread post by treed »

Thanks! That makes finding the ID info easier and I like how new windows are popped up for the other functions. It doesn't address the code vs. id in the function issues.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuRunReports issue

Unread post by kev1n »

treed wrote: It doesn't address the code vs. id in the function issues.
Since there's no such nuBuilder function, you'll have to write your own. It shouldn't be tough.
Post Reply