Out Tag
9 min
an out tag is the most basic and most common tag it tells the template to go to the data source, grab one piece of data – such as a number, a last name, an image, (and so on) – and place it in the template unless told otherwise, the out tag will retrieve one data item from the data group use the out tag to display the contents of a node or variable in your report the contents are formatted based on the attributes you set the out tag can be used to display images in almost any format, including png, gif, tiff, jpg, bmp, dib, and more the out tag is also used to display html by using type='template' if the location (that is, filename or url) of the image or html is in the data source (and not the actual data itself), you would instead use the import tag create a context sensitive title page using out tags suppose you have a data group called "contacts" that contains contact information for four people lisa, en jay, tomas and kamala that contact information is further organized into three subgroups first name, last name, and city your template has three out tags, one for each of these subgroups your template might have a table that looks like this contacts first name last name city \<out tag> \<out tag> \<out tag> when you run your report, you would see something like this contacts first name last name city lisa harris roma tags in templates typically have surrounding angle brackets that denote them as tags you can change that by giving a tag a nickname, but we recommend you include angle brackets to make it easier to see what is a tag and what is plain text attributes one of these three attributes must be set select – required (unless value or evaluate is set) displays the contents of the selected node (field) value – required (unless select or evaluate is set) displays the contents of a variable set this attribute to the name of the variable (the data source is not accessed ) evaluate – required (unless select or value is set) evaluates an expression and displays the result set this attribute to the expression (the data source is not accessed ) these attributes are optional default – optional set this attribute to the text to insert into the report if the selected node (field) does not exist if the node exists but is empty, nothing prints in the report (an empty node is considered to exist ) type – optional this involves the use of numberformat & dateformat this attribute defines both how the text in the node is parsed and how it is displayed in both cases it uses the report locale (see the appendix for details) to parse and display the text numbers are parsed using decimalformat parse() date/time can be in the short, medium, long, or full format they can also be a long used in the constructor for the date class (long is a "long integer" such as 123456, which is the number of milliseconds since 01 01 70 ) allowed values are number displays in the locale equivalent of 123,456 78 currency displays in the locale equivalent of $123,456 78 and ($123,456 78) percent displays in the locale equivalent of 55% date displays the date in the locale specific format the node does not need a time in this case time displays the time in the locale specific format the node does not need a date in this case both displays the date & time in the locale specific format bitmap the node data is assumed to be a un encoded string of a file image for an imagefile it will be decoded, read in as a bitmap, and placed in the report template – used to insert html into a document use this when use to select the html in the database if it's actually in the database (you use the import tag to select html in the database if only a filename/url is in the database) limitations in the case of value=, no intelligent parsing of the string occurs it performs a simple text substitution for all ${variable} entries and then outputs the final value to the report the string is not passed to the data source provider for evaluation all of the optional attributes can be used in this case for example, if value= is a number, it can be output as a currency or date several attempts are made to parse the input string (parsing is when autotag reads the text in the data source element and attempts to determine its value ) for a number/currency/percent, it first attempts to parse the string using the appropriate numberformat parse() method and using numberformat applypattern() if this fails, it tries double parsedouble() if that fails, it throws a nodeformatexception for date/time/both six parsing passes occur first, autotag tries dateformat parse() using dateformat applypattern() if that fails, it triesdateformat parse() using the patterns full, long, medium and short without using applypattern() if that fails, it assumes the data is a long and tries date (long parselong()) which is the number of milliseconds since 01 01 1970 if it is not a long, it throws a numberformatexception for more information on patterns and parsing, please view the java documentation for the java classes dateformat, decimalformat, numberformat, and simpledateformat supported html and css for type="template" autotag supports a limited subset of html 4 01 for use in templates the supported tags, attributes, and units/formats are listed below supported tags and attributes tag html attributes css attributes \<a> href, style color, font size \<b> style color, font size \<body> style color, font size \<br/> \<em> style color, font size \<font> color, face, size, style color, font size \<i> style color, font size \<img/> alt, src \<li> style color, font size \<ol> style color, font size \<p> align, class, style color, font size \<strike> style color, font size \<strong> style color, font size \<sub> style color, font size \<sup> style color, font size \<table> border, style, width color, font size, width \<tr> \<td> colspan, rowspan, style, width color, font size, width \<u> style color, font size \<ul> style color, font size supported formats for html attributes html attribute supported formats alt any text align left, center, right, justify border px values class any text color hex values, eg, #f03, #ff0033 black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua colspan an integer face any text href any text rowspan an integer size 1 7 (standard html sizes) pt and px values src any text style css width px values percent values numbers (px) supported formats for css attributes css attribute supported formats color hex values, eg, #f03, #ff0033 black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua rgb(r,g,b) where r, g, b are integers font size 1 7 (standard html sizes) pt and px values width px values percent values numbers (px)