Creating custom attributes

You can add a custom attribute to a schema and use it as a variable. By doing this, you can create a sort on the custom attribute, which you cannot do on regular attributes. You can also design a template that uses a particular attribute as a variable, but then you can change the attribute easily at run time.

Before you begin

Create a variable.

About this task

  • You can only add custom attributes in the entry points of the data source schema. These entry points are the only places in the data source schema where Engineering Publishing can save the changes. You might not be able to tell from the data source schema where these entry points are, but if you are unable to add a custom attribute, you know that the location is not an entry point.
  • Custom attributes cannot be used in native filters.
  • You cannot edit with the Schema discovery wizard, export, or replace data source schemas that contain custom attributes.

Procedure

  1. In the Data Source View, right-click a query.
    If the query permits custom attributes, the New Special Attribute option is available.
  2. Click New Special Attribute.
    The New Special Attribute window opens.
  3. Enter a name for the attribute.
    This name is visible from the Data Source View. The name must use valid Java™ or JavaScript identifiers since they are used in scripts.
  4. Enter a description for the attribute.
  5. For the Value, select Attribute or Variable.
  6. Select a query to add as a child.
  7. Select the Use Condition option to enable sorting and filtering on the child properties of the attribute. The condition operator is always that the attribute equals the variable.
    1. In the Attribute field, select an option.
    2. In the Variable field, select the variable that you created to use with the custom attribute.
  8. Click OK.
    Note: When you copy queries that have custom attributes with variables in them, verify the pasted results. Custom attributes and the variables they use might not be copied over correctly, so you must fix the custom attributes and add the variables again, if necessary.

What to do next

When you publish the document-style report, select an attribute to enter as the variable.