I am more than just a survey tool : Project List dropdown

Last Updated on Thursday, 15 August 2013 02:17 Written by Admin Thursday, 15 August 2013 12:30

In this article you will discover how you can make an HTML dropdown of all the projects on your server that you are allowed to access. You might ask, why would you need this, but think about it. In our last set of articles i showed you how to make a list of the data in your survey appear in a web page. In the code we manually specified the project, it would be far better if you could first select the project you wanted to query.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Learn More

Jobs : 09/08/2013

Last Updated on Thursday, 8 August 2013 10:27 Written by Admin Saturday, 3 August 2013 10:13

Here is the list of jobs that came into my inbox this week. Enjoy


Print Media Analyst, Markham, OH, USA, $ Salary TBD (posted 2/8/13)
Advertiser: Buckingham Personnel
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104401&tpn=10439&pw=tra523

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Learn More

I am more than just a survey tool : Listing Records ( Select, Update and Delete )

Last Updated on Wednesday, 31 July 2013 10:45 Written by Admin Wednesday, 31 July 2013 10:42

In our last article we designed a menu option that allowed us to see the content of a particular survey. The information was displayed to the user in an HTML table and in some cases if there are two many fields in the file then the table was large and not very usable. In this example we will take this code a stage further and allow the user to enter the select statement that they would like to use to present the data.

The first thing we need to do is to change the way the function that creates the table is called. It currently looks like this,

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Learn More

Jobs : 02/08/2013

Last Updated on Thursday, 1 August 2013 10:30 Written by Admin Sunday, 28 July 2013 09:51

Here is the list of jobs that came into my inbox this week. Enjoy


Data Processing Programmer
Remuneration: negotiable Basic salary
Benefits: Medical Aid and Pension Fund


VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Learn More

Jobs : 26/07/2013

Last Updated on Friday, 26 July 2013 09:45 Written by Admin Friday, 26 July 2013 09:45

Here is the list of jobs that came into my inbox this week. Enjoy


Survey Programmer / Scripter – Market Research and Insights Agency, Sydney, $AUD 65-80,000 + SUPER (posted 19/7/13)
Advertiser: Resources Group
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104097&tpn=10439&pw=tra523


VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Learn More

I am more than just a survey tool : Listing Records

Last Updated on Wednesday, 24 July 2013 11:17 Written by Admin Friday, 19 July 2013 09:45

In this article we will look at how we can display some data in a list as a menu item action. Let us pretend that we need to see all the records in a particular survey. At this stage , we will just display it , but in future articles we will show how you could update them.

So, what do we need , well we need our menu system from previous examples and we will place the code under the menu option B.

Select Case Option1Menu
	Case = {mBack}
		Goto pMainMenu
	Case = {mOption1_OptionA}
		message.Label.Inserts["MESSAGE"] = MakeIFrame("http://www.smarterDataCollection.com")
	Case = {mOption1_OptionB}
		message.Label.Inserts["MESSAGE"] = MakeDataList(gFMROOT,gSQLServer,gUserDB,"*","")
End Select

As you can see we are using our “User” survey that we created in [This article], we are passing in the fmroot folder name and the name of the SQL server. The last two paramaters are the fields to show ( astrix means all ) and then a where clause, Blank means all records. So what does the function look like,


Function MakeDataList(gFMROOT,gSQLServer,sDB,sFields,sWhere)
	Dim oConnection , oRecordset,oField
	Dim sHTML
	
	Set oConnection = CreateObject("ADODB.Connection")
	oConnection.ConnectionString = "Provider=mrOleDB.Provider.2;Data Source=mrRdbDsc2;Location='Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=" + sDB + ";Data Source=" + gSQLServer + "';Initial Catalog=\\" + gFMROOT + "\Master\" + sDB + "\" + sDB + ".mdd;MR Init Category Names=1;MR Init Project=" + sDB
	oConnection.Open()
	
	If ( oConnection.State = 1 ) Then
	
		Set oRecordset = CreateObject("ADODB.Recordset")
		
		oRecordset.Open("select " + sFields + " from vdata " + sWhere ,oConnection,3,1)
			
			sHTML = MakeHTMLTableFromRS(oRecordset)
				
		oRecordset.Close()

		Set oRecordset = Null
		
	End If

	oConnection.Close()
	
	Set oConnection = Null

	MakeDataList = sHTML
	
End Function

So what does MakeDataList actualy do , well the first thing , after the declarations is to connect to the Data Collection survey. This is done with a standard ADODB connection. Next if the conection is open we create a recordset based on the fields and where clause that we pass in. In out next article we will see how we can paramatarize this.

After we have opened the recordset we decide what we want to do with the records we have. In this case we are going to convert them to a HTML table.

