List query templates define the lists that are to be included in a report. You can create a list query template on a list by list basis, for a number of list types, for all lists or for all libraries. A report can have any number of list query templates.

To add a list query template:

  1. Navigate to the BrightWork Reporter Library, select the report and click Files | Report Editor.
  2. Click Add a new list query template in the List Query Template section.
  3. Specify the Context Settings.

    Context Settings enable you to define a list to use to test your CAML and to build the column mappings. It is important that you select a context first as selecting a new one resets the page.

    1. Select Change Selected Site from the Selected Site menu.
    2. Click a site that has an example of the list you want to query.

      This SharePoint dialog shows 15 items at a time. There is a link in the top-right of the dialog to see the next 15 items. This also applies when selecting the list context.

    3. Select Change Selected List from the Selected List menu.
    4. Click the list that you will be using to test the CAML and build the column mappings.
  4. Select the List Query type:
    • List Type
      Enter the List Type number(s) - see BrightWork and SharePoint List Types.
    • This is the option you will most likely need to use.

      You can only have one instance of each list type per report.

      If you have specified a context, the List Type number will be displayed.

    • List Name
      Enter the list name, for example, to report on all lists called Tasks enter Tasks.
    • Default List
      This option allows you to report off all lists using the same query irrespective of the list name or type (lists already / subsequently specified with List Type or List Name will not be queried by this method).
    • This option can be useful if you want to query all the lists in the scope when you know that they all share common columns that you can query against; however it does return all lists, including Tabs, List of Lists etc.

    • Default Library
      This option allows you to report off all libraries using the same query irrespective of the library name or type (libraries already / subsequently specified with List Type or List Name will not be queried by this method). This option can be useful if you want to query all the libraries in the scope when you know that they all share common columns that you can query against.
    • This option can be useful if you want to query all the libraries in the scope when you know that they all share common columns that you can query against; however it does return all libraries, including BrightWork pages.

  5. Enter the Query CAML (optional).
    See Working with Query CAML.
  6. Specify an Items Returned Limit (optional).
    This option allows you to limit the number of items returned in the report for this list query template.
  7. Select a Scope (optional).
    • All Items
      This is the default setting. It means that items in folders and subfolders are returned by the report but not folders.
    • All Item and Folders
      This means all items and all folders are returned by the report.
    • Top Level Items Only
      This means that only top level items are returned by the report. Folders and items in folders are not returned by the report.
    • Top Level Items and Folders
      This means that only top level items and top level folders are returned by the report. Items in folders and subfolders are not returned by the report.
  8. Click OK.
    This will bring you to the Column Mapping page.

    The purpose of the column mappings page is to map columns in the report to columns in the List Query Template. To be able to map a column in a List Query Template you must first add the column to the report.

    If you have specified a context, you will be able to select a column from the List menu on the left.

    If a column in the list and in the Columns section have the same internal name they will be automatically mapped.

  9. Select Include Project Statement Columns (optional) if you would like to include columns from the Project Statement.

    This feature enables you to use columns from the Project Statement list in and on the report. Columns you add from the Project Statement will be available for selection in the Reporter Settings page.

  10. Select the columns you would like to include.
  11. If necessary, specify a new internal column name so as to remap the column to another column in the Columns section. You will need to know the internal column name used in the Columns section.

    Column Mapping Scenarios

    The scenarios where you would need to do this include:

    Mapping two columns with a different name to the same column

    If you have two columns in two different lists that perform the same function, but have different internal names, you can map them to a single column.

    For example, the Assigned To column is called AssignedTo in most lists; however, in the Project Deliverable Library, the Assigned To column has an internal name of AssignedToUser.

    Mapping two columns with the same name to different columns

    If you had two columns in two separate lists that had the same name, but actually performed different functions, you could distinguish between them by mapping one of them to a different name - otherwise they will roll up under the same column in the report.

    Mapping a column with a number as a leading character to one that is acceptable to the DataTable

    Report column names cannot have a number as a leading character. If a column has a number as a leading character you will have to map it to a column that does not have a number as a leading character (e.g. from 07_Feb_Sales to Feb_Sales_07).

  12. Click OK.

Was this article useful?

Back to Top