Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This guide will help you get a better understanding of parameter injections.

Suggested Reading

Read these guides first before continuing:

Understanding Parameter Injections

...

Injecting parameters into a macro means that you can take a parameter of a Supplier and inject the value of that parameter into that macro.

...

Let's start with something basic and display the page's title.

  1. Create a Report On macro.

  2. Tick the Injected parameter.

  3. Within the report-on macro, type in "%content:title%".

  4. You should have something like this:

    Image Modified

    Which should display this: 
    "Injecting Parameters with Parameter Injections"

Example 2: Showing the Page Title of the Parent Page

Let's show the title of the parent of the current page.

  1. First, create a Report Variable macro.

  2. For the Name parameter, type in "Parent Name".

  3. Now, let's inject the following keychain into the Value parameter:
    %page:parent > page:title%

  4. Create a Report Info macro so we can get the results of the Value from Report Variable.

  5. For the Key parameter, type in "variable:Parent Name".
    (Notice that the variable is called using a keychain using the Variable Supplier.) 

  6. You should have something like this:

    Image Modified

    Which should result in this:

    "Intermediate Tutorials"

Example 3: Displaying a Message with Multiple Values from Different Suppliers

Let's display a message that contains several parameter injections.

  1. Start by creating a report-variable.

  2. For the Name parameter, type in "Message".

  3. For the Value parameter, let's type in this text string which includes some injected parameters:
    "Created by %page:creator > user:full name% on %page:creation date > date:dd-MMM-yyyy%"

  4. Now, create a Report Info macro.

  5. For the Key parameter, type in "variable:Message".

  6. You should now have something that looks like this:

    Image Modified
    Which should result in this:

    "Created by Ted Mahsun on 18-Sep-2014"