INTRODUCTION

This chapter explains how to customize Mentor specs to produce HTML output files that allow you to viewed tables through a Web browser. It includes information about WebTables, Cascading Style Sheets (CSS), and On-Demand tables. This chapter assumes that there is a basic understanding of tables and CfMC terminology. If you are not familiar with creating tables, review Chapters 4, 5, and 6.

At the end of this chapter there is a section on how to simultaneously create a print file, a delimited file, and an HTML file. For more information, go to Preparing Mentor Output Files For Post Processing.

NOTE: Any references to “Class” statements in this chapter pertain to use of style sheets. This option is available in Mentor 7.7 or above. If using prior versions, the alternate commands must be used.

For information on Dynamic Charts, contact CFMC Customer Support at support@cfmc.com.
WebTables Overview

The HTML (.htm) files created by Mentor must be placed in a Web-accessible directory. The .htm files created by Mentor must be created in or moved to this Web-accessible directory

Make sure that you have JavaScript enabled in your browser. The default in most browsers will enable JavaScript. However, if you would like to make sure that this default is turned on:

  • To check this in your Netscape Browser, go to File Preferences Enable JavaScript (there are three boxes to check).
  • In IE, go to Tools =⇒ Internet Options =⇒Advanced, and check box JIT Compiler -enabled. These steps will vary with different browser versions.
  • In Mozilla, Firefox, go to Tools =⇒ Options =⇒Web Features, check Enable Java, JavaScript boxes.
  • In Safari, click on Preferences, Security, click on Enable Java and JavaScript boxes.

BROWSER COMPATIBILITY

You can use any version of IE 5 or above or Netscape 4 or above to view WebTables. Versions 6.0 or higher are the only browsers that will function fully. The folowing sections describe basic and then complex WebTables.
EXAMPLE MENTOR FILES AVAILABLE ONLINE

For an example of Mentor files, go to http://distrib.cfmc.com/hints/webtab77/. The files on this website are based on the Roadrunner survey that can be found in CfMC’s Mentor and Survent example directories.

Certain aspects of the specs are explained within the files. The explanations are offset by two single quotation marks (”). These are commonly used in CfMC files. It is known as “commenting out” text or code.

7.1 Basic WebTables

Using Mentor enables you to transform plain ASCII tables into tables with HTML enhancements to produce user-friendly tables on the Internet, called WebTables.

WRITING SPECS

Mentor produces the enhanced HTML code that allows the tables to be viewed through a browser. Included in this chapter is a Mentor .spx file that contains all of the necessary coding to create colorful web tables. Notes explaining the code or portions of code will be offset with ‘ ‘ (two single quotes).
MANAGING YOUR SPECS

In general, most web table-related commands can go in the ~SET block or the ~EDIT statement within your spec file. However, COLINFO and TCON options MUST go in the ~EDIT statement. In addition,

~set web_tables= ( css_file_check=/www/htmldocs/cfmcweb/css/wmentor.css

css_file_path=”http://product01.cfmc.com/cfmcweb/css/wmentor.css”

on Resize=”resetColors()”

)

MUST be put in a ~SET block.

NOTE: Useful hint – using the full path for the CSS makes it easier to use the same specs from one job to another.
USING SET COMMANDS IN TABS.SPX

~SET WEB_TABLES=(

css_file_check=/www/htmldocs/cfmcweb/css/wmentor.css

css_file_path=”http://product01.cfmc.com/cfmcweb/css/wmentor.css”

bgcolor=#F0F8FF                                     ”best set in the body statement on the css

web_format_ban=(class=banner)                       ”below is the alternative not using a CSS

” or web_format_ban=(bgcolor=lime font=(color=red size=1))

web_format_stub=(class=stub)

web_format_freq=(class=freq)

web_format_vper=(class=vper

web_format_stat=(class=stat)

web_format_comment=(class=comm)

web_format_hper=(class=hper)

 

”*********** rows alternate lime/red for bgcolor***************

” web_format_odd_row=( bgcolor=red)

” web_format_even_row=( bgcolor=lime)

WEB_FORMAT_TABLE=(

” The following commands are all handled in the body statement in the css

” class=vd10 ”font=(face=”verdanal” size=2)

” border=10

” width=100% ” or width=200

” cellspacing=1%

” cellpadding=1%

” bordercolor=#333366

)

)
GLOBAL EDIT STATEMENTS IN THE TABS.SPX

tabset=global:

global_edit=:-coltna

tcon=(first,

web_format_tcon_anchor=(class=TocBody)

web_format_tcon_anchor=(class=Toctabnum)

)

RANK_IF_INDICATED

RANK_COL_BASE=1

PDEC=1

SDEC=2

PUTCHARS=-Z-

-t4base

stats_on_separate_line

minfreq=1

dostats=.90

ALL_POSSIBLE_PAIRS_TEST

running_lines=1

}

 

”*********** cols alternate size ***************************************

” Colinfo DONE IN EDIT STATEMENT in banner_a.def

” web_format_odd_col=( bgcolor=lime font=(color=red size=5))

” web_format_even_col=( bgcolor=pink font=(color=lime size=4))

 

For colinfo:

 

colinfo=(

c=1 webformat=(bgcolor=lime font=(size=5)) /

c=2 webformat=(bgcolor=yellow) /

c=3=2 /

c=4=2 /

c=5 webformat=(bgcolor=lime) /

c=6=5 /

c=7=5 /

c=8 webformat=(bgcolor=yellow) /

c=9=8

)

 

When setting up your Web banner, the following will produce .prt, .dlm and .htm banners.

BANNER=: make_banner

[ level=2]

[underline=- level=1] Total

[underline== level=2 colspan=3] AGE

[underline=- level=1] Under 35

[underline=- level=1] 35 – 54

[underline=- level=1] Over 54

[underline== level=2 colspan=3] INCOME

[underline=- level=1] Under $15k

[underline=- level=1] $15 – $35

[underline=- level=1] Over $35k

[underline== level=2 colspan=2] RATING

[underline=- level=1] Good

[underline=- level=1] Neutral /Poor

}

COLUMN=: TOTAL WITH &

[1/51^1,2/3,4/5,6] WITH &   ”respondent age

[1/52^1/2,3/4,5,6] WITH &   ”income

[1/47^4,5/1,2,3]            ”rating

}
Stub Front Options:

[web_format_row=(bgcolor=”ccccff”) ] Top 2 box

[web_format_row=(bgcolor=”ccccff”) ] Bottom 2 box

[stat Web_format_stub=(bgcolor=”ccffff”)]Mean

[stat web_format_stub=(bgcolor=”ccffff”)]&

Standard deviation
Files Needed to Create WebTables

Similar to a Mentor run in version 7.6, you need a few files in order for your tables to work in 7.7. You will start off with the following files.

  • Tabs.spx (Table specs including stub options, etc)
  • Banner_a.def (Specifies all the banner points and edits associated with that particular banner)
  • Studyname_x.def (Defines all question-by-question table definitions)

The banner_a.def and <studyname>_x.def can be ampersanded in to your tabs.spx as separate files, or they can be included in the tabs.spx (cut and pasted in).

