문제

I am wondering what is best approach in handling multiple merges on one page. Something like such an official avery address label template:

Avery address template

My goal is to create a docx template for address labels and than process it with openTBS so that every db address row ends up in a new label field but not necessarily a new page.

I have quite some problems understanding how to achieve that.

Can this be done inside a template by something similar to a pagebreak and therefore without extra php attention?

Or does it need more php attention and by that I mean designing the template with a separate block for each label on one page and then a pagebreak. Then in the php side I would need to know how many blocks there are in the template and assign for each of those a merge block.

If only the latter way works is there a simple way to parse the template and figure out how many blocks exist in it?

도움이 되었습니까?

해결책

I can suggest 3 solutions (the first one is the better) :

1) Design your page to have 2 columns. Then use a table for the labels and define a TBS block in that table. At the PHP side, simply merge records on the TBS block, they will fill the page in the two columns automatically and then continue on more pages if needed.

2) Design a table with 2 columns and one row. Then at the PHP side, merge the record using the TBS serial display mode (parameter serial).

3) Design a table with 2 columns and one row. Then at the PHP side, rebuild your recordset in order to have two original record for one record on the new build.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top