Show TOC

Function documentationCustom Report Tags Locate this document in the navigation structure

 

You use the Custom Report Tags screen to upload or download custom tag definition and dependency JAR files as a ZIP file to support SAP BusinessObjects tag library in IRPT and JSP files.

Integration

You can embed custom tags in IRPT and JSP files that you create in the SAP Manufacturing Integration and Intelligence (SAP MII) Workbench.

The system uses the Crystal Reports for Java (CRJ) SDK, which is shipped with the SAP BusinessObjects tag library. For more information on custom tags used in crystal reports and embedding Crystal Reports in an IRPT or JSP file, see Embedding Crystal Reports.

Prerequisites

Your custom tag ZIP file must have the following components:

  • A metadata XML file in the following form:

    <?xml version="1.0" encoding="UTF-8"?>

    <Tag-group prefix="bobj" >

    <Tag Name="viewertag" class="com.sap.xmii.report.web.viewer.ViewerTag">

    <Attributes>

    <Attribute Name="reportlocation" required="true"/>

    <Attribute Name="viewername" required="false"/>

    </Attributes>

    </Tag>

    <Tag Name="reporttag" class="com.sap.xmii.report.web.viewer.ReportTag">

    <Attributes>

    <Attribute Name="report name" required="true"/>

    </Attributes>

    </Tag>

    <Dependencies>

    CrystalDatabaseConnectors.jar, CrystalContentModels.jar, CrystalCommon.jar, CrystalCharting.jar, jrcerom.jar, webreporting.jar, webreporting-jsf.jar

    </Dependencies>

    </Tag-group>

    You must upload one metadata file per uploaded tag group. The elements inside the metadata XML are the following:

    • <Tag-group>

      This tag serves as the root element for all uploaded tags. The prefix attribute is mandatory and serves as a namespace for tags in the SAP MII Workbench.

    • <Tag>

      You can have one or more of this element under each tag group. Each tag has the following mandatory attributes:

      • Name

        The name by which this tag is referred to in the SAP MII Workbench

      • Class

        The class name, which is used to parse this tag

    • <Attributes>

      This tag can have multiple child elements that define the tag attributes, which can be used with the tag in the SAP MII Workbench. The child elements define the attribute names and if the attribute is mandatory when the tag is used.

    • <Dependencies>

      This element defines the names of the dependency JARs per tag group. These JARs are loaded in the classpath at runtime.

    The schema for validating the metadata XML is delivered with the exposed interface.

  • Tag implementation class

    These classes integrate SAP MII with the user-defined implementation of the tags.

  • Dependency JARs

    You must upload all dependency JARs defined in the metadata XML file.

Activities

You must deploy the tags after you upload them.

Example

You have defined the following metadata XML:

<?xml version="1.0" encoding="UTF-8" ?>

- <Tag-group prefix="bobj" >

- <Tag Name="viewertag" class=" com.sap.xmii.report.web.viewer.ViewerTag">

- <Attributes>

- <Attribute Name="reportlocation">

<required>true</required>

</Attribute>

- <Attribute Name="title">

<required>false</required>

</Attribute>

</Attributes>

</Tag>

<Dependencies>

CrystalDatabaseConnectors.jar, CrystalContentModels.jar, CrystalCommon.jar, CrystalCharting.jar, jrcerom.jar, webreporting.jar, webreporting-jsf.jar

</Dependencies>

</Tag-group >

You upload the ZIP file with the metadata XML file and the following components:

  • com.sap.xmii.report.web.viewer.ViewerTag.class file as a JAR

  • JAR files defined by the <Dependencies> tag

To use this tag in the IRPT file in the SAP MII Workbench, you make the following entry in the IRPT page:

<bobj:viewertag reportlocation="MyProject/AccountsReport.rpt" title="My report" %>

As defined by the metadata XML file, you can omit the title attribute of the viewertag. At runtime, the CustomTagManager reads the reportlocation and title attributes and stores them in a map in name-value pairs. This map is passed to the ViewerTag class at runtime. The ViewerTag class should have the logic to parse the attributes and generate HTML content to be rendered as output.