Page 1 of 2
Logic to automatically name Data file name by enumerators code or by name
Posted: February 8th, 2022, 11:15 pm
by sham
Hi Family,
Kindly help me with this issue;.
I have a number of enumerators that I want to deploy to the field to collect data.The assistant I need for now is getting the logic to assigned their enumerator code or name as the name of the Data file instead of HELP_ISSUES.csdb (as general data file name), so that I don't have to necessary go and view the variable that is asking who the enumerator is to know where that particular data file name is coming from. So by looking at the data submission, the data file name alone should tell me from which enumerator or who sent that data for easy identification.
For example I am using one of the enumerator's name on the demo list that I have from the dictionary. Enumerator code 03 and enumerator Name sham.So as soon as sham launches the traffic light or sends the data,his data file name should appear either as sham.csdb or 03.csdb.
By default I now have the data file name as HELP_ISSUES.csdb which is not so specific for me.
I attached the file as usual for your study.
Thank you in advance and I welcome directions and guidance from you seniors.
Sham
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: February 9th, 2022, 6:52 am
by ares
Hi Sham,
Are you using a MENU ?
Through a menu it is easier to indicate the folder with the name/code of user.
Except for each of them you specify the data file name (manually).
You can do this with your pff file
this is the actual structure (opening with notepad)
////////////////////////////////////////////////////////////
[Run Information]
Version=CSPro 7.7
AppType=Entry
[DataEntryInit]
[Files]
Application=.\issues.ent
InputData=.\HELP_ISSUES.csdb
Paradata=.\issues.cslog
////////////////////////////////////////////////////////////
//You will play on the second to the last line
InputData=.\HELP_ISSUES.csdb
// There you are indicating the file name
InputData=.\SHAM.csdb // instead of InputData=.\HELP_ISSUES.csdb
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: February 9th, 2022, 8:30 am
by htuser
Dear All,
I worked, years ago for dynamic rename of Data file according to enumerator's name with CSPro Dev Team help and support. Here's the basic
It was designed when CSPro version where 6.1, so, since 2015.
Please compile both, menu and main application to .pen and test it. If it don't work, please let me know.
apps. Hope it will help you.
Since i used a more sophisticated way with CSDB name according to device name instead of enumerators.
I don't think it's important to rename data file with enumerator's name since each user can have access only to theirs data using filters.
DataFileRename.zip
Best,
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: February 10th, 2022, 1:17 am
by sham
Thanks htuser and ares for your support.
I will try and revert.
Am most grateful
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: April 30th, 2022, 12:53 am
by sham
Hi htuser,
Sorry for replying late. I was out of network area couple of weeks ago.
I appreciate your comment and the file you shared for a simple Menu and Data file as well.
However, I compiled the Menu to .pen, did same for the main application as you directed. But unfortunately when i deployed to test it I had an error message which says;
(see attached files).
If you can explain further Sir may be I got it wrong. I need that.
Thank you soo much.
Sham
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: May 7th, 2022, 2:22 pm
by htuser
Hi Sham,
The errors concerned pathnames.
string applicationName = "..\main_application\real_application.pen";
string nom_menu = ".\menu.pen";
string dataFolder = "..\main_application\data\";
string dataMenuFolder = "..\";
string dataFolderpff = "..\main_application\";
string dataFolderap = "..\main_application\";
I correct them and clean some logics. Please receive this working version.
Please use
clerk01 or
clerk02 or
clerk04 as operator ID for best result.
Please let me know if all are correct in you devices
Best,
Test_May_2022.zip
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: May 8th, 2022, 12:39 pm
by sham
Hi @htuser
I still can't open. It still gives me error.
Maybe short video will do if you can or may be detail step-by-step instructions will also help.
Because I need it.
I couldn't use the menu program you created to open the mail application.
Thank you.
SHam.
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: May 8th, 2022, 1:44 pm
by htuser
@ Sham,
I test it on my computer and it work.
Please send to me a private message on the forum, so i will try to help you using Teamviewer.
Best,
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: May 9th, 2022, 3:19 am
by sham
@Htuser,
I find it a challenge to sent you a private message as you directed. How do I go about it?.
Or if you don't mind giving me an e-mail address to make life easy. Can I have your email address.
Thanks
Re: Logic to automatically name Data file name by enumerators code or by name
Posted: May 9th, 2022, 8:05 am
by Gregory Martin
We disabled private messages a couple weeks ago to combat a lot of spam that was coming in. If you want to find someone's email, click on their user name and you'll see a link with the email address used to register the account.