It seems to be impossible to include a “View”-field in the print lay-out? Is that true?
Dear Ninox Ninja’s,
It seems to be impossible to include a “View”-field in the print lay-out? Is that true?
If so, any way to circumvent this issue?
Here are some details:
Edit a Table
Click “Add layout element”
Click “View”
You can use this View to pull data from other Tables using Formulas.
Extremely useful; however; it seems as if you can’t get this “View” field to be printed as well….
Looking forward to hearing this is user related ;).
Thanks,
Bas
23 replies
-
PS I think I might have already gotten one baby step further. You can add formula fields to the print lay-out.
Using 'A) Project Items'.'B) Time Used' does give the record IDs I am after… However, it only displays these IDs and nothing more. Any idea how to display the value of the variables/fields associated with these records? Can you choose the order as well? Also; can you change the “header” names of that table as well?
Also:I have 1 Master table called Projects.
This tables contains another 3 tables: Subprojects, Labour, Parts.
I would like to “print” a list of the following given the Project an user has selected listing all Subprojects + Labour + Parts for those Subprojects belonging to that Project.
So something like this:
Project: XYZ
Subproject: Task 1
Labour: 5 hours | 50 euro
Parts: 3x Part 1, 2x Part 2, 130x Part 3 | 200 euroSubproject: Task 2
Labour: 51 hours | 505 euro
Parts: 30x Part 1, 22x Part 3 | 200 euro
-
Hi, Bas,
I've made an example here.https://www.dropbox.com/s/abr4owka73t5bc1/Bas.ninox?dl=0
You can either place the texts in a subtable (subprojects) or write everything in a text field.
Leo
-
Dear Leonid,
This is absolutely excellent... Thank you very much for taking the time to share your knowledge... Very much appreciated...
It's funny too; I had already spent quite some time on this issue and you seem to have it solved in "no time". (And with basically zero turn around time as well; on a Sunday; haha!)
I will see if I can reproduce your work in my current "Master Database" and I am already looking forward to learning more about Ninox and f.i. the JOIN command...
Thanks again,
Bas
-
Another undocumented function... join()
-
Hi Sean,
I have now added the description of the join() function in our "Refrence of Functions and Language":
join(array,"separator")
- Returns a string result with each element separated by a separator of your choice. That can also be a line break and/or a string.Kind regards, Jörg
-
Hi Jörg,
Thank you for that. The reason I said "Another" is there are still others that are missing. I did mention this in another thread...
The numbers() function and the modulo operator are not in the "Refrence of Functions and Language". Are there any other useful functions that are missing from the documentation?
Best regard, Sean
-
Dear All,
Any idea if you can replace the comma between parts with a "space or line break" instead?Here's the original code:
join('A) Project Items'.("Subproject: " + 'Project Item Name' + "
" + "Labour: " + sum('B) Time Used'.hours) + " hours" + " | " + sum('B) Time Used'.Total) + "
Parts: " + concat('C) Materials Used'.(Quantity + "x " + 'Part Name')) + " | " + sum('C) Materials Used'.'Total Price')), "")
This is what it looks like:
This is what I am going for:
Thanks,
Bas
-
Bas, try replacing concat() with join()
-
Well spotted Sean!
I have tried the following:
join('Project Items'.'Materials Used'.'Article Name', "");
join('Project Items'.'Materials Used'.text(Quantity), "");
join('Project Items'.'Materials Used'.text(Quantity); text("RANDOM TEXT");'Project Items'.'Materials Used'.text(Quantity), "tada")The first two lines do give a correct result. The third; unfortunately not. Any idea what I should do different?
Here's the actual code I am trying to get working:
join(‘Materials Used'.(Quantity + "x " + 'Article Name' + " (" + 'Line Total' + ")")), " Random separator")
Thanks as always,
Bas
-
You have an extra ). Remove the last one before the comma and see if that works.
-
Sean, thanks for your fast reply.
Are you referring to the "code example" or the "actual code"? I removed ) for both; the formulas compile without error, but they don't show what I thought and want them to show.
Let's try with something simpler first. I thought this would work:
join('Project Items'.'Materials Used'.text('Suggested Sales Price'); 'Project Items'.'Materials Used'.text(Quantity), " tada")
and would give something like: 35,00eur,10,tada,13,00eur,22,tada
But I get 100 tada5 tada50 tada5 tada50; thus the Suggested Sales Price goes missing.
I am confused. I think I am using the formula in a incorrect way?
Could you please give me an example where you would achieve this:
Value of Variable 1 + "random text" + Value of Variable 2 of item 1
Value of Variable 1 + "random text" + Value of Variable 2 of item 2
Value of Variable 1 + "random text" + Value of Variable 2 of item 3
Etc.
Is such an outcome possible?
Thanks,
Bas -
Bas, in your code example...
join('Project Items'.'Materials Used'.text('Suggested Sales Price'); 'Project Items'.'Materials Used'.text(Quantity), " tada")
you have a semicolon in the formula. That won't work. Try something like this...
join('Project Items'.'Materials Used'.text('Suggested Sales Price') + " - " + 'Project Items'.'Materials Used'.text(Quantity), " tada")
-
Thanks for your immediate reply; very much appreciated...
And exact copy paste still gives an error. I don't really understand what it is trying to say. I can't really say what is wrong either (no obvious typos and the filenames seem correct).
What do you think?
I am going to check again; haha.
-
Would you like me to upload the database example?
-
join('A) Project Items'.'C) Materials Used'.text(Quantity) + "KEEP GOING" + 'A) Project Items'.'C) Materials Used'.text('Single Price'),"SEPARATOR")
-
Here's the DB.
-
-
@Bas .. I recall that it needs to be a composite table.. not a view.. but do not quote me on that..
-
Ok, let's try this...
replace(concat('C) Materials Used'.(Quantity + "x " + 'Part Name')) + " | " + sum('C) Materials Used'.'Total Price'), ", ", "
")
Of course, anywhere you want a new line you'll have to concatenate it to the string. Here is the full code for the "TEXT" formula field...
join('A) Project Items'.("Subproject: " + 'Project Item Name' + "
" + "Labour: " + sum('B) Time Used'.hours) + " hours" + " | " + sum('B) Time Used'.Total) + "
Parts:
" + replace(concat('C) Materials Used'.(Quantity + "x " + 'Part Name')) + " | " + sum('C) Materials Used'.'Total Price'), ", ", "
")), "
")
-
Dear Sean,
It works wonderfully. This is so great!
I also had a look at why you used concat and replace / how this does work; and it makes so much sense now... (You use concat to concatenate a string to our (my ;)) liking and you simply remove the comma's within this spring using the replace function. Simply genius!)
Thank you so much! Not only for continueing to follow up; but also taking your time to share your knowledge. Very much appreciated!
-Bas
-
Bas,
You're welcome and I learned something also. I finally figured out that once you start to concatenate strings to array elements it stringifies the array so join() wouldn't work. Once I figured out that I was working with a string instead of an array replace() was the obvious choice.
Sean
-
I'm still learning! First, I'd like to say I don't think the default name for a table reference, the table name itself, is a best practice and leads to confusion. Simply adding "Ref" to the end of it would help avoid confusion in code. Anyway, the point of this post is to show how you can nest
join()
's.join('A)ProjectItemsRef'.("Subproject: " + 'Project Item Name' + "
" + "Labour: " + sum('B)TimeUsedRef'.hours) + " hours" + " | " + sum('B)TimeUsedRef'.Total) + "
Parts:
" + join('C)MaterialsUsedRef'.(Quantity + "x " + 'Part Name' + " | " + sum('Total Price')), "
")), "
")
It displays subtotals instead of the total at the end, but I'm sure the total could be added at the end.
-
With total...
join('A)ProjectItemsRef'.("Subproject: " + 'Project Item Name' + "
" + "Labour: " + sum('B)TimeUsedRef'.hours) + " hours" + " | " + sum('B)TimeUsedRef'.Total) + "
Parts:
" + join('C)MaterialsUsedRef'.(Quantity + "x " + 'Part Name' + " | " + sum(Subtotal)), "
") + "
" + "Total " + sum('C)MaterialsUsedRef'.Subtotal)), "
")
Content aside
- 4 yrs agoLast active
- 23Replies
- 6552Views