Function MakeHTMLTableFromRS(oRecordSet)
Dim sHTML,oField

sHTML = "<table border=""1"">" + mr.cr
sHTML = sHTML + "<tr>" + mr.cr

For Each oField in oRecordset.Fields
	sHTML = sHTML + "<td>" + oField.Name + "</td>" + mr.cr
Next

sHTML = sHTML + "</tr>" + mr.cr

Do while oRecordset.EOF = false and oRecordset.bof = false
		sHTML = sHTML + "<tr>" + mr.cr
			For Each oField in oRecordset.Fields
				sHTML = sHTML + "<td>" + MakeSpaceIfBlank(oField) + "</td>" + mr.cr
			Next
		sHTML = sHTML + "</tr>" + mr.cr
	oRecordset.MoveNext()
Loop

sHTML = sHTML + "</table>" + mr.cr

MakeHTMLTableFromRS = sHTML

End Function

So what does this new funtion do. First off it loops the names of the fields in the recordset and places them on the first row of the table, next it loops through all the records in the table and displays the content of each field in its own cell. Finaly it closes the table and returns the created HTML.

The key thing to notice here / think about here is that we are taking something and converting it to an HTML item. Why do we need to think about this , well perhaps rather than produce a html table of the data you wanted to produce a dropdown of one of the fields. You might say why would you do this and in later articles you will see how , but you could rather than render an HTML dropdown you could render a Dojo spinner.

Anyway back to our table. You will see in the makeHtmlTableFromRS function we call a function MakeSpaceIfBlank the content of that function is as follows.

Function MakeSpaceIfBlank(oField)
Dim sValue
	
	sValue = CText(oField.Value)
	if ( sValue = "" ) Then sValue = "."
	
MakeSpaceIfBlank = sValue
End Function

This function is simple , all it does is to convert the field value passed in to a string and if the value is nothing convert it to a full stops. In this example, it just makes the table look a little neater and could eaily convereted to return any value you like. When you run the script and select option B this is what you should see.

List

And there you have it, code that can be used to show on a web page the content of a survey. In the next article we will see how we can possibly take this a stage further and allow the user enter the field names and where clause.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

I am more than just a survey tool : iframe

Last Updated on Friday, 19 July 2013 09:50 Written by Admin Friday, 19 July 2013 09:28

So 7 months into the year and this is the first post , how bad is that :-) … Anyway back on the posting again which is good. At the end of last year i started some posts titled “I am more than just a survey tool” and i covered everything you needed to know about how to design a Menu system. Now the next set of articles will show you the code i use to display content in menu system. This article assumes you have followed the previous examples and you have a menu system like this ,

menu1

with a sub menu of this

menu4

The code we add will be added to the sub menu “Option A”. We will make a function ( MakeIFrame ) that will return some HTML code so our menu code will look like this,

Select Case Option1Menu

	Case = {mBack}
		Goto pMainMenu
	Case = {mOption1_OptionA}
		message.Label.Inserts["MESSAGE"] = MakeIFrame("http://www.smarterDataCollection.com")
	Case = {mOption1_OptionB}

		message.Label.Inserts["MESSAGE"] = "<h1>Option B</h1>"
End Select

So what will the function do. Well it will point us to another web page and display it in our page with the use of an IFrame. The html Iframe is perfect for this and once you know how to create one you can do many things with them as you will see in later articles. So what does our code look like?

Function MakeIFrame(sURL)
Dim sHTML
sHTML = "<iframe src="" height="240" width="320" frameborder=""></iframe>"
sHTML = replace(sHTML,"{URL}",sURL)
MakeIFrame = sHTML
End Function

This function is simple , but highlights a powerfull feature that we will use over and over again. Using the replace function we can take a pre-defined html string that we have perhaps designed in out web tool and then replace it with the code that we like , so in our case , we have take the iframe code that will create a windows 1024 pixels wide by 600 high. The window has no border so it will look as if it is part of our original page and it will show the URL that we pass into it. After the replace function has worked we will end up with a string like this,

"<iframe src="http://www.smarterdatacollection.com" height="240" width="320" frameborder=""></iframe>"

And when we run the code , we will see our page connected to our menu system.

iframe

And that is it for this post , but whats next? Well , the use of an iframe is good, but how good , showing a static page is ok , but what about surveys , or forms to collect data , how can we do that. If we use a survey , how can we keep calling the same record? All these questions will be answered in my next post , so watch this space.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Jobs : 19/07/2013

Last Updated on Friday, 19 July 2013 09:23 Written by Admin Friday, 19 July 2013 11:00

Here is the list of jobs that came into my inbox this week. Enjoy


