Page 1 of 2
Document Template
Posted: Wed Dec 29, 2010 2:52 pm
by miplatt
For the description field in the company table, we have formatted descriptions of companies--may be a couple of paragraphs or even sentences, with two spaces between sentences and sometimes space between the paragraphs.
When outputting a document template into WORD which bring the description field, the content of the field is condensed into one continous paragraph unit, with only one space between sentences.
Is there a way to maintain in the output whatever spaces and formatting are actually in the field? (I have read the wiki page on Document Templates)
Re: Document Template
Posted: Wed Dec 29, 2010 5:58 pm
by ZevToledano
Good point. We'll fix this for next version.
In the meantime, if this field is only used for templates, you can add your own HTML tags inside the description including <BR> and but this will make it messy for non-template uses of course.
Re: Document Template
Posted: Thu Dec 30, 2010 9:42 am
by miplatt
Yes, a fix would be helpful, and html would be very messy and unfeasible for our users.
Re: Document Template
Posted: Mon Jan 24, 2011 11:15 am
by miplatt
Now that we are able to use document template to output text with formatting, we have noticed something interesting.
We generally use 2 spaces between the period and a new sentence and we always edit our documents with the formatting symbols shown (such as the paragraph marks, spaces as dots, etc.). When we output a company description, the first space appears as a dot (the usual symbol for denoting a space) and the second space appears as a little circle.
How can we have the spaces always appear as dots (spaces) instead of any other symbols?
Is it an issue with MS Word pasting? the particular doc template file? something else?
Re: Document Template
Posted: Mon Jan 24, 2011 12:11 pm
by ZevToledano
In order to make multiple spaces appear in HTML, my fix was to replace the second space with (non-breaking space). This is why it appears differently when displaying Word character marks. This is by design because HTML does not support multiple spaces unless I use <pre> tags in which case other formatting will go haywire. Alternatively, I could replace all spaces with but that would make horrible source code.
Re: Document Template
Posted: Thu Jan 27, 2011 1:27 pm
by miplatt
Currently, we have a document template which outputs a series of fields (for example, a company's contact information). The output includes each field title like "POB" and the content of each field (like "45005").
In some cases, a company might be missing one or more of the fields. For example, Company X might not have a POB and therefore the field appears empty in the output.
Is there any way to set up the template such that the output will disclude the empty fields automatically as opposed to having to remove them manually in MS Word afterwards?
Perhaps a conditional statement can be made within the template saying to output the field only if it is not empty?
Re: Document Template
Posted: Sun Jan 30, 2011 1:45 pm
by ZevToledano
Showing empty fields is obviously a desired result in the vast majority of cases. In your case, one thing I can think of is adding javascript to your template. But although this will work with HTML, I don't think this will work when you open the template in Word.
An alternative is to create a custom function field for fields that may be empty that include the HTML label code. e.g. if field=[blank] then [blank] else 'Field Name: ' + FieldValue + '<BR>'
...then add these function fields to your template instead of the regular ones and remove the label from your template.
Re: Document Template
Posted: Sun Jan 30, 2011 2:20 pm
by miplatt
Besides the little circle as the second space in the template output, we receive hard returns (the arrow symbol) between lines as opposed to the usual paragraph symbol (looks like a building column).
This can be very disruptive and can make editting more difficult.
Is there any way to eliminate these and just have the normal transition between lines?
Re: Document Template
Posted: Sun Jan 30, 2011 2:28 pm
by ZevToledano
I don't understand why these marks are so disruptive. The formatting works and the document appears as it should for all practical intents and purposes. Line breaks and spaces appear as they should when viewing and printing the document. The editing marks can be ignored or switched off when editing.
Besides, you haven't suggested alternatives so I am at a loss. We are dealing with HTML here so using and <BR> are the best ways to insert spaces and line breaks. <P> will cause an extra empty line to be inserted when only one line break is needed. What is the 'normal' way to do this in HTML?
Re: Document Template
Posted: Sun Jan 30, 2011 3:15 pm
by miplatt
How about ¶ ?
This makes a paragraph symbol in WORD. It appears whenever you hit enter to start a new line/paragraph in WORD.