Changes

Jump to: navigation, search

Custom Field Type: Special - Advanced Data Table

20,449 bytes added, 19:12, 10 September 2020
Access, Display and Format options for Data
=General Description=[[File:PlayingCard-XML-AcxmlSample.jpgpng|thumb|150pxnone|Click [http://www.smartsimple.com/images/customfield/cards.html here] to peruse our selection of custom fields500px|Example field configured as a budget sheet.]]
The XML Field Type This field type can be used to create worksheets or tables such as budget sheets, and lists of information. A wide range of complexity is supported from very simple tables to multi-section, multi-year budgets. This is used accomplished through the ability to configure sub-sections within the same worksheet, and also define automatic cell calculations. This all adds up to store a block of [[XML]]very robust, and flexible field.
{{FieldOptions}}{{AppearMandatory}}{{TrackChanges}}{{LabelAboveField}}* '''Enable Builder''': see [[XML Section Builder]].{{EnableKML}}{{HideFieldForNewRecord}}* '''XSL Template''': see [[XSL Template]] page By default, the data for instructions.* '''XML Tag Mapping''': see [[XML Tag Mapping]] page for instructions.* '''XML Javascript Function''': see [[this field is stored in the structured XML Javascript Function]] page for instructions(Extensible Markup Language) format.* '''Button Options''': see [[Uploading However, you also have the option to an XML Custom instead use this field]] page as a presentation layer for instructionslists of sub-activity records.{{CustomFieldIDs}}{{VisibilityCondition}}{{FieldPermissionMatrix}}{{ValueStoresTo}}* '''Tool Tip''' - see [[Tool Tip]] page For example, you may use this field on a UTA Level 1 record to display any associated UTA Level 2 records for instructionsa user to easily update the activities or create new activities.{{FieldPermissions}}
If you are looking to create a basic list or budget, you can also use the field called '''[[Custom Field Type: Special - In-Line Data Grid|Special - In-Line Data Grid]].'''
{| class="wikitable"
|-
||Summary
||
|-
||Commonly Used in Markets (Philanthropy, Research, Insurance)
||All
|-
||Used By (User Type)
||All
|-
||Requires Administrator Setup
||Yes
|-
||Configuration Complexity (Low, Medium, High)
||High
|-
||Time to Configure (Minutes, Hours, Days)
||Hours
|}
==Field Options==
All common options:<br />
[[Custom Fields - General Information #General_Settings|General Settings]]<br />
[[Custom Fields - General Information #Role Field Permissions and Status Field Permissions|Permissions & Availability]]<br />
[[Custom Fields - General Information #Classic Options|Classic Options]]<br />
For further information, please refer to [[Custom Fields – General Information]].<br /><br />
Options listed below are specific to this particular field type.<br />
{{XSL Template}}
The {{XML stored in this field can be:* Copied and Pasted from a source file. * Stored into the field from a workflow process using the SmartSimple [[Integration]] Server. * Used with other [[Web Services Overview|Web Service]] types processes.Tag Mapping}}
{{XML Javascript Function}} {{Show View XML Button}} {{Show Upload Button}} {{Show Up/Down Button}} {{Show Clear Button}} {{Custom Field Ids}} =Configuration - Essentials==Example=Creating the field==Here is an example Typically Advanced Data table custom fields are created for UTA level 1, 2 or 3, (e.g. a grant application) or they are created for organizations. To create the field: # Navigate to the desired settings area where you want to create a worksheet (e.g. the UTA level 1).# Click the '''New Field''' (+) button.# For Field Type select '''Special - Advanced Data Table'''.# Enter a '''Field Name''', '''Caption''' then '''Save'''.# Use the '''Section Builder''' button to begin process of creating the XML tables.# Use the '''Custom Field''' button to navigate back from the Section Builder to the Field settings to configure the display of tables. ==Create a Simple Table==Using the '''Section Builder''' you can create sections and define the attributes of each section and the cells within them. You can define the number of rows and columns, the display format, calculation formulas, and modify other parameters. [[File:xml-sectionbuilder1.png|thumb|none|500px|The section builder.]] # While editing the custom field called click on the '''Section Builder''' button (the four square icon) in the action bar.# Create a '''New''' section and enter a '''mypastaSection Name''' which stores (e.g. Expenses).# Enter '''Number of Rows''' and '''Number of Columns''' desired.# Once you '''Save''' you will be brought to the '''Cell Details''' tab.# Define a '''Display Name''' for the column headers (e.g. Item, Amount, Date).# Define a '''Display Name''' for the first column of each row (e.g. Salaries, Equipment, Other).# Within each of the column headers you can define a recipe '''Format''' for the column (e.g. Text, Currency, Date). For the Number format option you may also specify a precision.# When you are done click the '''Build button'''. Note : # When you choose the format '''Currency''' in a column header, make sure you specify the column alignment as '''Right Align'''. This way it will be easy for the user to compare the values. This step is also required if you plan to export this data to PDF for printing.# You must use unique node names of sections, rows, and columns within this field. ==Create a Table with a Dynamic Number of Rows==[[File:xmlDynamic.png|thumb|none|500px|Example section set to dynamic rows.]] In addition to defining a set number of columns and rows, you can also configure a section to handle a dynamic number of rows. The user entering the data can add rows as necessary at time of entry. This is done by entering '''0''' for the '''Number of Rows''', which in turn exposes the following configuration options: * '''Maximum Number of Rows''': Set a maximum limit to the number of rows that although can be entered, or leave as 0 for no limit.* '''Maximum Message''': The message to be displayed when the maximum limit is set and reached by a user. A default message is displayed if this input is empty. Setting the Number of Rows to 0 also exposes the following configuration options for each column header within the Cell Details tab: * '''Has Total''': Display the total sum of the column.* '''Total Row Label''': For columns without a total display this stores only oneoption allows you to enter a label for the total sum of another column. For example, if column 3 was displaying a total, multiple recipes then you could be stored configure the '''Total Row Label''' of column 2 to display 'Total'. ==Configure the Display of Tables==The presentation of the XML Data custom field is configured in the same block '''General Settings''' tab of XMLthe field. This is defined in the XSL Template (Extensible Style Sheet Language)inputn. The XSL Template includes a sample template link. Once you have inserted sample template you will need to specify which sections should appear and where they should appear. [[File: xml-xsl.png|thumb|none|500px|The XSL template and configuration.]]<pre><?xml version="1# While editing the custom field locate the '''XSL Template''' link and insert the '''Sample Template'''.# Locate the marker below.0" encoding="UTF-8"?> <recipepre> <title!---- Insert section variable here ---->Beef Parmesan with Garlic Angel Hair Pasta</titlepre> <Author># Below this marker, insert variable references to the each section with the following syntax (e.g. @section.Expenses@) in the order in which you wish the sections to appear. <Firstname>Wendy</Firstname> <Lastname>Houston</Lastname>Note: <Address> <Street>148 Peter Street</Street># Make sure you are using the '''Section Node Name''' and not the '''Section Name''' <postalcode>L7Y 2P5</postalcode># '''Section Node Name''' is case sensitive Example if your '''Section Node Name''' is '''Expenses''' than @section.Expenses@ will work but @section.expenses@ will not because it has a lower case '''e'''. </Address> </Author> @section.''SectionNodeName''@ <ingredients> <ingredient amount="1.5" unitConfiguration - Advanced="pound">Beef cube</ingredient> <ingredient amount="2" unit="kg">Italian Pasta</ingredient>Creating formulas (calculations) in cells==[[File:xml-formula.png|500px|border|Adding a formula]] </ingredients> <preparation>In the section builder you declare the formatting such as currency or numeric for specific columns as well as choose the precision. <step orderYou can also do calculations on numeric and currency data (e.g. to sum the contents of column one, over two rows, enter '''=[1,1]+[2,1]''1'>).    <description>Preheat oven ==Adding a formula to 350 degrees F a cell (175 degrees Cworking with data in the same section)==# Navigate to your custom field.</description> </step># Click the '''Section Builder''' button in the action bar. <step order=# Click the desired '''Section''2'>to edit it. <description>Mix all ingredients# Click the desired '''Cell'''.</description> </step># Enter the desired formula into the '''Content''' input. <step order=# Click '''Build''3'>.   <description>Put everything into oven.</description>The Syntax for basic calculations within a section: </step> <step order{| class="wikitable"|-||'4'>'Operation'''||'''Symbol'''||'''Example'''|-||Add||+||=[row#,column#]+[row#,column#]|- <description>Done.</description>||Subtract </step>||- <step order||='5'>[row#,column#]-[row#,column#]|-||Divide <description>Find a phone number of the closest take out restaurant.<||/description> <||=[row#,column#]/step>[row#,column#]|-||Multiply||*||=[row#,column#]*[row#,column#]|} </preparation> <comment> Make So if you wanted to add the meat ahead values of timerow 1 and 2 together in column 1 you would enter '''=[1, and refrigerate over night1]+[2, 1]'''. ==Adding a formula to a cell (working with data in the acid different sections)==Refer to cells in the tomato sauce will tenderize the meat even moredifferent sections using this syntax  '''[@section.''sectionname''.id@_''rownodename''_''columnnodename'']'''  e.g. '''=[@section.''expense''.id@_''Total_Amount'']-[@section.''income''. id@_''Existing-funds''_''Amount'']'''   If you do this, save need want to display data in the mozzarella till head of a section (row 0) from another section you can use the last minutefollowing: '''@xml.customfieldname.sectionnodename.rownodename.columnnodename@''' </comment> <nutrition calories="1167" fat="23" carbohydratesValidate values when saving the worksheet="45" protein="32"/>Clicking on a cell inside the section builder will present you with the cell properties. There are two cell properties used for the validation of cells when the xml worksheet is saved. * '''Validation Script''': Validates the input field.* '''Validation Message''': Content that is displayed, when the validation script is not true (e.g. Value must be greater than 100).  Examples * Total Amount greater than 0, for currency formatted column totals </recipepre>ssParseNum([this])>0</pre>Message: Total must be greater than $0.00   * Date is at least 30 days in the future
==Variables==<pre>datediff(ConvertDateStr([this],'@dateformat@'),'@date(currentdate)@','d') > 30</pre>Message: Please select a date that is at least thirty 30 days from today.
Access to the data within the XML field uses standard SmartSimple variable references. :<font size=3>'''@xml.'''''field name.parentnodename.nodename'''''.nodevalue@</font>:<font size=3>'''@xml.#'''''fieldid'''''#'''''.parentnodename.nodename'''''.nodevalue@</font>:<font size=3>'''@xml.'''''field name.parentnodename.nodename'''''.attribute('''''attributename''''')@</font>:* There may Cell is not be a parent node, or there may be multiple parent nodes, depending on how the XML is formatted.empty
<pre>[this].length>0</pre>
Message: Please provide a value.
Formatting node values:
:<font size=3>'''@xml.'''''field name.parentnodename'''''.[# ~comma('''''nodename'''''.nodevalue)~ #]@</font>
:* This will return a numeric nodevalue with comma formatting (i.e. 1000 will be displayed as 1,000)
:<font size=3>'''@xml.'''''field name.parentnodename'''''.currency('''''nodename'''''.nodevalue)@</font>
:* This will return a numeric nodevalue in currency format. (See also [[Displaying_a_Number_Value_as_Currency#XML_data|Displaying a Number Value as Currency]].)
* Check the user selected something other than the default Combo Box value
To display the section::<font sizepre>[this]!=3>@xml.fieldname.sectionname.html@"Default Combo Box Value"</fontpre>Message:<font size=3>@prexmlPlease select a value.fieldnameNote, '''Default Combo Box Value''' should be substituted with the default value you have configured, e.sectionnameg.html@</font> '''--- Select One --- This will process variables that are referenced in the section'''.
Date formatting node values:
The available syntax for date formats are as follows: ~formatdate(Date.nodevalue)~ >> returns the date in the user's date format ~year(Date.nodevalue)~ >> returns the year from the date ~month(Date.nodevalue)~ >> returns the month from the date ~monthname(Date.nodevalue)~ >> returns the month name from the date ~day(Date.nodevalue)~ >> returns the day from the date ~dayweek(Date.nodevalue)~ >> returns the day of week from the date
''Examples'':Where there is a single entry of 2014-12-02 in * Integer greater than 0 (Allow only an XML integer or if your field FORMAT: @xml.fieldname.Expenses-Static.row[# ~formatdate(col4.nodevalue)~ #]@ <br/>YEAR: @xml.L1-on the XML Budget.Expenses-Static.row[# ~year(col4.nodevalue)~ #]@ <bris formatted to display/>MONTH: @xml.L1-XML Budget.Expenses-Static.row[# ~month(col4use a comma.nodevalue)~ #]@ <br/>MONTHNAME: @xml.L1-XML Budget.Expenses-Static.row[# ~monthname(col4.nodevalue)~ #]@ <br/>DAY: @xml.L1-XML Budget.Expenses-Static.row[# ~day(col4.nodevalue)~ #]@ <br/>DAYWEEK: @xml.L1-XML Budget.Expenses-Static.row[# ~dayweek(col4.nodevalue)~ #]@ <br/>
<pre>parseInt([this])>0</pre>
Message: Please provide a numeric value greater than 0.
FORMAT: 2014-12-02
YEAR: 2014
MONTH: 12
MONTHNAME: December
DAY: 02
DAYWEEK: Tuesday
Counting nodes::<font size=3>'''@xml.'''''field name.parentnodename.nodename'''''.nodecount@</font>* Value entered in one cell cannot be more than 20% above or below the value in another cell
For child records::<font sizepre>(ssParseNum([this])>=3>'''@xml.'''''fieldname.nodename'''''(ssParseNum([# ~nodevalue~ ~attributes1,4])*('''''attribute name'''''0.80)~ #) && ssParseNum([this]@'''''</font>:)<font size=3>'''@xml.'''''fieldname.nodename'''''(ssParseNum([# ~'''''childnodename'''''1,4])*1.nodevalue~ ~'''''childnodename'''''.attributes('''''attribute name'''''20))~ #]@'''''</fontpre>Message: Value entered in one cell cannot be more than 20% above or below the value in another cell
To return the actual XML code from the field:
:<font size=3>'''@'''''fieldname'''''.xmlvalue@'''</font>
* '''Important:''' XML node names are case sensitive==Validating values when saving record (SmartCheck, Submit Logic, Browser Script)==In addition to validating values when you save the worksheet you can also validate the worksheet when you save the record (e.g. save a level 1 grant application).
==Variable Examples==When creating validation for an this custom field use the '''Appear Mandatory''' option. Appear mandatory does not enforce the validation but will make the field look mandatory (it adds the asterisk and or color) just like the mandatory option. Once you have checked '''Appear Mandatory''', validate this field using one of the following validation methods, when the record is saved.
Created By @xml.mypasta.Author.Firstname.nodevalue@ @xml.mypasta.Author.Lastname.nodevalue@
* '''Result''': Created By Wendy Houston
===SmartCheck Validation===
Use SmartCheck for validation when possible. SmartCheck validation is a secure server-side method. SmartCheck also displays all error messages in a context as well as in one central place.
@xmlValidate a table node is not empty and display a message.mypasta.Author.Address.Street.nodevalue@ @xml.mypasta.Author.Address.postalcode.nodevalue@* '''Result''': 148 Peter Street L7Y 2P5
<pre>if("@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@"=="")
{result.isPassed=false;
result.addMsg('xml_@fieldname.id@','YourAlertMessage'); }</pre>
@xml.mypasta.title.nodevalue@ @xml.mypasta.comment.nodevalue@ Calories=@xml.mypasta.nutrition.attributes(calories)@==Submit Logic Validation===* '''Result''':Beef Parmesan Use Submit Logic in conjunction with Garlic Angel Hair Pasta<br />Make the meat ahead of time, and refrigerate over night, the acid in the tomato sauce will tenderize the meat even moreSubmit Buttons to Validate a worksheet. If you do this, save the mozzarella till the last minute.<br />Calories=1167
Check a node in not blank when saving the worksheet.
Ingredients Name - amount - unit <pre>"@level1.xml.mypastafieldname.sectionnodename.ingredientsrownodename.columnnodename.ingredient[#~nodevalue~ - ~attributes(amount)~ - ~attributes(unit)~#]@* '''Result''':Ingredients<br />Name - amount - unit<br />Beef cube - 1.5 - pound"!=""<br /pre>Italian Pasta - 2 - kg
Steps===Special - Browser Script validation=== Order Description @xml.mypasta.preparation.step[#~attributes(order)~ ~description.nodevalue~#]@* '''Result''':Steps<br />Order Description<br />1 Preheat oven You can enter JavaScript and jQuery into XML JavaScript Function input to 350 degrees F (175 degrees C)create specific validations.<br />2 Mix all ingredients.<br />3 Put everything into oven.<br />4 Done.<br />5 Find Use the following syntax when referencing a phone number of the closest take out restaurantvalue in your variables.
<pre>@xml.customfieldname.sectionnodename.rownodename.columnnodename@</pre>
To format as currencyThe following function allows you to check for an already selected value from an existing row when using dynamic rows: @xml.Budget.source.category-total.currency(cash.nodevalue)@
To format as currency with euro symbol "€": @xml.Budget.source.category-total.currency_eur(cash.nodevalue)@<pre>// REPLACE '7172_dsItem_Population' AND '7172_dsItem_Population_' WITH SPECIFIC XML FIELD ID
To create multiple lines in a table for each node that exists:var saveFunc=saveXML;saveXML=function() { checkdupeval();<pre> } @xml.budget.funding-source.requested[#function checkdupeval() { <tr>var result = 0; <td>&nbspvar numOfRows = document.getElementsByName('7172_dsItem_Population');</td>/section node <td classvar ctr=1;for (ctr="answer border">Requested from the program1;ctr</td>numOfRows.length;ctr++){ <td classvar field1="answer border"><div align'7172_dsItem_Population_'+ctr;var lastfield="right">&nbsp'7172_dsItem_Population_'+numOfRows.length;~currencyvar a = document.getElementById(cashfield1).value;var b = document.nodevaluegetElementById(lastfield)~</div></td>.value; <td classif( a ==b){ alert ("answer borderPlease list each population no more than once.">~status.nodevalue~&nbsp);</td> <td class result ="answer border">~field.nodevalue~&nbsp1;</td> </tr>}}if(result==0) saveFunc(); #]@}
</pre>
==Reporting==To extract The following function allows you to check for an already selected value from an XML element in a report existing row when using the XML field, using the '''mypasta''' XML example above, add the XML field to the report and add following to the [[Calculated Field]] in the [[Report Builder]]dynamic rows on multiple sections
<pre>
ExtractValuevar saveFunc=saveXML;saveXML=function([this], ) {if (checkdupeval_Section1() == 0 && checkdupeval_Section2() == 0 && checkdupeval_Section3() == 0) { saveFunc(); }  }function checkdupeval_Section1() {var result = 0;var numOfRows = document.getElementsByName('16580_row_COUNTY'); // REPLACE '16580_row_COUNTY' AND '16580_row_COUNTY_' WITH SPECIFIC XML sectionid_rownodename_columnnodename for Section 1var ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='16580_row_COUNTY_'+ctr;var lastfield='16580_row_COUNTY_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each option no more than once for Section 1."); result = 1;}} return result; } function checkdupeval_Section2() {var result = 0;var numOfRows = document.getElementsByName('16581_row_COUNTY'); // REPLACE '16581_row_COUNTY' AND '16581_row_COUNTY_' WITH SPECIFIC XML sectionid_rownodename_columnnodename for Section 2var ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='16581_row_COUNTY_'+ctr;var lastfield='16581_row_COUNTY_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each option no more than once for Section 2."); result = 1;}} return result;} function checkdupeval_Section3() {var result = 0;var numOfRows = document.getElementsByName('16582_row_COUNTY'); /recipe/titleREPLACE '16582_row_COUNTY' AND '16582_row_COUNTY_' WITH SPECIFIC XML sectionid_rownodename_columnnodename for Section 3var ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='16582_row_COUNTY_'+ctr;var lastfield='16582_row_COUNTY_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each option no more than once for Section 3."); result = 1;}} return result; }
</pre>
This will display the value ''"Beef Parmesan with Garlic Angel Hair Pasta"'' in the report.
<pre>
ExtractValue([this], '/recipe/Author/Address/Street')
</pre>
This will display the value ''"148 Peter Street"'' in the report.
Further MySQL ==Managing Level 2 / 3 Activities with a Section==System administrators can configure this field to add, modify or delete {{l2}} records on a {{l1}} entity or {{l3}} records on a {{l2}} entity. In the '''Section Builder''', when the ''Number of Rows'' for a Section is set to '0', the ''Enable Mapping'' option will be shown. [[Image:XMLEnableMapping2017.png|link=|800px|border]]  When '''Enable Mapping''' is selected, you can choose one type of activities to be referenced by this field. The '''Activity Status Filter''' setting allows you to filter the activities to be referenced by status. The '''Additional Filter''' setting allows you to select custom fields and associated values. These are used to filter the existing activities that will be listed within this field. The custom fields used have to be fields with pre-defined options (e.g. [[Custom_Field_Type:_Select_One_-_Dropdown_List|Select One - Dropdown List]], and [[Custom_Field_Type:_Select_Many_–_Check_Boxes|Select Many – Check Boxes]]). [[Image:XMLEnableMappingFilter2017.png|link=|650px|border]]  When building your section, you will need to map the fields on the {{l2}}s that will be referenced by the section. For each Section column, enter the field name from the Level 2 type that you have selected from the '''Activity Type''' dropdown in the '''Map Field''' section: [[Image:MappingL2Fields2017.png|link=|800px|border]]  The syntax for the '''Map Field''' section is: * for [[custom fields]], the field name (i.e., '''Fund Name''');* for [[Standard_Field|Standard Field]]s, use the prefix '''sf_''' and then the system name for the standard field (i.e., '''sf_status'''). see [[Standard Level 2 Field List]] article for a list of system names for {{l2}} standard fields.If the Standard or Custom field has a limited number of pre-defined options then these need to extract be defined in the Content section of the cell properties. You may need to reference some standard field options using both the displayed name and stored ID values . [[Image:MappingL2Fields2018.png|link=|650px|border]]   When this section is added to the Template of your field, the list of {{l2}} activities will be displayed when the worksheet is opened. Level 2s can be added, deleted and modified directly from the {{l1}} Advanced Data Table field. =Displaying XML Data===Displaying Advanced Data Table data on an object==[[File:xml-readonly.png|500px|border|The XML displayed in a read only]]  The Advanced Data Table custom field can open in a new or modal window. The '''Open in Modal Window''' option is recommended. You can toggle this on under '''Document Options'''. By default the information entered into this field type is hidden until the user clicks a button. But there is a way to display the information entered into this field on your object, such as a grant application, without requiring the user to click a button and launch the modal window. Use the '''Display - Text and Variables''' custom field to display the content of the Advanced Data Table on the object. The same syntax can be found at [httpused elsewhere in the system when referencing this field's values.   # Go to the desired location where you want to create the custom field.# Click the '''New Field''' (+) button in the action bar.# For '''Field Type''' select '''Display - Text and Variables'''.# Enter a '''Field Name'''.# For '''Variables''' enter '''@xml.''CustomFieldName''.''SectionNodeName''.html@''' (replace the '''CustomFieldName''' and '''SectionNodeName''' with the actual names from your XML example '''@xml.Budget.Expenses.html@''').# Scroll Down to the '''Display''' section.# For '''Caption''' select '''Hide Caption''' (we recommended that you hide the caption for the display so that you can utilize the full screen width).# Click '''Save'''.# Navigate back to the Advanced Data Table field and click '''Save''' (this updates the linkage and ensures when data is entered into the worksheet the data displayed on the object will also get automatically updated. If you miss this step, information entered into the Advanced Data Table will only refresh in the Display - Text and Variables field when the object is saved. Note:you may want to create two '''Display - Text and Variables''' custom fields for each '''Advanced Data Table''' custom field. One that you will use for printing and one for displaying on the object. ==Access, Display and Format options for Data==The syntax options for accessing, displaying and formatting the data from the Advanced Data Table field is detailed below.   * Extract the value from a specific individual cell using the '''field name'''. <pre>@xml.fieldname.sectionnodename.rownodename.columnnodename@</pre> * Extract the value from a specific individual cell using the '''field id'''. <pre>@xml.#fieldid#.sectionnodename.rownodename.columnnodename@</devpre> * Extract numeric value and return in '''comma format''' (i.mysqle. 1000 will display as 1,000). <pre>@xml.fieldname.sectionnodename.rownodename[# ~comma(columnnodename.comnodevalue)~ #]@</docpre> * Extract a numeric value and return in '''currency format'''. <pre>@xml.fieldname.sectionnodename.rownodename[# ~currency(columnodename.nodevalue)~ #]@</refmanpre> * Extract a numeric value and return in a '''specific currency format'''. <pre>@xml.fieldname.sectionnodename.rownodename[# ~currency_eur(columnodename.nodevalue)~ #]@</5pre>Further currency formatting options below {| border="1"|-||usd||$300.00|-||eur||€300.00|-||jpy||¥ 300|-||zar||R 300.00|-||inr||₹300.00|-||frca||300,00 $|}  * Extract a numeric value and return in '''currency format with two decimal places'''. If pulled from a '''dynamic''' XML section then you will see multiple values. <pre>@xml.fieldname.sectionnodename.rownodename[# ~currency_eur(columnodename.1nodevalue,2)~ #]@</enpre> * Extract a value and return the number of characters in the field. <pre>@xml.fieldname.sectionnodename.rownodename.columnodename.nodevaluelength@</pre> * Extract a numeric value and return in '''currency format with two decimal places''' for value pulled from a '''static''' XML section. <pre><!--@sscalculation(format("@xml.fieldname.sectionnodename.rownodename.columnodename.nodevalue@",2))--functions></pre> * Extract a percentage value and '''format with two decimal places'''. If pulled from a '''dynamic''' XML section then you will see multiple values. <pre>@xml.fieldname.sectionnodename.rownodename[# ~percentdisplay(columnodename.nodevalue,2)~ #]@</pre> * Extract date values and return with specific formatting using the following syntaxReturn the date in the user's date format <pre>@xml.fieldname.sectionnodename.rownodename.formatdate(columnnodename.nodevalue)@</pre> * Return the year. <pre>@xml.fieldname.sectionnodename.year(columnnodename.nodevalue)@</pre> * Return the month. <pre>@xml.fieldname.sectionnodename.month(columnnodename.nodevalue)@</pre> * Return the month name. <pre>@xml.fieldname.sectionnodename.monthname(columnnodename.nodevalue)@</pre> * Return the day. <pre>@xml.fieldname.sectionnodename.day(columnnodename.nodevalue)@</pre> * Return the day of the week. <pre>@xml.fieldname.sectionnodename.dayweek(columnnodename.nodevalue)@</pre> * Count the number of rows the user created in a dynamic XML section. <pre>@xml.fieldname.sectionnodename.rownodename.nodecount@</pre> * Return the XML feed (code) from the field. <pre>@fieldname.xmlvalue@</pre> * Return multiple rows for XML with dynamic sections. <pre>@xml.fieldname.sectionnodename.rownodename[# ~columnnodename.nodevalue~ #]@</pre> * Return Filtered row values for XML with dynamic sections. <pre>@xml.fieldname.sectionodename.rownodename[#(?criteria="~colunnnodename.nodevalue~" == "matching criteria")~columnnodename.nodevalue~ #]@</pre> * Return multiple rows for XML with dynamic sections in a custom html MySQL table. <pre>@xml.fieldname.sectionnodename.rownodename[# #]@</pre> {| border="1"|-||~columnodename.nodevalue~||~columnodename.nodevalue~||~columnodename.nodevalue~|} * Return a single value in the total row of a Dynamic XML Functions. <pre>@xml.fieldname.sectionnodename.total.columnnodename.nodevalue@</pre> ==Styling Advanced Data Table for web, print and conversion to PDF==[[File:xml-readonly-styled.png|500px|border|The worksheet styled at 700 pixels wide in a Display Text and Variables custom field] ] To ensure data entered into an '''Advanced Data Table''' fits on screen and will converted to a PDF without having data cut off, administrators need to upload two external CSS style sheet to a SmartFolder, reference it on the '''Advanced Data Table''' and the '''Display Text and Variables''' fields as well as add some code to both of these fields. Note:  # Make sure your Advanced Data Table has 8 or less columns to ensure it will print and fit on screen.# If the user is expected to enter paragraphs of information, do so in a new row or new section, instead of adding another column.# If your worksheet does not look as expected make sure '''Apply Default Styles''' is toggled on in the '''Section Builder''' and then click '''Build''' on each of your sections in the section builder.  ===Styling the Advanced Data Table for viewing onscreen===Ensure the columns and rows of your '''Advanced Data Table''' look good onscreen, when a user enters information, by following the steps below. ====Uploading the external CSS files and getting the relative links====# Download the CSS files [[File:CSS.zip|CSS.zip]]# In your desired instance navigate to the Menu Icon and choose '''SmartFolders'''# If it does not exist already create a '''New Folder''' and call it '''System Files'''# Upload the CSS files found inside the Zip file you downloaded in step 1# Inside SmartFolders in the column called '''File Options''' for the desired file select '''View URL''' from the drop down. This will give you the absolute path to the file you uploaded# Copy this link that starts with '''https:''' and ends with '''/CSS_for_XSL_onscreen_1290.css'''.# Remove the first part of the link before the '''/files...''' to make it a relative link. Absolute links can have an adverse affect on your instance and they won't work as expected on your backup. So Always convert the absolute link to a relative link. Your relative link will look like '''/files/000000/f000000/CSS_for_XSL_onscreen_1290.css'''# Save this relative link in a text file so we can add it to each '''Advanced Data Table''' custom field in your instance.# Repeat steps 5 to 8 for the second CSS file which will be used for rendering on the object and in the PDF. ====Modifying the Advanced Data Table template====# Download the templates used for the '''Advanced Data Table''' and the '''Display Text and Variables''' fields [[File:TEMPLATES.zip]].# In the desired '''Advanced Data Table''' Field paste the content from the xsl_template_1290 file you downloaded, into the XSL Template input.# Change the href in the link to the relative URL that points to the CSS file you previously uploaded to the SmartFolder (Example href="/files/000000/f000000/CSS_for_XSL_onscreen_1290").# Update the text called '''Title''' in two places inside the XSL template.# Update '''@section.Section Node Name@''' with the '''Section Node Name''' you want to display.# Modify the class wrapper with the amount of columns in your section. Example '''class="xml6col"''' is for a 6 column section. If you have 2 columns, change it to '''class="xml2col"'''.# Save the Advanced Data table Field. Now when you click the button to open the Advanced Data Table you will see your columns will render nicely and they will be equal in width. Note: # Under Display you can customize the Button Label. To meet with Accessibility guidelines you must change the button label from '''Open''' to something meaningful like '''Modify Budget'''. The user must know what the button will do based on the text in the button. You cannot have a generic link that says '''open''' or '''click here''' as that does not provide enough information when read out of context by a screen reader.# Sections must contain 8 or less columns to render properly and be usable. ===Styling Advanced Data Table for Converting to PDF and Printing===You can print your Advanced Data Table content by displaying it in a '''Display Text and Variables''' custom field. In order to do this the content must fit within 700 pixels wide (portrait) or 900 pixels wide (landscape) otherwise content will cut off when a PDF is an external websitegenerated. To ensure content does not cut off and to ensure columns between sections align, we will use CSS in a SmartFolder and amend our '''Display Text and Variables''' custom field. # Navigate to the desired '''Display Text and Variables'''.# Paste the contents of '''display.html''' into the '''Content''' section of the field.# update the href to point to the relative path to the file called '''xml-print.css''' that you uploaded to the SmartFolders.# Add your desired variable example '''@xml.Budget.Expenses.html@''' inside the div with the '''class="xml8col"'''.# Change the '''8''' in '''class="xml8col"''' to the number of columns in your section. Note you must have 8 or less columns.# If you want this table to be displayed wider for landscape printing add the word '''landscape''' in the class example '''class="xml8col landscape"'''. # Save your custom field You now have a version of your Advanced Data Table that you can display on the object such as the level 1 application and you can convert this to a PDF using the Web Page View custom field. If you created two '''Display - Text and Variables''' custom fields one for printing and one for onscreen. The above instructions are for the print version as it will reduce the font size and constrain the content to 700 pixels. In this print version use the setting '''SmartFields View''' and choose '''Include'''. This will include this field in the PDF. On the second '''Display - Text and Variables''' intended for on screen use '''SmartFields View''' and choose '''Exclude'''. This will hide the onscreen version from the PDF. Lastly for the onscreen version you do not use the xml-print.css or the div wrappers. ==Reporting on Advanced Data Table data==Extract values in a report using the following syntax in the report builder. This will return one value for static sections specific to the row and multiple values for Dynamic sections across all rows.
==See Also==* <pre>ExtractValue([[XML Section Builder]]* [[Managing Level 2 Activities with an XML Section]]* [[XSL Template]]* [[Referencing Other Sections in XML Calculations]]* [[Adding Styles to XML Worksheetsthis]]* [http://dev.mysql.com, '/docworksheet/refmansectionnodename/5.1rownodename/encolumnnodename')</xml-functions.html MySQL XML Functions] Note: this is an external website.* [[Number Format]]pre>
{{CustomFieldPageFooter}}[[Category:XML]]{{WC}}
Smartstaff, administrator
3,315
edits

Navigation menu