To simplify the process of putting up WebTables, the file examples in this documentation are broken up into separate files that are ampersanded into the tabs.spx file.

NOTE: If there are multiple banners within one run, then all of the banners can be put in the same directory. However, if there are multiple banners with separate runs, placing each banner in separate folders helps keep the job organized. For example, if there are three banners then you can have folders for each run: ban01, ban02, ban03. Since you will have different output (html,dlm,prt,…) for each banner, you will end up with a large number of files. If you have them in separate folders, it will be easier to maintain file organization.
Files Produced by the Mentor Run

After you run Mentor, the following files are produced:

  • An HTML file – <studyname>.htm. This file brings all of the parts of the table together. It calls in all the files that have been created by Mentor to produce the desired tables. Mentor produces files with a .htm extension because, by default, Mentor only allows three-character extensions.

NOTE: There is a meta command (>cfmc_extension htm=html) that can be put in the tabs.spx spec that will produce .html extensions.

  • An ASCII print file– <studyname>.prt (This is used for downloadable ASCII tables.)
  • A comma-delimited file – <studyname.dlm> (This can be imported into applications, such as Excel.)

NOTE FOR WINDOWS/DOS CLIENTS

If Mentor is run on a Windows/DOS PC, then the html files generated by Mentor are created with UPPERCASE names (TAB14.HTM). When these files are transferred to the server, they must be changed to lower-case names.
WHEN MANUALLY TESTING AND PREPARING TO GO LIVE

After you run all of your specs through Mentor without errors and after your HTM files are generated, then the files are copied to the Linux server or the HP-UX server.

NOTE: CfMC spec writers use UltraEdit© for writing specs and putting up tables.

These HTM files must reside in a Web-accessible directory on your server that would have a path, such as this (if CfMC install directions were followed):

/var/www/html/<studyname>
Basic steps to Running a Live Mentor 7.7 Job

  1. Write the specs as if it’s a straight Mentor job, adding the necessary web-related commands to the tabs.spx file. This will allow you to produce an htm file.
  2. The live data must be transferred with fastcopy to a directory where it can be accessed. This step will prevent the corruption of the data set. (Fastcopy is a CfMC SUPER command. For more information, see Chapter 4 of your Survent Manual.)
  3. Run the tables.
  4. Once the tables are made, the htm (html) file must be transferred to the Web- accessible directory onnthe server, unless the tables have been run in that area of the server. They will then be viewable through a Web browser.

Setting up Directories and Running WebTables

CfMC follows a set procedure in setting up directories and running web tables. This procedure is specific to how the machines are set up. Your system administrator will have to tailor your procedure according to the setup of your own machines. CfMC’s support team can provide some guidance, if necessary.

Automating or Running Tables on a Set Schedule

In order to run tables automatically, at certain times, you will need to have a cronjob. This would have to be set up by your system administrator.

A CfMC cron job script is included in this documentation. It follows the example spec files. It is included as a guideline tool. So, in order to automatically run tables, you must:

  1. Set up the cron job.
  2. Consider password protecting your tables. (See the Webpass script, which is also included in this document.)
  3. If more than one banner is used or you would like to access both Web Tables and downloadable ASCII tables, an index page would be a good way to achieve this. (An example of an index.html file is also included.)

7.2 Complex WebTables

When creating WebTables, using colors and different fonts in specs can produce state of the art tables. Although sometimes dependent on the browser, creating tables can be done with little effort. Mentor 7.7 has the ability to create these tables with simple commands or by using Cascading Style Sheets (CSS).

The following section will show how these commands can be used.
BASIC COLORS

Color      Hexadecimal Code

Aqua   “#00FFFF”

Black   “#000000”

Blue   “#0000FF”

Fuchsia   “#FF00FF”

Gray   “#808080”

Green   “#008000”

Lime   “#00FF00”

Maroon   “#800000”

Navy   “#000080”

Olive   “#808000”

Purple   “#800080”

Red   “#FF0000”

Silver   “#C0C0C0”

Teal   “#008080”

Yellow   “#FFFF00”

White   “#FFFFFF”
HELPFUL INTERNET WEBSITES FOR CHOOSING COLORS

SOURCES FOR CSS HELP

There are many sources for help with CSS. Here are a few:

http://www.devguru.com/Technologies/css/quickref/css_index.html
http://www.w3schools.com/css/default.asp
http://glish.com/css/#tutorials
http://hotwired.lycos.com/webmonkey/
VALIDATION WEBSITES

There are useful validation websites which include the following:

For HTML: http://validator.w3.org/

For CSS: http://jigsaw.w3.org/css-validator/validator-uri.html
Basic Commands with and without Cascading Style Sheet

