Using Templates in Print Data (Magic xpa 4.x)
This Technical Note describes how to create templates for use with the Print Data functionality.
The Print Data features provides the end user the ability to output the data of the current view in various formats.
To enable the use of this feature, set the Print Data property, in the Task Properties dialog box, to Yes. Note that this option is available only for Online tasks with a selected Main Source.
It is possible to specify a template for XML or HTML files in the Print Data screen.
<html>
<head>
<title></title>
</head>
<body>
<MGTABLE>
</body>
</html>
<MGTABLE > -This tag lets you design your table.
<MGTABLE RowStyle=EvenAndOdd ColumnStyle=Equal>
RowStyle:
All – Magic xpa creates a specific style for each row and title.
EvenAndOdd – Magic xpa creates two styles (MG_Even_Row and MG_Odd_Row).
Equal – Magic xpa creates the same style for each column.
ColumnStyle:
All – Magic xpa creates a specific style for each column.
Equal – Magic xpa creates the same style for all columns.
<MGDate> – System Date and System Time
<MGOwner> – The Owner parameter specified in the Magic.ini file
<MGUser> – The Magic xpa logged in user
You can find an example for HTML template here.
When XML is specified as the print data output type, Magic xpa displays the data in an XML template where the XML tags are labeled according to the control name.
The XML template file should include a reference to the XSL file. If a template file is specified, Magic xpa adds a reference to the XSL file, as displayed below:
<?xml-stylesheet type="text/xsl" href="/articles/bl_Reference/sample.xsl.xsl" ?>
<Print_data>
</Print_data>
You can find more information about XML/HTML templates in the Utilities section of the Magic xpa Reference Guide.