Senior Spec Writer (Merlin / Quantum / Bellview), SE London / Kent, £28-32,000 (posted 15/7/13)
Advertiser: Resources Group
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=103966&tpn=10439&pw=tra523


Senior Support Lead Developer, Chicago, IL, USA, $ Salary TBD (posted 15/7/13)
Advertiser: Ipsos North America
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=103971&tpn=10439&pw=tra523


Survey Programmer
Lightspeed Research Australia Pty. Ltd.
The Survey Programmer will have responsibility to design and script on-line surveys for our clients throughout Asia Pacific.


Data Collection Survey Scripter
C R Research Services – Chicago, IL


Senior Spec Writer (Merlin/Quantum/Bellview) – Top Agency ( SE London/KENT )
Top Agency – £28-£32,000


Test Program Manager, Schaumburg, IL, USA, $ Salary TBD (posted 16/7/13)
Advertiser: The Nielsen Company
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=103997&tpn=10439&pw=tra523


Web Developer – JavaScript / C / .NET, Top MR Software Group, London, £30-40,000 (neg) (posted 16/7/13)
Advertiser: Resources Group
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104006&tpn=10439&pw=tra523


Operations Analyst – Consumer Insights, Tampa Bay, FL, USA, $ Salary TBD (posted 16/7/13)
Advertiser: The Nielsen Company
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104008&tpn=10439&pw=tra523


Senior Marketing Insight Analytics – Clientside, Central London, £45-50,000 + Bens (Long Contract-perm) (posted 17/7/13)
Advertiser: Resources Group
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104014&tpn=10439&pw=tra523


Head of Product, London, £40-50,000 (posted 17/7/13)
Advertiser: RPCushing Recruitment
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104017&tpn=10439&pw=tra523


Extract Delivery Lead, Chicago, IL, USA, $ Salary TBD (posted 17/7/13)
Advertiser: The Nielsen Company
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104043&tpn=10439&pw=tra523


Web Survey Programmer
TNS – Northwood, OH

The Opportunity: Web Survey Programmer


Field Service Representative, San Antonio, TX, USA, $ Salary TBD (posted 18/7/13)
Advertiser: The Nielsen Company
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104049&tpn=10439&pw=tra523


Field Service Representative, Baltimore, MD, USA, $ Salary TBD (posted 18/7/13)
Advertiser: The Nielsen Company
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104077&tpn=10439&pw=tra523


Senior DP Specialist – Askia or ConfirmIt, Creative Agency, London, £35-45,000 + benefit (posted 18/7/13)
Advertiser: Resources Group
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=104082&tpn=10439&pw=tra523


VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Jobs : 15/07/2013

Last Updated on Monday, 15 July 2013 11:20 Written by Admin Monday, 15 July 2013 11:00

Here are some jobs I found on the net that you may be interested in. This is the first of a weekly post that I will be adding.  Subscribe to this site and get these posts direct to your inbox.


Data and Reporting Manager – Media, Central London, £32-37,000 (posted 12/7/13)
Advertiser: RPCushing Recruitment
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=103931&tpn=10439&pw=tra523

Senior DP / Programming Executive, Kent (UK), £30,000 – DOE and skill set (posted 12/7/13)
Advertiser: Hasson Associates
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=103946&tpn=10439&pw=tra523

Senior Technical Consultant and Support, Markham, ON, Canada, $ Salary TBD (posted 12/7/13)
Advertiser: The Nielsen Company
http://www.mrweb.com/cgi-bin/vac-disp.cgi?ppNum=103949&tpn=10439&pw=tra523

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Its been a long time

Last Updated on Monday, 15 July 2013 01:03 Written by Admin Monday, 15 July 2013 12:53

It’s been over 7 months since my last post and to be honest I don’t know where the time has gone. In my professional life, I have been working on a special project and it has consumed all of my time, but I have learnt allot. And now I think it is time to get back on the wagon and start posting a few more articles to continue on the theme we started all those months ago and also show you some of the new things I have learnt.

I have not thrown this question out there for a while but are any of you interested in writing article with me? It can be on anything IBM SPSS Data Collection it can be short or long, it’s just all about sharing knowledge. Anyway if you do want to write something drop me an email or comment on this post and i will get you added to the system so that you can start blogging.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Who's Online

6 visitors online now
2 guests, 4 bots, 0 members

 

Archives

Designed by RocketTheme
WordPress is Free Software released under the GNU/GPL License.
6 visitors online now
2 guests, 4 bots, 0 members
Max visitors today: 13 at 11:15 am UTC
This month: 20 at 09-10-2014 08:38 pm UTC
This year: 40 at 04-05-2014 04:17 pm UTC
All time: 95 at 10-13-2012 12:20 am UTC