The Wire List report templates are used to generate connection reports that list wires and the target devices to which the wires are connected. On the report templates supplied with the software, the connection point of the target device is displayed along with the device ID.
When the target is a terminal block device, it is sometimes confusing to the end-user or otherwise undesirable to display the typical I or E connection point text of terminal blocks or plugs on wire list reports, since such I and E designations are not found on the physical device.
This document describes how to modify the report template so certain connection point text is not displayed when the report is generated.
The example presented in this document uses Wire List report templates. The concept can also be applied to report templates in the Field Wire List and Terminal-Pin Connections categories. Note the data field names used in the existing scripts in the template and make adjustments to the scripts below as necessary.
Use the screenshots above of concatenated versus separate connection point texts to determine which of the following procedures is appropriate for the report template being developed.
Note: The scripts provided below work by replacing any "I", "E", or "J" connection point texts with an empty string, regardless if they belong to terminals, plugs, or standard devices. The "replacement" is for display in the generated report only; it does not affect the connection point texts in the project itself.
Copy the following script and paste it as the contents of the Before Print scripts for report templates for the cell that displays the device tag and connection point text of target 1. On the supplied "Wire List - Letter" template this cell would be under the "Device Tag" column heading under "From Target". string tag = "", cp = "", sep = ":"; if (GetCurrentColumnValue("T1_DeviceTag") != DBNull.Value) tag = (string)GetCurrentColumnValue("T1_DeviceTag"); if ((tag==null || tag=="") && GetCurrentColumnValue("T1_DEVICETAG") != DBNull.Value) { tag = (string)GetCurrentColumnValue("T1_DEVICETAG"); } if (GetCurrentColumnValue("T1_CP") != DBNull.Value) cp = (string)GetCurrentColumnValue("T1_CP"); if (cp=="I" || cp=="E" || cp=="J" || cp=="") { cp = ""; sep = ""; } (sender as XRLabel).Text = tag + sep + cp;
Copy the following script and paste it as the contents of the Before Print scripts for report templates for the cell that displays the device tag and connection point text of target 2. On the supplied "Wire List - Letter" template this cell would be under the "Device Tag" column heading under "To Target". string tag = "", cp = "", sep = ":"; if (GetCurrentColumnValue("T2_DeviceTag") != DBNull.Value) tag = (string)GetCurrentColumnValue("T2_DeviceTag"); if ((tag==null || tag=="") && GetCurrentColumnValue("T2_DEVICETAG") != DBNull.Value) { tag = (string)GetCurrentColumnValue("T2_DEVICETAG"); } if (GetCurrentColumnValue("T2_CP") != DBNull.Value) cp = (string)GetCurrentColumnValue("T2_CP"); if (cp=="I" || cp=="E" || cp=="J" || cp=="") { cp = ""; sep = ""; } (sender as XRLabel).Text = tag + sep + cp;
The character used as the separator is assigned to the "sep" variable as specified in the above scripts with the following line.
string tag = "", cp = "", sep = ":";
A different character or characters can be used instead.
The above scripts also remove the trailing separator when no connection point text is displayed after the device tag. To revert to the default behavior of the supplied wire list templates and display a trailing separator (":") when the target connection point is null (for example, "CR105: ") find the following line in the scripts: if (cp=="I" || cp=="E" || cp=="J" || cp=="")and change it to: if (cp=="I" || cp=="E" || cp=="J")
Copy the following script and paste it as the contents of the Before Print scripts for report templates for the cell that displays the connection point text for target 1, typically in the "From" area. The cell may contain a data field such as T1_CP. This data field can be removed from the cell, but it is not necessary. string cp = ""; if (GetCurrentColumnValue("T1_CP") != DBNull.Value) cp = (string)GetCurrentColumnValue("T1_CP"); if (cp=="I" || cp=="E" || cp=="J") cp = ""; (sender as XRLabel).Text = cp;
Copy the following script and paste it as the contents of the Before Print scripts for report templates for the cell for the connection point text for target 2. string cp = ""; if (GetCurrentColumnValue("T2_CP") != DBNull.Value) cp = (string)GetCurrentColumnValue("T2_CP"); if (cp=="I" || cp=="E" || cp=="J") cp = ""; (sender as XRLabel).Text = cp;