Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Cannot print table Topic is solved
Re: Cannot print table
I added the JavaScript code to the custom code section of the parent form but it gave the following error:
Also see the following screenshot:
Also see the following screenshot:
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Cannot print table
At the time the main form is loaded, the iframe does not yet exist.
Therefore, it cannot be accessed at that point.
Solution: Either add a delay, or even better, set the Hash Cookie directly within the iframe.
Therefore, it cannot be accessed at that point.
Solution: Either add a delay, or even better, set the Hash Cookie directly within the iframe.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Cannot print table
Does the iframe retrieve the date from an object on the main form? And if no date is entered, what data should be displayed—for example, a default date like today, yesterday, etc.?
Re: Cannot print table
The iframe retrieves date from a date object on the main form. If no date is entered, the date object is set to todays date using JavaScript
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Cannot print table
In the iframe, check whether the
Place the following code in the iframe > Custom Code > Browse field:
date_filter
hash cookie is set. If it isn't, set it to the current date.Place the following code in the iframe > Custom Code > Browse field:
Code: Select all
if (!nuGetProperty('date_filter')) {
nuSetProperty('date_filter', nuCurrentDate());
}
Re: Cannot print table
I set the code you sent, but it did not help. The print view still shows no rows
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Cannot print table
There are too many factors that could make it not work, and it's time-consuming to keep guessing without seeing the setup, code, etc.
Would it be possible for you to either export your database (with any confidential data removed) or share the form using the cloner tool, along with the associated tables? That way, I can provide more accurate help without making assumptions.
Would it be possible for you to either export your database (with any confidential data removed) or share the form using the cloner tool, along with the associated tables? That way, I can provide more accurate help without making assumptions.
Re: Cannot print table
Please see attached SQL database file. The form with issues is under User Home -> Reporting -> Daily Report
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Cannot print table
In the form's Custom Code, the default date is explicitly set:
However, in the iframe, a different default date (today's date) is set dynamically:
Since the iframe uses the current date (which may not have corresponding data), the table appears empty, and the Print page shows up blank.
Additionally, when the date is changed, the new value must be saved to the Hash Cookie so that the iframe reflects the update correctly:
$("#date_filter").val("2021-11-01");
However, in the iframe, a different default date (today's date) is set dynamically:
Code: Select all
if (!nuGetProperty('date_filter')) {
nuSetProperty('date_filter', nuCurrentDate());
}
Additionally, when the date is changed, the new value must be saved to the Hash Cookie so that the iframe reflects the update correctly:
Code: Select all
var f = $("#daily_report_iframe")[0].contentWindow;
f.nuSetProperty("date_filter", this.value); // add this line
f.nuGetBreadcrumb();