Home → Reports in Evergreen → Editing and Creating Templates → Creating Templates
Last Updated 11/09/2023
Once you have created a folder, the next step in building a report is to create or clone a template. Templates allow you to run a report more than once without building it anew every time, by changing definitions to suit current requirements. For example, you can create a shared template that reports on circulation at a given library. Then, other libraries can use your template and simply select their own library when they run the report.
It may take several tries to refine a report to give the output that you want. It can be useful to plan out your report on paper before getting started with the reporting tool. Group together related fields and try to identify the key fields that will help you select the correct source.
It may be useful to create complex queries in several steps. For example, first add all fields from the table at the highest source level. Run a report and check to see that you get results that seem reasonable. Then clone the report, add any filters on fields at that level and run another report. Then drill down to the next table and add any required fields. Run another report. Add any filters at that level. Run another report. Continue until you’ve drilled down to all the fields you need and added all the filters. This might seem time consuming and you will end up cloning your initial report several times. However, it will help you to check the correctness of your results, and will help to debug if you run into problems because you will know exactly what changes caused the problem. Also consider adding extra fields in the intermediate steps to help you check your results for correctness.
This example illustrates creating a template for circulation statistics. This is an example of the most basic template that you can create. The steps required to create a template are the same every time, but the tables chosen, how the data is transformed and displayed, and the filters used will vary depending on your needs.
To create a new template, you will need to navigate to a blank template page. To do so, follow these steps:
1. Click on the My Folder template folder where you want the template to be saved.
2. Click on Create a new Template for this folder.
3. You can now see the template creating interface. This page has three sections:
4. Start by providing the Name and Description for your template following NC Cardinal's suggested naming guidelines. Names must be unique. Descriptions should include information about the fields and filters applied. Return to the description section after selecting your fields and filters to fill this section out if you need to.
5. The three columns below the template name and description are for selecting your fields. The columns are:
database source table
fields in the selected table
available transforms for the selected field
The key to creating a report template is in selecting the appropriate fields to collect the information you are looking for in your report. This is done in the three field selection panes in the middle of the page.
The following steps provide an example for creating a standard Circulation Report.
The top left hand pane contains the database Core Sources drop-down list. This is the list of tables available as a starting point for your template. Commonly used sources are:
Note: The Enable source nullability checkbox below the sources list is for advanced reporting and should be left unchecked by default.
Select the source you plan to use from the drop down menu. In this example, we will be creating a circulation report. To do this, we will select Circulation in the Sources dropdown menu. Note that the Core Sources for reporting are listed first, however it is possible to access all available sources at the bottom of this dropdown menu. You may only specify one source per template.
After selecting your source, a tree menu will populate underneath the drop down menu. In our example, we will click on the top option in this menu, Circulation.
Clicking on Circulation will retrieve all the field names in the middle column. The icon in front of each option on that list indicates the data type of the value in the field. To finish creating your field, select the specific field you are interested in adding to your report from the middle Field Name pane. To make this circulation report, we will select Circ ID.
Selecting the field name will populate a list of available transform options for that field in the Field Transform pane. This is where you choose how to manipulate the data from the selected fields. For the circulation report we're creating, we want to count the number of circulations, so we will select Count from the Transforms list.
Field Transforms have either an Aggregate or Non-Aggregate output type. See the section called Field Transforms for more about Count, Count Distinct, and other transform options.
After you have selected your field and the appropriate Transform, you need to add it to your report. To do this, click the Add Fields button located above the bottom pane of the page. Your newly selected field will populate in the Display Fields list.
Selected displayed fields and filters. You can rename default display names to something more meaningful. Select the field whose column names you want to change. It will highlight. Then select Change Column Label from the Actions drop down menu.
A pop up box will appear and you can rename your field (or "Column"). For our example template, we will change the column label to Circ Count.
Add other data to your report by going back to the Sources pane and selecting the desired fields. In this example, we are going to add Circulating Item → Shelving Location to further refine the circulation report.
Shelving Location is listed in the Circulation table. To access it, click on the arrow next to Circulation in the Core Source pane This will expand the tree.
Note: When you are creating a template take the shortest path to the field you need in the left hand Sources pane. Sometimes it is possible to find the same field name further in the file structure, but the shortest path is the most efficient.
When we select Shelving Location from the tree menu, it will populate a list of field names related to Shelving Locations. For this report template, we really just want to know the number of circulations for each shelving location, so this field exists to tell us the shelving location names. So let's select "Name" from the list of available fields.
For this field, we want the literal value of each shelving location name. So, in the upper right Field Transform pane, select Raw Data.
Then click the Add Fields button to add the Shelving Location Name field to our report template.
Change the Column Label to "Shelving Location" in the pop up box.
The order of rows (top to bottom) will correspond to the order of columns (left to right) on the final report. In our report, we want to see the Shelving locations first and then the count for all circulations from that shelving location in the next column. To change this order, click on Shelving Location to highlight it and select Move Field Up from the Actions menu.
When you run a report, you will have the opportunity to set the date frame contained in the report. However, if you want to add the specific dates as a field that will be visible in your report output, you can add it just like any other field.
For this example report, we specifically want to add the circulation date. Return to the Sources pane and click Circulation to populate the Fields pane with those same original Field options we saw when we selected Circ ID for our first field. This time, select Check Out Date/Time from the middle Field Name pane.
In the Transform pane, you will see a very long list of options. Many of them are date related. The one you choose will be dependent on the purpose of your report. For this report, we don't want to get too granular by looking at the individual dates. Since we are looking for a count of circulation by shelving location, an aggregation of that count by month and year will work. Let's select Year + Month from the list of options.
Click the Add Fields button to add the date column to our report template.
In order to save your template to run reports, make sure you have given the template a unique name, and click the Save Template button at the top of the page.