Without CSS With CSS CSS Commands
~set web_tables=( ~set web_tables=(
css_file_check=/www/htmldocs/sued/ Path that mentor uses to validate styles
rrunr/css/style.css
css_file_path=”/sued/rrunr/css/style.css Path that is inserted into html page
html_title=“Road Runner html_title=“Road Runner Fast Food
Fast Food Sample tables” Sample tables”
web_format_ban=(bgcolor=“ffffff” web_format_ban=(class=banner) .banner {
font=(color=black)) background-color: #ffff00;
text-align:center;(default is right)
color: #000000;
}
web_format_stub= web_format_stub=(class=stub) .stub {
(bgcolor=yellow) background-color: #ffff00;
}
web_format_freq=(bgcolor=yellow web_format_freq=(class=freq) .freq {
font=(color=green)) background-color: #ffff00;
color: #000000;
}
web_format_vper=(class=vper) web_format_vper=(class=vper) .vper {
color:#000066;
text-align:center;
}
web_format_stat=(font= web_format_stat=(class=stat) .stat {
(color=red)) color:red;
}
web_format_hp=(bgcolor=“ccffff” web_format_hp=(class=hper) .hper {
font=(color=purple)) background-color: #ccffff;
color: purple;
}
web_format_cumulative web_format_stat=(class=cper) .cper {
_percent=(bgcolor=“ccc cff” ) background-color: #ccffff;
}
web_format_comment=( web_format_comment=(class=comm) .comm { }
bgcolor=“ffffff”)
web_format_odd_col=(bgcolor= web_format_odd_col=(class=oddcol) .oddcol {
yellow) color:yellow;
}
web_format_even_col=( web_format_even_col=(class=even .evencol {
bgcolor=yellow) col) color:yellow;
}
web_format_odd_row=( web_format_odd_row=(class=oddrow) .oddrow {
bgcolor=yellow) color:yellow;
}
web_format_even_row= web_format_even_row=(class=eve .evenrow {
(bgcolor=yellow) nrow) color:yellow;
}
bgcolor=aqua The look of the overall tables is body {
font=(face=arial) set in the body statement. Anything padding: 2em 3em 2em 3em;
border= width=90% added after that will override the border-top: 1.7em solid #006699;
cellspacing=10 statements in the body statement border-left: 1.3em solid #b0c4de;
cell padding=20% border-bottom: 1.7em solid 006699;
border-right: 1.3em solid #b0c4de;
margin: 0;
font-family: verdana, sans, arial;
font-size: .8em;
}

Example Files and How They Work

The specs in subsequent sections create CfMC’s “Road Runner” demo. An example of a Table of Contents and the table it produces follows the spec files needed to produce them.

Explanations, which can be seen throughout the files, explain certain steps in the specs and the functions that they perform.
THE TABS.SPX FILE

The tabs.spx file shown below controls the following:

  • The ablility to turn off frequencies or percentages in the delimited tables.
  • The ability to turn off the footer and the header.
  • The ability to turn off the tables of contents for comma-delimited tables that are used for many other purposes.

>filldef

>PURGESAME

>DEFINE @study rrunr ”* NAME STUDY (REMEMBER CONSISTENCY)

>CREATEDB tables S=L

~SET -varnames

>-printrep

~specfile @study

~SET AUTOTAB drop_local_edit drop_base drop_t4 stat_base_ar

DELIMITED_TABLES=(delimiter=comma banner -quoted_banner_text stats_on_separate_line)

WEB_TABLES=( css_file_check=/www/htmldocs/cfmcweb/css/wmentor.css

css_file_path=”http://product01.cfmc.com/cfmcweb/css/wmentor.css”

‘’****************************************************

‘’PLEASE NOTE: If the background color is set in the banner edit or in the body

‘’statement in the CSS it will override all other bgcolor statementsw below

‘’*****************************************************

‘’*********** Contents alter colors within the elements of the tables*****

web_format_ban=(class=banner) ‘’below is the alternative not using a CSS

” web_format_ban=(bgcolor=lime font=(color=red size=1))

web_format_stub=(class=stub) web_format_freq=(class=freq)

web_format_vper=(class=vper web_format_stat=(class=stat)

web_format_comment=(class=comm)

web_format_hper=(class=hper)

”*********** rows alternate lime/red for bgcolor***************

” web_format_odd_row=( bgcolor=red)

” web_format_even_row=( bgcolor=lime)

WEB_FORMAT_TABLE=(

” The following commands are all handled in the body statement in the css

” class=vd10 ”font=(face=”verdanal” size=2)

” border=10

” width=100% ” or width=200

” cellspacing=1%

” cellpadding=1%

” bordercolor=#333366

)

)

~DEFINE

STUB=stubpref1:

[-Vper SKIP_LINES=0 freq]Total Sample

[-VPER]No Answer

[Prt=Ar Vper=* SKIP_LINES=0 freq] Any Response

[comment]

}

STUB=stubpref2:

[supp -vper -freq ]  ”TOTAL

[SUPP]  NO ANSWER

[comment]

}

tabset=global:

global_edit=:-coltna

”*********** THIS HANDLES TABLE OF CONTENTS APPEARANCE ***

tcon=(first,

” web_format_tcon=(class=TocBody)     ”this is for the title portion of toc

” web_format_tcon_anchor=(class=Toctabnum) ”this is for the left side (TABLE #)

)

RANK_IF_INDICATED

RANK_COL_BASE=1

PDEC=1

SDEC=2

PUTCHARS=-Z-

-t4base

stats_on_separate_line

minfreq=1

dostats=.90 ALL_POSSIBLE_PAIRS_TEST

}

footer=:=\k(h)<center>\k(h,p)Tables prepared by Computers for Marketing Corp.\k(h)<br>

\k(h,p)PAGE #PgNum#\k(h)<br>

\k(h,p)LAST UPDATED #DATE# #TIME# \k(h)<br>

If you would like to download an ASCII version of these tables to your computer,<br>

click “file”, then “save as” AFTER

<span><a href=”./@STUDY~.prt”>clicking here</a></span></center>}

}

&banner_a.def

&rrunr_x^def

 

~IN @study~, DOT=100

>PRINTFILE @study~

~EXECUTE

MAKE_TABLES

~END

The following scripts are used to transfer tables to a different directory

 

”BOB 6/23/03 Everything else will be ignored for now

~SET printtcon ”to flush out table of contents (if tcon is on)

 

~SPECFILE ”to close “specfiles” (e.g., .htm,.dlm)

~

>PRTFILE ”to close the print file

~

”do perform whatever system commands you want with this output

>SYS cp @STUDY~.prt /www/htmldocs/<directory_name>

>SYS cp @STUDY~*.htm /www/htmldocs/<directory_name>

>SYS cp @STUDY~.dlm /www/htmldocs/<directory_name>

~END
THE BANNER_A. DEF FILE

TABSET=BANNER_A:

STUBPREF=STUBPREF1

STAT=:I=BCD,I=EFg,I=HI

EDIT=: SWID=30

CWID=7

”colinfo=(

” c=1 webformat=( bgcolor=#ffffff) /

” c=2=1 /

” c=3=1 /

” c=4=1 /

” c=5=1 /

” c=6=1 /

” c=7=1 /

” c=8=1 /

” c=9=1

” )

}

 

BANNER=: make_banner

[level=2] ‘’space holder

[underline=- level=1] Total

[underline== level=2 colspan=3] AGE

[underline=- level=1] Under 35

[underline=- level=1] 35 – 54

[underline=- level=1] Over 54

[underline== level=2 colspan=3] INCOME

[underline=- level=1] Under $15k

[underline=- level=1] $15 – $35

[underline=- level=1] Over $35k

[underline== level=2 colspan=2] RATING

[underline=- level=1] Good

[underline=- level=1] Neutral /Poor

}

COLUMN=: TOTAL WITH &

[1/51^1,2/3,4/5,6] WITH & ”respondent age

[1/52^1/2,3/4,5,6] WITH & ”income

[1/47^4,5/1,2,3]         ”rating

}
THE RRUNR_X. DEF FILE

TABSET= { qn1_z:

TITLE=: Q1. How much do you agree with the following statement:

The fast food at Road Runners is worth what I pay for it.}

STUB=:

(5) Completely agree

(4) Somewhat agree

(3) Neither agree nor disagree

(2) Somewhat disagree

(1) Completely disagree

Don’t Know/Refused to answer

[comment]

[STAT] Mean

[STAT] Standard deviation

[STAT] Standard error  }

”qn1(5/4/3/2/1/0)

ROW=: [1/6.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/6.1 *ranges=1-5]

}

TABSET= { qn2a_z:

TITLE=: Q2a. Please rate the following characteristics: The quality of the food.}

STUB=:

(5) Very good

(4) Good

(3) Neither poor nor good

(2) Poor

(1) Very poor

Don’t know/refused to answer

[comment]

[STAT] Mean

[STAT] Standard deviation

[STAT] Standard error  }

”qn2a(5/4/3/2/1/0)

ROW=: [1/7.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/7.1 *ranges=1-5]

}

TABSET= { qn2b_z:

TITLE=: Q2B. Please rate the following characteristics: The quality of service.}

” SAMEAS QN2A

STUB=qn2a_s

”qn2b(5/4/3/2/1/0)

ROW=: [1/8.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/8.1 *ranges=1-5]

}

TABSET= { qn2c_z:

TITLE=: Q2C. Please rate the following characteristics: The cleanliness of the restaurant.}

” SAMEAS QN2A

STUB=qn2a_s

”qn2c(5/4/3/2/1/0)

ROW=: [1/9.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/9.1 *ranges=1-5]

}

