Download presentation
Presentation is loading. Please wait.
Published byTabitha Goodman Modified over 9 years ago
1
Creating Dynamic Surveys with Maintain Mark Derwin and Mark Rawls Information Builders Information Builders Summit 2011 User Conference June 2011 Copyright 2011, Information Builders. Slide 1
2
Copyright 2007, Information Builders. Slide 2 Creating Dynamic Surveys with Maintain Overview These days, after every meal, service call or session you are asked to take a survey. Most of these surveys follow a template of rating service, value and content. The Maintain language is perfect for creating these surveys. Create databases to dynamically build the forms. Once deployed, users can access them from any browser: IE, Firefox, Safari, Opera or Chrome And any smart device: iPad, iPhone, Droid, Blackberry, etc… Presentation DOES include code!!
3
Creating Dynamic Surveys with Maintain Live Demo Ask audience to call out up to 5 questions. Select answers from drop down list. Run the builder and show the created survey. Copyright 2007, Information Builders. Slide 3
4
Creating Dynamic Surveys with Maintain Input and Output Files The survey builder uses one file to contain the survey questions and another file to save the output. Your structure can vary for your site. Copyright 2007, Information Builders. Slide 4
5
Creating the Surveys Copyright 2007, Information Builders. Slide 5
6
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application We can create an application using Update Assist to allow any user to create a survey. Highlight the Survey.mas file and select Update Assist Copyright 2007, Information Builders. Slide 6
7
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application The file only has one segment. Select SURINFO. Click Next > Copyright 2007, Information Builders. Slide 7
8
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application On Top, select Add, Update and Delete On Bottom, make Question and Question_Type visible and Changeable. Click on Validation for Question_Type and select Static List Copyright 2007, Information Builders. Slide 8
9
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application Enter: Input, YesNo, Range, and Range1to5 You can create other answer types as well. Click OK and Next > Copyright 2007, Information Builders. Slide 9
10
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application Select Tree for the Navigation Option. Click Next > Copyright 2007, Information Builders. Slide 10
11
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application Select your favorite Template. Click Next > Copyright 2007, Information Builders. Slide 11
12
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application Click Next > on 5 of 6 Uncheck Compile and Click Finish Copyright 2007, Information Builders. Slide 12
13
Creating Dynamic Surveys with Maintain Creating the AddSurvey Application Add new surveys. Edit questions in existing surveys. Copyright 2007, Information Builders. Slide 13
14
Copyright 2007, Information Builders. Slide 14 Creating Dynamic Surveys with Maintain Adding HTML to HTMLTable Add a Radio Button to an HTMLTable to allow the user to make a selection Use HTML Tags Input Type: Radio Value: Retrieve and Display Values can be blank, static or dynamic Dynamic not recommended. Too many options may get truncated Use Form.GetHTMLField to retrieve the values from the HTMLTable. You cannot resort this stack after you create the input field
15
Copyright 2007, Information Builders. Slide 15 Creating Dynamic Surveys with Maintain Adding HTML to HTMLTable In this example we are adding a Yes / No radio button to a column of a stack. AnswerType contains the HTML code. Answer contains the value selected.
16
Copyright 2007, Information Builders. Slide 16 Creating Dynamic Surveys with Maintain Adding HTML to HTMLTable The HTML table has 2 columns: AnswerType and Answer. Set the Content Type of AnswerType to 1-HTML Make the width 20.
17
Copyright 2007, Information Builders. Slide 17 Creating Dynamic Surveys with Maintain Adding HTML to HTMLTable At runtime the HTML is displayed as the Radio Button. Kicking off the SaveData Case saves and can display the data.
18
Creating Dynamic Surveys with Maintain Using Stacks All input and output to / from a Maintain application is done with Stacks. Load a stack from a database and display it on the form. Columns are database fields and rows are database values. Save the data back to the database. Use the INFER command to create a stack Use the NEXT command to load data into a stack The INCLUDE command saves data back to the database Copyright 2007, Information Builders. Slide 18
19
Creating Dynamic Surveys with Maintain Loading the Survey List Maintain code: Set up 3 stacks to display survey list and save answers Use Exec to get a unique list of surveys DST works great Set up and show the winform Copyright 2007, Information Builders. Slide 19
20
Creating Dynamic Surveys with Maintain Loading the Questions / Question Types When the user selects a survey name perform buildsurvey Load all the questions and question_types into STK Loop through all the questions Dynamically create the HTML depending on type Here we see Input and a radio button for Yes / No Copyright 2007, Information Builders. Slide 20
21
Creating Dynamic Surveys with Maintain Loading the Questions / Question Types Here we see a radio button range and drop list for 1 through 5. By concatenating the counter to the object name, we create a unique name. Copyright 2007, Information Builders. Slide 21
22
Creating Dynamic Surveys with Maintain Adding a Save Button Finally we add a button to the bottom of the stack. We add an IWCTrigger to SaveSurvey so clicking it passes control back to the Maintain code and saves the data. Note: We can also add check boxes with similar code Copyright 2007, Information Builders. Slide 22
23
Creating Dynamic Surveys with Maintain Inside the Maintain Development Environment Copyright 2007, Information Builders. Slide 23
24
Creating Dynamic Surveys with Maintain Adding the HTMLTable The HTMLTable displays the data from STK Use AlternameRowColor to make the rows look clearer Remove the border and grid lines Change the Font and Font size to stand out Change Overflow to Visible so form scrolls without scrollbars Copyright 2007, Information Builders. Slide 24
25
Creating Dynamic Surveys with Maintain Adding the HTMLTable Add columns Question_No, Question and AnswerType from STK Rename Question_No to No and make QUESTION width 50 & mixed case Double click on AnswerType Change the Title to Answer, Width to 45 and Content type to 1-HTML Copyright 2007, Information Builders. Slide 25
26
Creating Dynamic Surveys with Maintain Finishing the Form Add a Combobox to display ShowStk.Survey_Name When the user makes a selection, perform BuildSurvey Drag Tname onto the form and rename it Name Add whatever image you want. Change Form Title property to “Take a Survey” Copyright 2007, Information Builders. Slide 26
27
Creating Dynamic Surveys with Maintain Saving the Data Perform SaveSurvey when the user clicks the Save Button Copyright 2007, Information Builders. Slide 27
28
Creating Dynamic Surveys with Maintain Saving the Data Compute the selected survey_name into SaveStk Next assign the unique Count Now loop through the amount of questions and get the answers. The GetHTMLField command is used to retrieve values. Save all the information to the Database If save fails, bump up the Count and do it again. When done, Exit or display a Thank you screen. Copyright 2007, Information Builders. Slide 28
29
Creating Dynamic Surveys with Maintain Display Copyright 2007, Information Builders. Slide 29
30
Creating Dynamic Surveys with Maintain Display Copyright 2007, Information Builders. Slide 30
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.