This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help
Tutorial 3: Creating tailored reports in Snap
This tutorial describes how to set up a smart report so it creates multiple pdf reports with Snap dynamically selecting the data depending on the context. It explains how to set up the survey in Snap so that it will produce all the reports that are needed, and then tells you how to set up the report instructions so that each report will be sent to a different pdf file.
This worksheet uses the sample Crocodile survey supplied with Snap. The survey evaluates a restaurant chain with four branches (two in the UK and two in the USA). The worksheet describes how to use the location in a context data set, allowing you to produce separate reports for each location.
The example starts with the report created in the tutorial Tutorial 2: What is a context? and shows you how to set it up so that a separate pdf file is produced for each restaurant manager, ready to be sent to them or printed out.
Creating a context data set
Snap can run reports for all locations if you create a .
- Select to open the dialog.

- Click
to create a new context. - The dialog appears. By default it will have a name of . Change this to . The will identify it as a context variable, and the tells you it is the location.
- Set the to . This uses data in the survey (the raw data file).
- Set the to so you know what the data set it for.
- Type in the field. This tells Snap that the contexts are all the values in . (This assumes that you have changed the name of variable in the crocodile file to as described in the worksheet Understanding contexts. If you have not, do so or use .)

- Click
to save the context data set. You can now use it to automatically generate multiple reports.
Looping round the different reports
- Open your report if it is not open and enter as the .

- Click
on the report dialog and select from the drop-down menu. - Select . This ensures that each time the report is run it starts on a new page.

- If the t instruction is not the first instruction in the report, select it in the window and drag it to the top of the list of instructions.
- Click
to run the report. The dialog opens. - Click to confirm that you are printing to the pdf printer driver. Click to close the Print Setup dialog.
- Click on the dialog. It will produce a single report file with four versions of the content, one for each possible value of the variable listed in . Each one will start on a new page.

Creating each report in a separate file
You need to modify the instruction at the start of your report to tell Snap to save the different reports to separate files.
- Double-click the instruction to open it.
- Select to ensure that each document starts on page 1.
- Select . This places the report in a new file, (so each time it creates the report for the different context, it will start a new file).
- Click and select from the list.
- Select as the and as the . This will use the label of thefor the current context as the filename, so the report for Boston will be given a filename of .

- Click to close the dialog.

- Click to save your instruction.
- Click
to run the report, then click on the dialog. Depending on the pdf driver that you are using, and the way it has been set up, it will either automatically save or ask you to save the files. The picture below shows the four files in PDFCreator.

- Once the files have been saved, you can check that they are as you expect. Snap should have created a report for each value of , and used the appropriate label as the filename.