TABSET= { qn2d_z:

TITLE=: Q2D. Please rate the following characteristics: The prices on the menu.}

” SAMEAS QN2A

STUB=qn2a_s

”qn2d(5/4/3/2/1/0)

ROW=: [1/10.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/10.1 *ranges=1-5]

}

TABSET= { qn2e_z:

TITLE=: Q2E. Please rate the following characteristics: The accuracy of your bill.}

” SAMEAS QN2A

STUB=qn2a_s

”qn2e(5/4/3/2/1/0)

ROW=: [1/11.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/11.1 *ranges=1-5]

}

TITLE= { qn2f_z:

TITLE=: Q2F. Please rate the following characteristics: The cleanliness of the restrooms.}

” SAMEAS QN2A

STUB=qn2a_s

”qn2f(5/4/3/2/1/0)

ROW=: [1/12.1^5/4/3/2/1/10] &

$[MEAN,STD,SE] [1/12.1 *ranges=1-5]

}

TITLE= { qn2g_z:

TITLE=: Q2g. What is your opinion of the Road Runners billing format? Is it…}

STUB=:

Easy to understand

Hard to understand

Neither easy nor hard to understand

Don’t know}

”qn2g(1/2/3/0)

ROW=: [1/13.1^1/2/3/10]

}

Those are the three files that you have to set up properly and compile to test for errors. The rest of the files are generated by Mentor.
THE INDEX.HTML FILE

The index.html file is created by the programmer. It provides access to both the WebTables and downloadable ASCII tables within a browser if you choose to set it up this way. The file’s source code follows. This is for a single-bannered table.

<insert screen shot here>

This is what the index page looks like through a browser.

<insert screen shot here>

This is the index.html file

<?xml version=”1.0″ encoding=”iso-8859-1″?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>

<title>CfMC DEMO TABLES</title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />

<link href=”css/webmentor.css” rel=”stylesheet” type=”text/css” />

</head>

<div>&nbsp;&nbsp;

<div>

<a href=”http://www.cfmc.com”>

<img src=”images/cfmclogo_sm.jpg” alt=”CfMC” alt>”CfMC logo” border=”0″ />

</a><br />

</div>

</div><br />

<div>

</div>

<div>

<div>

<h1>CFMC DEMO TABLES</h1><br />

<h2>Road Runner</h2>

<br />&nbsp;&nbsp;

<table>

<tbody>

<tr>

<td >ON-LINE TABLES</td>

<td ><a href=”tables/rrunr.htm”>Web Tables</a></td>

<td ><a href=”tables/rrunr.prt”>Quick upload/Printable</a></td>

</tr>

<tr>

<td >ON-DEMAND TABLES</td>

<td colspan=”2″ ><a href=”demand.html”>Web Tables On-Demand</a></td>

</tr>

</tbody>

</table>

</div>

</div>

<br /><br />

<div>&nbsp;&nbsp;&nbsp;</div>

</div>

</body>

</html>
EXAMPLE OUTPUT OF A WEB TABLE

In this example, Table 001 was chosen, and it produced a nicely organized table.

<insert screen shot here>
Custom CfMC Scripts
THE WEBPASS SCRIPT

This script was written to give clients the ability to password protect real-time results . This script is included with the install and instructions for customizing this script are provided in the following sections.

Preparation

Edit your httpd’s access.conf (or httpd.conf if access.conf is no longer used) and alter “AllowOverride” in <Directory ( html doc home )> </Directory> block to be “AllowOverride AuthConfig”.

NOTE: Make sure that httpd.conf has all of the ServerNames listed:

Example:

ServerName pd1.cfmc.com

ServerName www.survey1.cfmc.com

This will stop the password screen from coming up multiple times. Place this file in any directory in your $PATH (e.g., ”/usr/local/bin”)

Usage:

“webpass <document name> <subdirectory of main html document directory>” or

“webpass” (and follow the prompts)

Once this is run for a particular directory, it does not have to be run again. Replace documents in or copy new documents into the password-protected web document directory.

You may need to change the following variables:

$docloc = “/var/www/html”; change this to your main html doc location

$authname = “Password Protected Location”; Appears on username/password screen

$passfile = “.htpasswd”; Name of file for passwords; this will be in document directory.

Once you have customized your script, run it and set up a username and password, you can then e-mail the client with the url where the html docs reside and their username and password. The script example follows.

7. 3 ON-DEMAND TABLES

The On-Demand utility enables you to perform advanced data manipulation, such as performing quick cross tabs between two variables. For example, any question in a study can be crossed with any other question. On-Demand is very beneficial for analyzing a study.

There is a simple command that activates the utility on the server where the study is running. If the study is not running on the server, the .qpx and .tr can be placed in a Web-accessible directory. Both options are easy to use.

7.3.1 In stallation Requirements

If the software was properly installed, a cfmcweb directory will be created in the Web-accessible area (html document directory) of the server. This directory will probably be /var/www/html/ (CfMC’s default), but check with your system administrator if you do not know what it is. This cfmcweb directory will contain subdirectories containing CfMC-specific applications.

There are two subdirectories in cfmcweb that pertain to the creation of On-Demand

Tables:

1     /var/www/html/cfmcweb/php/ondemand: holds php scripts. The files are:

  • makedb.php – php script for setting up On-Demand presentation screen
  • maketab.php – php script for making tables
  • cleanup.php – cleans up tables directory files that were created during the run that are no longer needed.

NOTE: You should NEVER edit these files

2     /var/www/html/cfmcweb/css: for html cascading style sheets. CfMC has included:

 

  • ondemand.css

NOTE: You may add your own .css files to this directory based on the structure of ondemand.css. It is not advisable to edit the ondemand.css, the default style sheet. If Mentor 7.7+ is reinstalled, it will overwrite ondemand.css. Instead, rename the file and make changes to the looks and options in this new file. It can then be brought in on the command line during the original setup using the following syntax: /var/www/html/rrunr/css/<cssfilename>.css. If a style sheet is added later, the “ondeminit” can be edited to reflect that change.

Likewise, there will also be a cfmccgi subdirectory under the main cgi-bin directory in the Web-accessible area. The Web server default location for this is /var/www/cgi-bin/cfmccgi. But, once again, your system administrator should know the actual location. There will be one file in this cfmccgi subdirectory, a perl script “ondem.pl”. You should NEVER edit this file.

7.3.2  Installation  requiremnts

The following conditions must be met in order to use On-Demand Tables:

  • A UNIX platform with a Web server that supports php (v4.3.0+).
  • CfMC Mentor 7.7+ must be installed on the server where the On-Demand

Tables will run.

SE TUP

Remember that the example specs provided here show the way it is done at

CfMC. They are just suggestions to help you run the tables that will be viewed through the browser.

 

There are two possible scenarios for running On-Demand Tables.

1     1 – A CfMC cron job script is included in this documentation. It follows the example spec files. It is included as a guideline tool. So, in order to automatically run tables, you must:

  • The Web survey is running on the server
  • .qpx (possibly a .def) is on the server
  • data is on the server
  • A Web area exists

2     2 – The study is not running on the server

Create a directory in a Web-accessible area of the server (ex.

/var/www/html/rrunr/ondemand/test)

