[Skip Global Navigation]

SPSS Tech Tips

SPSS Direct Home

Repeating table headers within a grid question using mrStudio™

This is a complimentary tip available only to SPSS Direct subscribers.

Question

I have created a large grid using mrStudio. In order for the interviewee to see the headers at the top of the page, he must keep scrolling upward. How can I make the headers visible to the respondent as he uses the entire grid?

Answer

By default, headers are only placed at the top of the grid, as shown in Figure 1.  If you have a large grid, the respondent will need to scroll to a position in the grid where the header is no longer visible.

mrStudio Grid
Figure 1: A mrStudio grid typically has default headings only at the top.
Click to enlarge.

You can use a script to force the headers to repeat at regular intervals within the grid. By altering the RepeatHeader parameter in the script, you can customize the interval at which the heading is displayed. If you set the RepeatHeader parameter to 0, the header will display at the top and bottom of the grid. Or, if you set the RepeatHeader parameter to 1, the header will repeat on each grid line. You can adjust this value further by increasing the value to any integer that represents how many lines you would like before the header is displayed again. In the example below, the RepeatHeader parameter is set to 2, resulting in the header repeating after every other grid line.

Metadata(en-US, Question, Label)
   Quest1 "Quest1" loop
    {
        _1 "1",
        _2 "2",
        _3 "3",
        _4 "4",
        _5 "5",
        _6 "6",
        _7 "7",
        _8 "8",
        _9 "9",
        _10 "10"
    } fields
    (
        GV1 "Quest1"
        categorical [1..1]
        {
            _11 "A" exclusive,
            _12 "B" exclusive,
            _13 "C" exclusive
        };
    ) expand grid;
End Metadata

Routing(myRoutingContext)
Quest1.style.Cell.RepeatHeader = 2
IOM.MustAnswer = true
Quest1.Ask()
End Routing

mrStudio Grid

Figure 2: When using the “Quest1.style.Cell.RepeatHeader=2” parameter, headers display after ever two grid lines.
Click to enlarge.

Customers with a current maintenance agreement can visit our technical support Web site, http://support.spss.com, (login required) to refer to documentation and FAQs about using scripts within mrStudio to customize your surveys.