Page 1 of 1

select field not printable (empty column when printing browse form)

Posted: Fri Jan 07, 2022 8:39 pm
by Andrea
Hello all,

I have a form with a select field for selecting values from another table. It works fine but when I am in browse view and I click the print button (nuActionButton) to call nuPrintAction() the resulting "print table" has an empty column instead of showing the selected values.
A second thing I noticed is that on this "print table" date values do not show up in the date format applied to the date field on the forms.

As I really like this print feature I would be very happy if anyone knows how to fix this.
Thankyou very much in anticipation!

Best wishes

Andrea

Re: select field not printable (empty column when printing browse form)

Posted: Fri Jan 07, 2022 9:35 pm
by kev1n
Hi Andrea,

Would it be possible to create a minimal working example (maybe in a separate db), dump the db and upload it here?
This would make it a lot easier to understand and track down the issue.

Re: select field not printable (empty column when printing browse form)

Posted: Sat Jan 08, 2022 1:10 am
by Andrea
Hi Kev1n,

thankyou for the swift reply!
I finally found the reason why the select-values were not available in print table.
I had 2 fields of the same name with different content in the two tables. It worked but was no clean way.

Table projektleiter:
projektleiter_id
projektleiter <- name of project leader

Table projekte:
projekte_id
projektnr
projekt
projektleiter <- projektleiter_id of table projektleiter

SQL on browse form projekte:

Code: Select all

SELECT * FROM projekte INNER JOIN projektleiter ON projekte.projektleiter = projektleiter_id ORDER BY projektnr;
display field in browse form: projektleiter.projektleiter



The solution was renaming the field 'projektleiter' in table projekte to 'projektleiterid' to have unique field names:

Table projektleiter:
projektleiter_id
projektleiter

Table projekte:
projekte_id
projektnr
projekt
projektleiterid <- projektleiter_id of table projektleiter

SQL on browse form projekte:

Code: Select all

SELECT * FROM projekte INNER JOIN projektleiter ON projektleiterid = projektleiter_id ORDER BY projektnr;
display field in browse form: projektleiter


Now print table is complete :-)

Thankyou!

Best wishes

Andrea

Re: select field not printable (empty column when printing browse form)

Posted: Sat Jan 08, 2022 11:45 am
by Andrea
Hi again,

I just made a test with an other table. If you give the full name (tablename.fieldname) for display in browse form the columns value show up in browse form but not in print table. It always has to be only the fieldname.

Example:

-> empty column:
1.JPG
2.JPG
3.JPG
-> all fine:
4.JPG
2.JPG
5.JPG