Place the .qpx or .def and data file in that directory or subdirectory. Place any auxiliary files needed (webtab.add) in that directory.  Place data in that directory or somewhere on the server where it can be accessed.

In the directory where the .qpx/.def file type ==>ondemand.pl

The following screen will appear:

Welcome to On-Demand

COMMAND LINE USAGE:

/cfmc/dev.80/go/ondemand.pl <specfile> (MUST BE .qpx or .def) <option1>

<option2>…

Any or all of the following options may be used on the command line: data=<fully qualified data file name (def:/cfmc/dev.80/data/_STUDY_.tr) wwwloc=<web location of tables> (def:/var/www/html/_STUDY_/ondemand)

cssfile=<fully qualified css file name

(def:/var/www/html/cfmcweb/css/ondemand.css)

add[=filename (def:webtab.add)]

batch

 

setpass=<yes/no>

debug

Please enter a spec file name (or press Enter to quit)

(NOTE: This MUST have a .qpx or .def file extension)==>rrunr.def

NOTE: The.qpx or .def extension must be used

NOTE: If at the original prompt (/var/www/html/rrunr), you typed

==>ondemand.pl rrunr.qpx, the previous screen would be skipped. Next, the default data location can be changed.

Please enter the Data File, i.e., the fully qualified name of the data file that your tables will use

Press <Enter> for /cfmc/dev8.0/data/rrunr.tr

==>/var/www/html/rrunr/tables/rrunr.tr

Next, you will get the prompt for the Web-accessible directory (public area):

Please enter the Tables Location, i.e., the location in the web area for your tables

Press <Enter> for /var/www/html/rrunr/ondemand

==>/var/www/html/rrunr/ondemand/test

If the directory does not have proper read/write access, the following warning will appear.:

WARNING: Permissions for web location

/var/www/html/rrunr/ondemand/test are 775 (drwxrwxr-x).

 

They should be 777

Press enter to set permission to 777 or break to get out

Next, the prompt for the style sheet that will be used appears:

Please enter the CSS File, i.e., the fully qualified name of the style sheet (css) file

Press <Enter> for /var/www/html/cfmcweb/css/ondemand.css

==>/var/www/html/rrunr/ondemand/test/ondemand2.css

NOTE: You may add your own .css files, based on the structure of ondemand.css, to this directory. It is not advisable to edit the ondemand.css (the default style sheet). If Mentor 7.7+ is reinstalled, it will overwrite ondemand.css. Instead, rename the file and make changes to the looks and options in this new file. . It can then be brought in on the command line during the original setup using the following syntax:

/var/www/html/rrunr/css/<cssfilename>.css. If a style sheet is later added the “ondeminit” can be edited to reflect that change. It can then be brought in on the command line.

The following prompt will appear. If an add file with additional specs is to be used, type “y” at the prompt:

Do you have a file with additional spec that you would like to add to rrunr.def? (y/(n))==>y

Please enter the this file’s name (enter for webtab.add)==> <enter>

The following will appear:

NOTE: the first running of ondemand.pl, a file called “ondeminit” will be placed in the ${CFMC}control/ directory. This will contain general defaults for definitions of data, wwwloc and cssfile based on your environment. For every run of ondemand.pl, a file (also called ondeminit) will be placed in the directory local to where ondemand.pl is run. This will allow you to run ondemand.pl repeatedly without the need to redefine these variables if they don’t need redefining. NOTE: By default, ondemand.pl will still prompt for all of these variables unless the “batch” option is used on the command line.

NOTE: The initial file “ondeminit” is created. It contains:

data=/var/www/html/rrunr/tables/rrunr.tr wwwloc=/var/www/html/rrunr/ondemand/test cssfile=/var/www/html/rrunr/test/ondemand2.css add=webtab.add

This will allow you to use the “batch” option in future runs of /cfmc/dev.80/go/ondemand.pl

So here’s recap

The data file used will be /var/www/html/rrunr/tables/rrunr.tr

The index.html and tables will be stored in /var/www/html/rrunr/ondemand/test

The .css file used will be /var/www/html/rrunr/test/ondemand2.css

Additional efinitions will come from webtab.add

Press enter to continue or break to start over ==><enter>

At this point, you would have changed any defaults at the command line. The file that holds these changes is “ondeminit” It is in the directory local to where ondemand.pl is run. This file can be edited at any time.

The next prompt will deal with password protecting the directory. Type “y” to set a password.

 

Shall we set a password in /var/www/html/rrunr/ondemand/test? (y/(n)) ==>y

The following prompt asking for a user name appears. In this case, “test” is the user name.

Please enter a user name or press enter for no more ==>test

The prompt will ask you for a password. At the next prompt you will be asked to re- type the password. The next prompt allows for another user name. If this is not necessary, press enter to proceed.

New password:

Re-type new password: Adding password for user test

Please enter a user name or press enter for no more ==>

Everything needed has been entered and you are ready to proceed. The following instructions appear, and you will be returned to the original prompt:

all done!

Now we will create the necessary files to run tables. This may take a few moments, please be patient.

Now go to http://product01.cfmc.com/rrunr/ondemand/test to continue

The URL that is needed to access On-Demand Tables can be copied and pasted into your browser. In this example, http://product01.cfmc.com/rrunr/ondemand/test would be copied and pasted.

If the debug option is used, /var/www/html/rrunr/ondemand/test>ondemand.pl rrunr.def debug the following is displayed:

 

Default Data File set to /cfmc/dev.80/data/_STUDY_.tr per

/cfmc/dev.80/control/ondeminit file

 

Default Tables Location set to /var/www/html/_STUDY_/ondemand per

/cfmc/dev.80/control/ondeminit file

 

Default CSS File set to /var/www/html/cfmcweb/css/ondemand.css per

/cfmc/dev.80/control/ondeminit file

 

Default Data File set to /var/www/html/sued/rrunr/tables/rrunr.tr per ondeminit file

Default Tables Location set to /var/www/html/sued/rrunr/ondemand/test per ondeminit file

Default CSS File set to /var/www/html/cfmcweb/css/ondemand.css per ondeminit file

Default Add File set to test.add per ondeminit file

7.3.3  Editing

At any time, the specs used for On-Demand Tables can be edited. There are many reasons for making changes. It might be to change something in the .def file, adding banners or changing settings, to mention a few. After this is done, On- Demand must be reinitialized. To avoid going through the prompts the “batch” command can be used /cfmc/dev.80/go/==>ondemand.pl rrunr.def batch. The ondeminit file created previously will be read and the following will be displayed:

Here’s a recap:

data=/cfmc/dev8.0/data/rrunr.tr

index.html and tables will be stored in /var/www/html/rrunr/ondemand css file used will be /var/www/html/cfmcweb/css/ondemand.css additional definitions will come from webtab.add

Now we will create the necessary files to run tables. This may take a few moments, please be patient.

 

Now go to http://product01.cfmc.com//rrunr/ondemand/test/test to continue

[sued@product01 /www/htmldocs/rrunr/ondemand/test/test dev80]>

The “ondeminit” file created at the initial setup can be edited at any time. Once an edited copy has been created, it will be placed in the directory local to where ondemand.pl is run. If edited, the study would need to be reinitialized by typing:

/cfmc/dev.80/go/ondemand.pl rrunr.def batch

data=/cfmc/dev8.0/data/rrunr.tr wwwloc=/var/www/html/rrunr/ondemand cssfile=/var/www/html/cfmcweb/css/ondemand.css add=webtab.add

Once again, this reflects the choices made in the setup, and it reflects the settings created for this CfMC demo. Paths and directories will reflect the choices made at setup by your system administrators.

If ,at any time, a password needs to be added after the initial setup, the following command can be used.

==>ondemand.pl rrunr.def batch setpass=yes

This will skip all prompts until it gets to the password prompts.

WEBTAB.ADD

Using the webtab.add on the command line allows for bases, weights, banners, headers and logos to be added at setup time. Just as the .qpx/.def file has to be in the local directory (i.e., the directory where your type “ondemand.pl”), so does your “.add” file. The add file will be copied to the Web directory along with the .qpx/.def file. If you change anything in an existing On-Demand setup, the study must be reinitialized.

 

 

{!MENTOR_DEF} and {!MENTOR_TAB} are used to pass Mentor specifications to the .def or .tab file. The SURVENT compiler treats these blocks as comments and no syntax checking is done. When you compile your questionnaire with the option MENTOR_SPECS, these blocks will be passed to the appropriate file.

The close brace (}) in a ~prepare block is interpreted as the end of a command block. The close brace followed by an underscore (}) allows you to embed a close brace (}) inside the compiler command block. The underscore is removed when compiled and passed to the .def file.

The following is an example of the what is contained in the webtab.add file:

If using a .qpx If using a .def
webtab.add

 

{!MENTOR_DEF

 

tabset={base_ny:

t4=:BASE: Location: New York

}_

”base=:loc(4)

base=:[58.2#NY]

}_

 

tabset={base_ca:

t4=:BASE: Location: California

}_

”base=:loc(4)

base=:[58.2#CA]

}_

 

tabset={weight_01:

t2=:WEIGHT: Gender: Males:10 Females:100

}_

weight=:select([57^1/2],values(10,100))

}_

 

tabset={weight_02:

t2=:WEIGHT: Martial Status: Married:10

Divorced:20 Single:100

}_

weight=:select([54^1/2/4],&

values(10,20,100))

}_

}

webtab.add

 

 

 

 

tabset={base_ny:

t4=:BASE: Location: New York

}

”base=:loc(4)

base=:[58.2#NY]

}

 

tabset={base_ca:

t4=:BASE: Location: California

}

”base=:loc(4)

base=:[58.2#CA]

}

 

tabset={weight_01:

t2=:WEIGHT: Gender: Males:10

Females:100

}

weight=:select([57^1/2],values(10,100))

}

 

tabset={weight_02:

t2=:WEIGHT: Martial Status: Married:10

Divorced:20 Single:100

}

 

weight=:select([54^1/2/4],values(10,20,100)

)

}

 

7.3.4 Adding a Base or Weight

A base or weight can be defined in three different ways.

1     In the .qpx

2     Adding it with a file. This file can be named whatever you want it be, but by default a file called webtab.add will be looked for if the add option is used.

3     Defining base or weight directly on the On-Demand selection screen define box.

Using the qpx

This section describes how the .qpx would look.

NOTE:      Use the t4 statement to define your base text, and the t2 statement to define text associated with weights. For the benefit of the final user, be sure to at least define what question label the base or weight is defined from.

NOTE:      Fully qualify the file names of all ampersand/include files so the .qpx when copied to the web area and compiled will find them. If ampersanding in files to the .qpx make sure paths are fully qualified. (example /cfmc/websurv/studies/rrunr/webtab.add)

NOTE:      Multi language studies need the >language speaking=<language> option set in the .qpx. Survent doesn’t but using the db file (which is used in On- Demand Tables) requires it. you must choose a language to display results.

>purgesame

~PREP COMPILE

[RRUNR,640,”EXAMPLE JOB”,SPECWID=128,& TEXT_START=5/1,WORK_START=4/1]

{!AUTO_PUNCHES}

{!BLANK_LINES=1}

{!MENTOR_DEF

tabset={base_ny:

t4=:BASE: Location: New York

}_

”base=:loc(4)

base=:[58.2#NY]

}_

tabset={base_ca:

t4=:BASE: Location: California

}_

 

”base=:loc(4)

base=:[58.2#CA]

}_

tabset={weight_01:

t2=:WEIGHT: Gender: Males:10 Females:100

}_

weight=:select([57^1/2],values(10,100))

}_

tabset={weight_02:

t2=:WEIGHT: Martial Status: Married:10 Divorced:20 Single:100

}_

weight=:select([54^1/2/4],values(10,20,100))

}_

}

{ QN1: 1/6.1

!MISC RATING=5

Q1. How much do you agree with the following statement: The fast food at Road Runners is worth what I pay for it.

! CAT

5 (5) Completely agree

4 (4) Somewhat agree

3 (3) Neither agree nor disagree

2 (2) Somewhat disagree

1 (1) Completely disagree

0 Don’t Know/Refused to answer

}

{ QN2A: 1/7.1

!MISC RATING=5

Q2a. Please rate the following characteristics:

The quality of the food.

! CAT

5 (5) Very good

4 (4) Good

3 (3) Neither poor nor good

 

2 (2) Poor

1 (1) Very poor

0 Don’t know/refused to answer

}

~end

ADDING A FILE ON THE COMMAND LINE

A file name webtab.add can be used to define these bases and weights as well. This file will be placed in the directory where the On-Demand tables will be run. In this case, that would be /var/www/html/rrunr/ondemand (directory used in previous examples).

NOTE:      Use the t4 statement to define your base text, and the t2 statement to define text associated with weights. For the benefit of the final user, be sure to at least define what question label the base or weight is defined from.

webtab.add

{!MENTOR_DEF

tabset={base_ny:

t4=:BASE: Location: New York

}_

”base=:loc(4)

base=:[58.2#NY]

}_

tabset={base_ca:

t4=:BASE: Location: California

}_

”base=:loc(4)

base=:[58.2#CA]

}_

 

tabset={weight_01:

t2=:WEIGHT: Gender: Males:10 Females:100

}_

weight=:select([57^1/2],values(10,100))

}_

tabset={weight_02:

t2=:WEIGHT: Martial Status: Married:10 Divorced:20 Single:100

}_

weight=:select([54^1/2/4],values(10,20,100))

}_

}

If you add the option “add” to your ondemand.pl command line, the file “webtab.add” will be looked for in the local directory and added to the questionnaire spec. If you embellish the “add” command with, for example, “add=somestuff.spx”, a file called “somestuff.spx” will be added to the questionnaire spec. Only one file may be added for now. The spec should be a complete !mentor_def block and it will be inserted at the very end of the db file.

This is done at setup time. The syntax is /var/www/html/<study>/ondemand.pl

<study> add. Just as the qpx file has to be in the local directory (i.e., the directory where your type “ondemand.pl”), so does your “add” file. The add file will be copied to the web directory just as the qpx file is (if you’re not running ondemand.pl in this web directory, of course). This feature was developed to add bases and weights at initialization. If you want to add pre-defined bases and weights to an existing ondemand setup, reinitialize the study.

