-
Dear @pgundlach I can't stop to say thank you, again and again! Sorry! 😁 This question might be useful for someone else too, so better makes it public. I realized that I need to change dynamically the grid based on the items I have inside each category. A viable solution I thought is to create create an upper group to handle this situation (perhaps it is not semantically correct yet... 😓) : <Record element="global">
<ProcessNode select="*" />
</Record>
<Record element="global">
<Group name="container-grid">
<Contents>
<!-- CASE A -->
<Switch>
<Case test="@3x2 = 'true'">
<Grid nx="3" ny="2" />
</Case>
</Switch>
<!-- CASE B -->
<Switch>
<Case test="@4x4 = 'true'">
<Grid nx="4" ny="4" />
</Case>
</Switch>
<!-- CASE C -->
<Switch>
<Case test="@6x1 = 'true'">
<Grid nx="6" ny="1" />
</Case>
</Switch>
<!-- YOUR REAL CONTENT -->
<ForAll select="local">
<Contents>
<Group name="real-unit">
<Grid nx="1" ny="1" />
<.../>
</Group>
</Contents>
</ForAll>
<PalaceObject groupname="real-unit" />
</Contents>
</Group>
</Record> But I wonder if can use Thank in advance! 🙏 C. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can do something like this:
<data gridx="4" gridy="5" /> Layout: <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Trace grid="yes" />
<Record element="data">
<SetGrid nx="{@gridx}" ny="{@gridy}" />
<PlaceObject>
<Textblock>
<Paragraph>
<Value>aaaa</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout> or if you need a switch case statement: <data gridtype="4x5" /> and <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Trace grid="yes" />
<Record element="data">
<Switch>
<Case test="@gridtype = '4x5'">
<SetGrid nx="4" ny="5" />
</Case>
</Switch>
<PlaceObject>
<Textblock>
<Paragraph>
<Value>aaaa</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout> You just need to make sure that the grid is set before anything is placed in the PDF, so this must be pretty much the first statement. |
Beta Was this translation helpful? Give feedback.
-
@pgundlach hank you very much, the first method was easier to implement. 🙏 |
Beta Was this translation helpful? Give feedback.
You can do something like this:
data.xml
:Layout:
or if you need a switch case statement:
and