Data downloads not working

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

Data downloads not working

Post by Don »

I'm trying to download data that is restricted to a particular ED to my tablet. I'm using the following code and although I'm not seeing any errors I'm not seeing any new cases on the tablet. Is there something that I am missing?

Code: Select all

PROC CHOOSE_ED
Postproc
	//there's a CHOOSE_ROUND field that is filled before this one
	rnd_ed = maketext("%02d%03d", CHOOSE_ROUND,CHOOSE_ED);
	downloadData(rnd_ed);
	
	move to LOGIN;

Code: Select all

//downloads Data based on round and ED
function downloadData(string rnd_edno)
	errmsg("Attempting to download all data from Round %s, ED %s",rnd_edno[1:2],rnd_edno[3:3]);
	if syncconnect(FTP,"1.1.1.1","username","password") then		//connect to FTP 
		syncdata(GET,LABOURFORCE_DICT,rnd_edno);		//get labourforce data for round and ED
		syncdata(GET,LISTING_DICT,rnd_edno);			//get listing data for round and ED
		syncdisconnect();		//disconnect
		errmsg("Download of round %s, ED %s was successful",rnd_edno[1:2],rnd_edno[3:3]);
	else
		errmsg("Download of round %s, ED %s failed, Please try again",rnd_edno[1:2],rnd_edno[3:3]);
	endif;
end;
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Data downloads not working

Post by josh »

Most likely cause is that the universe you are passing to syncdata() does not match any cases on the server. You can verify that this is the issue by removing the universe paramrter and running your program to see if you get data.

You need to make sure that number of digits in the id-items and the zero fill of the id items are consistent between your universe and your dictionary. If the id-items are not zero-filled in your dictionary then it won't match the zero fill you have in your universe and no cases will be synced. Same issue if your id-items are not 2 and 3 digits.
Don
Posts: 55
Joined: February 15th, 2013, 1:28 pm
Location: Barbados

Re: Data downloads not working

Post by Don »

Hi Josh,

Thanks. The issue was that I was using %02d and I didn't zero fill my data dictionary.
Post Reply