USING THE DEFINE BOX

As in any CfMC utility (hole,scan,…) a base or a weight can be set for the tables. You can use a data location to set the base or weight. An example would be a base of [51^1], which means only include those cases that have a one-punch in column fifty one. You can also use variables from previous Mentor runs. The DB file in which the variables are defined is accessible in this utility. For further information, see the Utilities manual.

The following are examples of base definitions:

RATING(1,2,Y)                             : named question code list STATE(<>AZ-CA,NV)                                                         : code range/ (<>=not) SEX(M) OR [AGE#18-24,99]   : combinations (AND/OR) Example location specs:               : ,=net -=range

[2/10.2^1-20,24,B]                       : punches (N=not,B=blank) [TIMES#1-10,99,DK,RF,” “]   : numbers or letters [10.2,…,20*F#1-20]      : number nets across columns

WARNING: Do not use “/”s between categories! The following are examples of weight definitions:

Use a pre-defined name, (i.e. “WGHTIT”), OR if weight is in the data, use the

format:”[5/23.3*F2]” for Record 5, column 23, length 3, with 2 implied decimals.

 

To specify a new weight variable, use the format: “Select([1/6.1^1//5],Values(1.23,2.5,0.76,1.03,1))” which assigns weight values using punches 1-5 of column 6.

EDIT OPTIONS

When the index page appears, there is a section on the bottom where you can edit table options.

When Open edit options is clicked, the following will appear. If the radio button is “on,” the menu will expand. Below the Statistical Testing is “of,” therefore the menu is collapsed. These options are explained in previous chapters.

FILES CREATED

During the setup phase, the following files will be created in your On-Demand Web table directory when the .qpx is compiled by the utility:

  • <study>.sum
  • <study>.def
  • <study>.db
  • <study>.qpx
  • mkdb.db
  • index.html – this file allows access to the On-Demand tables

NOTE:      An index.html file will be created in this directory. If you are using a pre-existing Web area for your On-Demand Tables, make sure you don’t overwrite anything important, such as the index.html file.

Once the On-Demand Tables are accessed, other files will appear in the directory. These files will all have an .html extension. There will be a different file for each table.

7.3.5  Creating On-Demand Tables

ON-DEMAND  SELECTION  SCREEN

Use the On-Demand selection screen to choose the variables that are to be crossed. Any question in the .qpx can be crossed with any other question in the same .qpx.. A screen listing all the variables will be displayed. To choose the banner, click the radio button in the left column. For the stub, click the radio button in the second column. A Base or Weight can be added. Once the selection is made, click Submit on the bottom of the page.

 

Preparing Mentor Output Files For Post Processing

FINAL  OUTPUT  OF  TABLES

Each table will appear in a pop-up window. If you minimize the table window, more than one table can be viewed at the same time.

Preparing  Mentor Output Files For Post  Processing

You can create a print file, a delimited file and an html file simultaneously using these minimum keywords:

  • ~specfile <rootname>
  • >printfile <filename>
  • ~set webtables delimited_tables

 

You can run tables from your own tabsets or you can use the .ban file and the .def file created by ~prepare. The most efficient way to make your own banner tabsets is by using the banner element option of make_banner.

1     Creating three files simultaneously by making your own tabsets.

If you make your own banner and use the make_banner option, a .ban is made for you and is named using the ~specfile <rootname>. It contains all of the necessary print, delimited and html banner specifications.

Notice in the .ban file that when you use the default delimiter of tabs, the delimited banner is created using “\t” in place of the tabs.

Mentor specs (post01.spx)

tabset= { qn12_y: banner=: make_banner [level=2] [level=1] Total

[level=2] Overall Road Runners Rating

[level=1] (5) Very good

[level=1] (4) Good

[level=1] (3) Neither poor nor good

[level=1] (2) Poor

[level=1] (1) Very poor

[level=1] Don’t know/refused to answer

}

statistics=: b-g

col=: total with [47.1^5/4/3/2/1/10]

}

 

Mentor banner (post01.ban)

banner=qn12_bn:

\k(p)

Overall Road Runners Rating

 

===========================================================

 

(3)                                                         Don’t Neither                                                 know/ poor    (1)               refused

Very            (4)                nor             (2)              Very                 to

Total       good          Good           good          Poor            poor                answer

 

——       ——             ——           ——             ——         ——                    ——

 

\k(d)

\t\tOverall Road Runners Rating\tOverall Road Runners Rating\tOverall Road

Runners Rating\tOverall Road Runners …

\tTotal\t(5) Very good\t(4) Good\t(3) Neither poor nor good\t(2) Poor\t(1) Very poor\tDon’t know/refused to answer

\k(h)

<tr>

<td colspan=”1″>

<td colspan=”1″>

<td colspan=”6″ align=”center”> Overall Road Runners Rating

</tr>

<tr>

<td colspan=”1″>

<td colspan=”1″ align=”right”> Total

<td colspan=”1″ align=”right”> (5) Very good

<td colspan=”1″ align=”right”> (4) Good

 

<td colspan=”1″ align=”right”> (3) Neither poor nor good

<td colspan=”1″ align=”right”> (2) Poor

<td colspan=”1″ align=”right”> (1) Very poor

<td colspan=”1″ align=”right”> Don’t know/refused to answer

</tr>

}

2     Creating three files simultaneously by using the .ban file and .def file created by

~prepare

This setup ampersands in (brings in) the .ban file and the .def file created by

~prepare. The ~set option auto_banner_heading=title is used to provide a 30 character banner heading. The ~specrules option of column_statistics is used to add a statistics element to the banner tabset.

Mentor banner from ~prepare (rrunr.ban)

tabset= { qn12_y:

banner_title=:

Q12. Overall, how would you rate Road Runners?} banner=: make_banner

[level=2] Q12. Overall, how would you… [level=1] (5) Very good

[level=1] (4) Good

[level=1] (3) Neither poor nor good

[level=1] (2) Poor

[level=1] (1) Very poor

[level=1] Don’t know/refused to answer

}

statistics=: a-f

”qn12(5/4/3/2/1/0)

col=: [47.1^5/4/3/2/1/10]

}

If you use ~specrules base option and have bases or filters that look like this: base=: (QN6(1)), you’ll want to add the ~prepare created dbfile to this run. If you typically use these ~set options:

drop_base drop_title_4

you will also want to add these ~set options:

drop_filter drop_filter_title

A new tabset element has been added to Mentor 7.7 to join banner tabsets called joined_tabsets. This setups joins a user created banner tabset called usertotal and the Q12 banner tabset from the ~prepare created .ban file.

Mentor specs (post02.spx)

tabset= { usertotal: banner=: make_banner [level=2]

[level=1] Total

}

col=: total

}

joined_tabset={ banner1_y:

usertotal with &

qn12_y

}

Mentor banner (post02.ban)

banner=banner1_bn:

\k(p)

Q12. Overall, how would you…

=========================================================== (3)           Don’t

Neither                                                   know/ (5)                  poor                             (1)               refused Very               (4)                    nor             (2)           Very        to

