- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Automatic numbering in Precedents with If statements
Mon 30 Mar 2020 - 8:09
I have an IF statement in my precedent that says (pseudo code):
1. Some text here...
2. {IF {NoOfDepsField}=“1” “1 Child” {IF {NoOfDepsField}>”1” “Many Children” ““} }
3. Some more text here
It is part of a list that has automatic numbering.
Basically, if theNoOfDepsField is 0 thenthe line should be blank and the number removed, with the next line down moving up a number. How do I make this happen? The IF statement works fine but leaves the number in there with a blank line.I have tried playing around with the Paragraph symbol but to no avail.
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Automatic numbering in Precedents with If statements
Mon 30 Mar 2020 - 8:09
1. Some text here...{IF {NoOfDepsField}=“1” “ 1 Child” {IF {NoOfDepsField}>”1” “
Many Children” ““} }
3. Some more text here
By doing that I lose the number “1.” on the first line. Any more ideas?
Many Children” ““} }
3. Some more text here
By doing that I lose the number “1.” on the first line. Any more ideas?
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Automatic numbering in Precedents with If statements
Mon 30 Mar 2020 - 8:09
Word merge fields are sometimes unwieldy!I've looked at using a SEQ field or incrementing a SET field in the if statement but neither works. The SEQ field computes even if it's in the false part and the SET field updates several times on save, with each update incrementing the value.So other than moving the IF to the bottom of the list I guess you have the option of creating the entire list as a data list and use SQL to do the logic or a scripted field and use c#.Unless anyone else has an idea...
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Automatic numbering in Precedents with If statements
Mon 30 Mar 2020 - 8:09
Unfortunately we can't reorder the list as is it is a list of required documents that needs to be grouped in a specific way. As for scripting, that would be a much simpler solution if the users didn't need to be able to create / edit the lists of documents themselves.
Anyone else have any suggestions?
Anyone else have any suggestions?
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Automatic numbering in Precedents with If statements
Mon 30 Mar 2020 - 8:10
I will send you a package with a package that may help. I tried to upload it here but encountered an error.My precedent 'ListPrec' calls a wizard 'UNBOUNDLIST' in the Merging event. The wizard has three controls and the results are passed into the script by calling the wizard as a datatable.The script then creates a single string out of the results which is passed through as a parameter to a document variable.The docvariable is formatted as a numbered list and behaves as expected, creating a new numbered line after each paragraph mark.The precedent has been saved as a Word template and has four lines of VBA to unlink the fields allowing them to be editable and preventing them from erroring if the document is relinked.PeterIf anyone else is interested in seeing the package drop me an email and I will forward it.
Permissions in this forum:
You cannot reply to topics in this forum
|
|