Page 1 of 1
Creation of new csdb file based on id values
Posted: July 30th, 2025, 6:33 am
by cspromanish
I want to create new file each time base on id values while data entry.
For example if I wish to enter data for District="01", Month="02", Year="2025" and Sector="01" a new csdb file should be created
with name "0102202501.csdb".
Is that possible?
Please share the solution.
Thanks:
Re: Creation of new csdb file based on id values
Posted: July 30th, 2025, 11:59 am
by Gregory Martin
You can do something like this:
string data_filename = maketext("%02d%02d%04d%02.csdb", DISTRICT, MONTH, YEAR, SECTOR);
setfile(DICT_NAME, data_filename, append);
"append" will create the file if it does not already exist and open the file otherwise.
Re: Creation of new csdb file based on id values
Posted: August 5th, 2025, 8:02 am
by cspromanish
1- I want to create an application in which whenever I filled the primary id, it will create new file in the name of ID values.
2- Want to create another application (pff application) programmatically to open the newly created csdb file (as discussed in point-1) to fill the data.
Can it be possible?
Please guide about the process.
Thanks...
Re: Creation of new csdb file based on id values
Posted: August 5th, 2025, 6:54 pm
by Gregory Martin
1) You can use setfile to modify the input data file in a data entry application. You'll want to ensure that you run this logic only once all your IDs have been entered.
https://www.csprousers.org/help/CSPro/s ... ction.html
2) You can use the Pff object. Load the PFF for your application and then modify the InputData property:
Pff app_pff;
app_pff.load("Other Application.pff");
app_pff.setProperty("InputData", "the filename you calculated in #1");
app_pff.exec();
https://www.csprousers.org/help/CSPro/P ... ction.html