Total       good          Good           good          Poor            poor                answer

 

——       ——             ——           ——             ——         ——                    ——

 

\k(d)

\t\tQ12. Overall, how would you…\tQ12. Overall, how would you…\tQ12. Overall, how would you…\tQ12. Overall, …

\tTotal\t(5) Very good\t(4) Good\t(3) Neither poor nor good\t(2) Poor\t(1) Very poor\tDon’t know/refused to answer

\k(h)

<tr>

<td colspan=”1″>

<td colspan=”1″>

<td colspan=”6″ align=”center”> Q12. Overall, how would you…

</tr>

<tr>

 

<td colspan=”1″>

<td colspan=”1″ align=”right”> Total

<td colspan=”1″ align=”right”> (5) Very good

<td colspan=”1″ align=”right”> (4) Good

<td colspan=”1″ align=”right”> (3) Neither poor nor good

<td colspan=”1″ align=”right”> (2) Poor

<td colspan=”1″ align=”right”> (1) Very poor

<td colspan=”1″ align=”right”> Don’t know/refused to answer

</tr>

}

The joined_tabset option automatically adjusts the statistics element in the

~prepare .ban file from statistics=: a-f to statistics=: b-g when the usertotal banner tabset was joined with the Q12 banner tabset.

Mentor print file (post02.prt)

3     Customizing the delimited file

There are a number of ~set delimited_tables options available that let you select what is passed to the delimited file and these options have no affect on the print file or the html file. Stats letters and footnotes always go to the delimited file but column stats labels like (A) do not. There is no table of contents associated with a delimited file. All of the following items can be turned on or off. All of these items are automatically passed to the delimited file except for the banner and the percent signs:

BANner BANner_TITLE COMMENT do_TABle_NAME

FILTER_TITLE

 

FOOTer HEADer PERcent_SIGN STUB

TITLE Title_2

Title_4

Title_5

These additional ~set delimited_tables options are also available: ADD_SPACE_BEFORE_STATS

Column_WIDth= DELIMITER= FILL_LINES FILL_TABLE LABELS

QUOTED_BANNER_TEXT STATS_ON_SEPARATE_LINE Stub_WIDth= USE_AS_PRINTED

By default, cells that are in the print file as blank, zero or dash, are passes to the delimited file as zeros. The option:

~set delimited_tables=(use_as_printed)

allows you to create a delimited file with cells containing the same characters as the printed table.

You can now change the CfMC assigned extensions on files. If you want to make a comma delimited file and you want an extension that is recognizable as such in Excel, you can change the extension by using:

>cfmc_extension dlm=csv

Mentor specs (post03.spx)

~set delimited_tables=(

banner

-quoted_banner_text delimiter=comma

-footer percent_sign stats_on_separate_line use_as_printed

)

Mentor default delimited file (post02.dlm) Mentor enhanced delimited file (post03.csv)

4     Customizing an html file

There are a number of ~set webtables options available that let you select what is passed to the html file and these options have no affect on the print file or the delimited file. Stats letters, column stats labels like (A), footnotes, comments and percent signs always go to the html file. A “back to table of contents” anchor is added to the end of each table. All of the following items can be turned on or off.

All these items are automatically passed to the html file:

 

BANner BANner_TITLE do_TABle_NAME FILTER_TITLE FOOTer

HEADer STUB TITLE Title_2

Title_4

Title_5

These additional ~set webtables options are also available: BGCOLOR=

CSS_FILE_CHECK= CSS_FILE_PATH= FRAMESet FRAMETABLE= HTML_TITLE= TCON_ANCHOR_TEXT=

WEB_FORMAT_BANner=() WEB_FORMAT_COMMENT=() WEB_FORMAT_Cumulative_Percent_items=() WEB_FORMAT_EVEN_COL=() WEB_FORMAT_EVEN_ROW=() WEB_FORMAT_FREQuency_items=() WEB_FORMAT_Horizontal_Percent_items=() WEB_FORMAT_ODD_COL=()

WEB_FORMAT_ODD_ROW=()

 

WEB_FORMAT_STATistical_test_items=() WEB_FORMAT_STATistics_ROW=() WEB_FORMAT_STUB=() WEB_FORMAT_TABLE=() WEB_FORMAT_Vertical_Percent_items=()

All of these items are used specifically with Dynamic Charts: BANNER_LEVELS=

DOCTYPE= DYNAMIC_SCRIPTS= DYNAMIC_TABLES GROUPS=() HTML_SRC= ONRESIZE=

SURVEY= SURVEY_NAME=

Mentor specs (post04.spx)

You can use the \k(p,h,d) options to pass specific text to specific files. To change the footer specs to remove the page numbers from the html file and the delimited file you can use:

footer={:=

Tables prepared by Computers for Marketing Corp.

\k(p)Page #PAGE_NUMBER#\k(p,h,d)

}

The html files are designed to match the printed files in content. To print significance letters on a separate line, you need to use the appropriate edit statement and this also affects the printed tables. The table of contents is most useful if it is printed first. Edit options that control the page numbering in the table of contents are ignored when creating an html file.

global_edit={: stats_on_separate_line tcon=(first

print_page_numbers

-tcon_page_numbers

)

}

This example uses the following webtables options to customize the html file.

~set webtables=(

html_title=”Road Runner Survey Title”

-header

tcon_anchor_text=”***BACK TO THE TABLE OF CONTENTS***” web_format_statistical_test_items=(font=(color=red))

)

Mentor default html file (post02.htm) Mentor enhanced html file (post04.htm)

5     Putting the table of contents in a frame in the html file

Mentor specs (post05.spx)

 

For this example, two banner tabsets from the ~prepare created .ban file will be joined to create the banner.

joined_tabset={ banner1_y:

usertotal with & qn12_y with & qn16_y

}

The only other change in this example is to put the table of contents in a frame separate from the tables using:

~set webtables=(frameset)

By putting the table of contents in a separate frame, three html files are created instead of one. The starter file is named using the ~specfile <rootname>, the table of contents file has a “t” added to the end of the <rootname> and all of the tables are in a file with “aa” added to the end of the <rootname>. Notice that the “back to table of contents” anchor is removed because it is no longer necessary when the table of contents is in its own separate frame.

Mentor starter html file (post05.htm)

Mentor table of contents html file (post05t.htm) Mentor tables html file (post05aa.htm)

Augmenting Prepare Specs to Enhance Tables

You can use Survent questionnaire specifications to produce two table building specification files, ready to be used by Mentor, called the DEF file and the TAB file. You can use the ~PREPARE COMPILE CMentor_SPECS command or CfMC’s menu-assisted EZWriter application to create these files. The DEF file contains the syntax to define a table for each question and the TAB file contains the commands to build the tables defined in the DEF file. The DEF file can also be edited to add basing, weights, statistics, print format controls, etc. The TAB file can be remade by Mentor to reflect any changes to the DEF file. For more information see “4.12 USING Survent TO GENERATE Mentor SPECIFICATION FILES”.

Refer to “4.11 SAMPLE SPECIFICATION FILES” for details on using these files to make tables. All examples refer to the RRUNR sample specification files included with your Mentor software.