Updated for version 4.18
Overview
In order to provide clients with hard copy signature form to uniquely meet their needs, Windsor has implemented a feature that allows system users to:
...
The following example returns a formatted Submission #.
<<[submission.formattedNumber]>> revision #: <<[submissionVersion.Number]>> |
Form Name
The following returns the form name for the Form.
<<[formVersion.name]>> |
Site Address Example
The following returns the Site Address assigned to the Form.
<<[siteAddress.fullAddress.Replace(“\n”,”<br/>”)]:upper:”format” –html>> |
Note: The Replace(“\n”,”<br/>”) reference replaces all newline characters with a line break. The “:upper” reference is used to make all text uppercase. The “format” –html reference used to ensure the displayed text honors the HTML formatting tags.
...
In this example, the Template is attempting to access text from a Short Text or Paragraph Control, the “Site Name,” that the user entered in the submission. The Short Text or Paragraph (e.g., Site Name) Control in the submission has a Tag value of “SITE_NAME”. The first step is to define the siteName variable. Assuming Site Name control will always be available on the Submissions, use the following syntax to define the siteName control:
<<var [siteName = SectionControls.FirstOrDefault(sc=>sc.tag ==”SITE_NAME”).values.controlValue] >> |
One defined, siteName can be referenced from anywhere in the form using the following syntax:
Site Name: <<[siteName] :upper>> |
Note: The “:upper” reference is used to make all text uppercase.
...
Defines the siteAddressCtrl variable so simplify the many references to this control.
Performs error handling to handle the situation where the site address is null.
The siteAddress variable is established by concatenating all the constituent parts of the address control (e.g., street address, secondary address, city, state, zip, etc.) and to improve formatting, HTML break tags are added where needed.
See example below:
<<var [siteAddressCtrl=SectionControls.FirstOrDefault(sc=>sc.tag ==”ADDRS”)]>> <<var [siteAddress = siteAddressCtrl == null ? “”:”<br />”+ siteAddressCtrl.values.street + “<br />” + siteAddressCtrl.values.street2 + (siteAddressCtrl.values.street2 != null?“<br />”:””) + siteAddressCtrl.values.locality +”,” + siteAddressCtrl.values.areaCode + “ “ + siteAddressCtrl.values.postalCode] >> |
Note: Each individual address component could be referenced separately (versus one address block, if desired).
One defined, the siteAddress can be referenced from anywhere in the form using the following syntax:
Site Address: <<[siteAddress]:upper:”format” –html >> |
Note: The “:upper” reference is used to make all text uppercase. The “format” –html reference used to ensure the displayed text honors the HTML formatting tags.
...
Defines the submitterCtrl variable so simplify the many references to this control.
Performs error handling to handle the situation where the company name is null.
The submitterInfo variable is established by concatenating all the constituent parts of the Submitter control (e.g., name, street address, secondary address, city, state, zip, etc.) and to improve formatting, HTML break tags are added where needed.
See example below:
<<var [submitterCtrl=SectionControls.FirstOrDefault(sc=>sc.tag ==”CNTCT”)]>> <<var [submitterInfo = submitterCtrl == null ? “”:”<br/>”+ submitterCtrl.values.companyNameContact+”<br/>”+ submitterCtrl.values.streetContact + “<br/>” + submitterCtrl.values.street2Contact + (submitterCtrl.values.street2Contact !=null?”<br />”:””) + submitterCtrl.values.localityContact +”,” + submitterCtrl.values.areaCodeContact + “ “ + submitterCtrl.values.postalCodeContact] >> |
Note: Each individual address component could be referenced separately (versus one address block, if desired.
One defined, the submitterInfo can be referenced, in uppercase, from anywhere in the form using the following syntax:
<<[submitterInfo]:upper:”format” –html>> |
Note: The “:upper” reference is used to make all text uppercase. The “format” –html reference used to ensure the displayed text honors the HTML formatting tags.
...
When defining the variables for the data to be accessed at the top of the template:
Perform this work at the top of the page (prior to the data attribute being referenced).
Do NOT add carriage returns in or between these definitions as the template will include these carriage returns in the presented document.
Any Controls referenced in the Template must exist on Submission Form. If the control doesn’t exist, errors will be encountered and the Payment Voucher will not be generated, unless error handling code is added. To trap for potentially absent controls, the following format of code can be used.
<<var [companyNameCtrl = SectionControls.FirstOrDefault(sc=>sc.tag==”COMPANY_NAME”)]>><<var [companyName= (companyNameCtrl == null ?””: companyNameCtrl.values.controlValue)]>> |
If a Control is empty (e.g., not entered), the value will be returned to the template will be a blank. In some cases, blank values are saved in controls as a “?” to help with URL encoding. In these cases, the “?” will need to be replaced with a blank value during display.
Case does matter when referencing variables so be sure that your casing is in sync.
Configuration values (in the Vars.config, VarsOverrides.config, etc.) can be exposed to the document generator. These can be exposed by referencing the existing configuration properties in the following format:
<add key="docgen.config.settings" value=" |
Any attributes referenced here can be accessed from within the document by referencing the configuration value without periods and capitalizing secondary words. So, the app.Title configuration setting will be referencing as:
<<[appTitle]>> |
The esa.recipient.mailing.address configuration setting will be referencing as:
<<[esaRecipientMailingAddress]>> |
Anchor | ||||
---|---|---|---|---|
|
...
Establish Variable Example
<<var [ShortText=SectionControls.FirstOrDefault(sc=>sc.tag ==”STC”).values.controlValue]>> |
Reference Variable Example
Short Text: <<[ShortText]>> |
Paragraph
Establish Variable Example
<<var [Paragraph = SectionControls.FirstOrDefault(sc=>sc.tag ==”PRGRPH”).values.controlValue] >> |
Reference Variable Example
Paragraph: <<[Paragraph]>> |
Instructions
No attributes are returned from this control.
...
Establish Variable Example
<<var [Single=SectionControls.FirstOrDefault(sc=>sc.tag ==”SSC”)]>> |
Reference Variable Example
Selection: <<[Single.values.select]>> Reason: <<[Single.values.otherReason]>> |
Multi Selection
Establish Variable Example
<<var [Multi=SectionControls.FirstOrDefault(sc=>sc.tag ==”MSC”)]>> |
Reference Variable Example
Selection: <<[Multi.values.select.Replace(",",", ")]>> Reason: <<[Multi.values.otherReason]>> |
Formatted
Number
Establish Variable Example
<<var [Number=SectionControls.FirstOrDefault(sc=>sc.tag ==”NMBR”).values.controlValue]>> |
Reference Variable Example
Number: <<[Number]>> |
Date
Establish Variable Example
<<var [Date=SectionControls.FirstOrDefault(sc=>sc.tag ==”DTE”).values.controlValue]>> |
Establish Variable Example
<<var [Email=SectionControls.FirstOrDefault(sc=>sc.tag ==”EML”).values.controlValue]>> |
Reference Variable Example
Email: <<[Email]>> |
URL
Establish Variable Example
<<var [URL=SectionControls.FirstOrDefault(sc=>sc.tag ==”URL”).values.controlValue]>> |
Reference Variable Example
URL: <<[URL]>> |
Phone
Establish Variable Example
<<var [Phone=SectionControls.FirstOrDefault(sc=>sc.tag ==”PHN”).values.controlValue]>> |
Reference Variable Example
Phone: <<[Phone]>> |
Advanced
Name
Establish Variable Example
<<var [Name=SectionControls.FirstOrDefault(sc=>sc.tag ==”NME”)]>> |
Reference Variable Example
Full Name: <<[Name.values.fullNameValue]>> Title: <<[Name.values.titleValue]>> |
Location
Establish Variable Example
<<var [Location=SectionControls.FirstOrDefault(sc=>sc.tag ==”LCTN”)]>> |
Reference Variable Example
Address: <<[Location.values.mapAddress]>> Coordinates: <<[Location.values.mapCoord]>> |
Address
Establish Variable Example
<<var [siteAddressCtrl=SectionControls.FirstOrDefault(sc=>sc.tag ==”ADDRS”)]>> <<var [siteAddress = siteAddressCtrl == null ? “”:”<br />”+ siteAddressCtrl.values.street + “<br />” + siteAddressCtrl.values.street2 + (siteAddressCtrl.values.street2 != null?“<br />”:””) + siteAddressCtrl.values.locality +”,” + siteAddressCtrl.values.areaCode + “ “ + siteAddressCtrl.values.postalCode] >> |
Reference Variable Example
Line by line Address: <<[siteAddress]>> 1st Line of Address: <<[siteAddressCtrl.values.street]>> 2nd Line of Address: <<[siteAddressCtrl.values.street2]>> Location Description: <<[siteAddressCtrl.values.description]>> City: <<[siteAddressCtrl.values.locality]>> State: <<[siteAddressCtrl.values.areaCode]>> Zip: <<[siteAddressCtrl.values.postalCode]>> County: <<[siteAddressCtrl.values.county]>> Country: <<[siteAddressCtrl.values.countryCode]>> |
Attachment
Establish Variable Example
<<var [Attachment=SectionControls.FirstOrDefault(sc=>sc.tag ==”ATTCHMNT”)]>> |
Reference Variable Example
Comment: <<[Attachment.values.attachmentComment]>> Confidential: <<[Attachment.values.confidential]>> Confidential Reason: <<[Attachment.values.confidentialReason]>> File ID: <<[Attachment.values.fileId]>> File Name: <<[Attachment.values.fileName]>> |
Table
Establish Variable Example
<<var [Table=SectionControls.FirstOrDefault(sc=>sc.tag ==”TBLE”)]>> |
Reference Variable Example
...
Establish Variable Example
<<var [submitterCtrl=SectionControls.FirstOrDefault(sc=>sc.tag ==”CNTCT”)]>> <<var [submitterInfo = submitterCtrl == null ? “”:”<br/>”+ submitterCtrl.values.companyNameContact+”<br/>”+ submitterCtrl.values.streetContact + “<br/>” + submitterCtrl.values.street2Contact + (submitterCtrl.values.street2Contact !=null?”<br/>”:””) + submitterCtrl.values.localityContact +”,” + submitterCtrl.values.areaCodeContact + “ “ + submitterCtrl.values.postalCodeContact] >> |
Reference Variable Example
Line by line Address: <<[submitterInfo]>> Prefix: <<[submitterCtrl.values.prefixNames]>> First Name: <<[submitterCtrl.values.firstNameContact]>> Middle Name: <<[submitterCtrl.values.middleNameContact]>> Last Name: <<[submitterCtrl.values.lastNameContact]>> Title: <<[submitterCtrl.values.titleContact]>> Company Name: <<[submitterCtrl.values.companyNameContact]>> Phone: <<[submitterCtrl.values.phoneContact]>> Email: <<[submitterCtrl.values.emailContact]>> 1st Line of Address: <<[submitterCtrl.values.streetContact]>> 2nd Line of Address: <<[submitterCtrl.values.street2Contact]>> Location Description: <<[submitterCtrl.values.descriptionContact]>> City: <<[submitterCtrl.values.localityContact]>> State: <<[submitterCtrl.values.areaCodeContact]>> Zip: <<[submitterCtrl.values.postalCodeContact]>> County: <<[submitterCtrl.values.countyContact]>> Country: <<[submitterCtrl.values.countryCodeContact]>> |
Hidden Text
Establish Variable Example
<<var [Hidden=SectionControls.FirstOrDefault(sc=>sc.tag ==”HDDN”)]>> |
Reference Variable Example
Hidden: <<[Hidden.values.controlValue]>> |
Calculated
Establish Variable Example
<<var [Calculated=SectionControls.FirstOrDefault(sc=>sc.tag ==”CLCLTD”).values.controlValue]>> |
Reference Variable Example
Calculated: <<[Calculated]>> |
Repeaters
If references to data found within a form repeater is desired, consulting services will be required to perform advanced configuration of the document template.
...