Dynamic invoices (.docx) with subtable - problem
Hi!
I have just started playing around with dynamic printing, as the built-in solution is - as we all know - less than ideal and finally has reached the end of life for me.
All is working well - except the implementation of a different table into my invoice. In my invoice, I have a table called "summary" - which pulls data from a different table called "article"
There, I have two columns "product" and "price" If I understand the Ninox documentation correctly, the correct syntax should be
{d.summary[i].article.product}
to pull the product in my invoice. But that doesn't work, even though {d.summary[i].finalprice}, which pulls the final price (price * amount) directly from the "summary" table, works perfectly.
So, I guess my syntax is incorrect - could you point me in the correct direction where I might have gone wrong?
Thanks.
Johanna
25 replies
-
Try:
{d.summary.article[i].product} {d.summary.article[i+1]}
-
Oops, I was wrong. Here is what works for me when I want to use data from a reference field inside a reference field.
{d.ProductionItem[i].Materials.Name} {d.ProductionItem[i+1].Materials.Name}
I'm starting in the Production table. ProductionItem is a many to many table linking Production and Materials. Production (1) > (M) ProductionItem (M) < (1) Materials.
This is what I see:
mat5, mat1, mat7 are the names of the material records.
Are your tables setup up the same? Can you post a sample DB?
-
On the one hand, I would think about whether the starter package with its limitations is the right subscription for a business application, especially since e-invoicing will sooner or later become mandatory for business in Europe and the starter subscription is not supported by Ninox with e-invoicing.
On the other hand, I would also make the data available via custom JSON for the use of dynamic printing (Carbone).
In the long term, this will cause fewer problems than with the simplified version: {d.Fieldname}
See also: https://forum.ninox.de/t/g9yxpzm/bekannte-komplikationen-beim-dynamischen-druck-dynamic-print-und-wie-man-sie-umgehen-kannIf the print template is in the 'Hochzeitspaare' table, the following table variable should work:
1.Zeile: Headings
2.Zeile,Zelle1: {d.Hochzeitspaare.Zusammenfassung[i].Leistung}
2.Zeile,Zelle2: {d.Hochzeitspaare.Zusammenfassung[i].Anzahl} etc.
.
.
.
3.Zeile,Zelle1: {d.Hochzeitspaare.Zusammenfassung[i+1].Leistung}
I would still prefer the custom JSON variant. -
Ok, try the attached docx file.
You tried:
{d.Zusammenfassung.Artikel[i].Leistung}
but it should be:
{d.Zusammenfassung[i].Produkt.Leistung}
In the Rechnungsposition Hochzeit table the reference field to Artikel is called Produkt so you have to use that name.
Attached is also the output.
-
I also noticed that you have many field names with spaces in them. That means you will need to get comfortable with creating JSON datasets.
You can practice by creating a new formula field and put this in it:
let t := this; t.{ brautvorname: 'Braut Vorname', brautnachname: 'Braut Nachname' }
So creating a JSON is as simple as putting your output inside those curly brackets. Keys end with a colon and the line ends with a simple comma NOT a Ninox semi-colon.
Good luck.
Content aside
- Status Answered
- 10 days agoLast active
- 25Replies
- 110Views
-
4
Following