Page 1 of 1
nuRunReports issue
Posted: Tue Oct 06, 2020 1:02 am
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.
Re: nuRunReports issue
Posted: Tue Oct 06, 2020 10:45 am
by kev1n
Use the undocumented function
nuGetReport() instead.
1st parameter: form Id
2nd parameter: report id
E.g.:
Code: Select all
nuGetReport('5d145a80c4cea5b','5f1e7039eb8b99a');
Re: nuRunReports issue
Posted: Tue Oct 06, 2020 9:36 pm
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.
Re: nuRunReports issue
Posted: Tue Oct 06, 2020 9:43 pm
by kev1n
Pass the IDs, not the codes. (See my example)
Re: nuRunReports issue
Posted: Tue Oct 06, 2020 10:26 pm
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)
Re: nuRunReports issue
Posted: Tue Oct 06, 2020 10:38 pm
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.
Re: nuRunReports issue
Posted: Wed Oct 07, 2020 3:34 am
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
Re: nuRunReports issue
Posted: Wed Oct 07, 2020 11:00 am
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.
Re: nuRunReports issue
Posted: Wed Oct 07, 2020 6:00 pm
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.
Re: nuRunReports issue
Posted: Thu Oct 08, 2020 8:30 am
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.