Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentAssembler: Is it possible to to have conditional Table Row? (unrelated) Hidden methods? #67

Open
Marcel0024 opened this issue Jul 17, 2023 · 2 comments
Labels
question Further information is requested Word Word related tasks

Comments

@Marcel0024
Copy link

Marcel0024 commented Jul 17, 2023

Hi, i have 2 questions i can't find documentation on. (Even the original repos)

  1. Is it possible to have a conditional Table Row? For example:

image

I don't want to show Order Date row if it's empty. I can add another boolean into the model indicating if it needs to be shown or not. But i can't figure out if you can add a conditional to the table.

  1. In Another issue i saw something like thisthis:

<Conditional Select="count(./Orders/Order) > 0" Match="True" />

I can't find any documentation on count(..)? Where does it come from? And more importantly, what else is there?

@sergey-tihon sergey-tihon added question Further information is requested Word Word related tasks labels Jul 19, 2023
@sergey-tihon
Copy link
Owner

Sorry, I also do not know. I have never used this part of PowerTools.

The only thing I can suggest is to look at the source code.

@MalcolmJohnston
Copy link
Contributor

MalcolmJohnston commented Jul 22, 2024

A simple way that you can do this is:

  1. Split your table into two tables
  2. Wrap a Conditional around only the order date row

You'd end up with something like this:

<Repeat Select="Orders/Order" />

Product: <Content Select="./ProductDescription" />
Quantity: <Content Select="./Quantity" />

<Conditional Select="count(./OrderDate) > 0" Match="True" />

Order Date: <Content Select="./OrderDate" />

<EndConditional />

<EndRepeat />

If you don't add any whitespace between the rows then Word should render this as a single table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Word Word related tasks
Projects
None yet
Development

No branches or pull requests

3 participants