Logic to automatically name Data file name by enumerators code or by name

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

Logic to automatically name Data file name by enumerators code or by name

Post 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
Attachments
Data file Name_issues.zip
(30.61 KiB) Downloaded 103 times
ares
Posts: 16
Joined: January 29th, 2022, 7:54 am
Location: Yaounde

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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
(6.25 KiB) Downloaded 125 times
Best,
G.VOLNY, a CSProuser from Haiti, since 2004
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

Re: Logic to automatically name Data file name by enumerators code or by name

Post by sham »

Thanks htuser and ares for your support.
I will try and revert.

Am most grateful
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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
Attachments
Screenshot_2022-04-30-05-37-58-508.jpeg
Screenshot_2022-04-30-05-37-58-508.jpeg (92.84 KiB) Viewed 52254 times
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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
Corrected and cleaned version
(13.34 KiB) Downloaded 100 times
G.VOLNY, a CSProuser from Haiti, since 2004
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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,
G.VOLNY, a CSProuser from Haiti, since 2004
sham
Posts: 69
Joined: February 3rd, 2022, 7:30 pm

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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
Gregory Martin
Posts: 1774
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Logic to automatically name Data file name by enumerators code or by name

Post 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.
Post Reply