This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

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 Context data set.

  1. Select File|Context to open the Context Values dialog.

    Global context variable dialog

  2. Click New button to create a new context.
  3. The Context Data Set dialog appears. By default it will have a name of CX1. Change this to CXloc. The CX will identify it as a context variable, and the loc tells you it is the location.
  4. Set the Type to Raw data. This uses data in the survey (the raw data file).
  5. Set the Label to Restaurant location so you know what the data set it for.
  6. Type Location in the Variables field. This tells Snap that the contexts are all the values in Location. (This assumes that you have changed the name of variable Q0 in the crocodile file to Location as described in the worksheet Understanding contexts. If you have not, do so or use Q0.)

    Global context variable dialog

  7. Click Save button to save the context data set. You can now use it to automatically generate multiple reports.

Looping round the different reports

  1. Open your report if it is not open and enter CXloc as the Context.

    Default summary report with context filter applied

  2. Click New button on the report dialog and select Page Layout from the drop-down menu.
  3. Select Start New Page. This ensures that each time the report is run it starts on a new page.

    Printer layout dialog with start new document highlighted

  4. If the Page Layout 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.
  5. Click Play/run button to run the report. The Report Execution dialog opens.
  6. Click [Printer] to confirm that you are printing to the pdf printer driver. Click [OK] to close the Print Setup dialog.
  7. Click [OK] on the Report Execution dialog. It will produce a single report file with four versions of the content, one for each possible value of the variable listed in CXloc. Each one will start on a new page.

Smart reporting: image of

Creating each report in a separate file

You need to modify the Page Layout instruction at the start of your report to tell Snap to save the different reports to separate files.

  1. Double-click the Page Layout instruction to open it.
  2. Select Restart Page numbers to ensure that each document starts on page 1.
  3. Select Start New Document. 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).
  4. Click [Insert] and select Variable field from the list.
  5. Select Location as the Variable and Context as the Aspect. This will use the label of the Location for the current context as the filename, so the report for Boston will be given a filename of Boston, MA.pdf.

    New vaariable field getting context aspect

  6. Click [OK] to close the New Variable field dialog.

    Printer layout dialog with start new document highlighted

  7. Click [OK] to save your instruction.
  8. Click Play/run button to run the report, then click [OK] on the Report Execution 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.

    Grid alignment print preview: first pass

  9. 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 Location, and used the appropriate label as the filename.

See Also

Tutorial 1: Inserting dynamic text from analyses in reports

Tutorial 2: What is a context?

Tutorial 4: Tailoring your data by using a context filter

Tutorial 5: Creating a simple context report and assigning it to associates