Page 1 of 1

EXPORTING TO EXCEL FROM ANDROID

Posted: November 7th, 2019, 3:49 pm
by segxy4manu
Hello friends,
Please can I get help for the following on a programme
To have a userbar on android that will allow export to .cvs (Excel) directly into the android without using computer
Thanks

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 6:31 am
by josh
The export tool is only supported on Windows so you can't use that on Android. One option on Android would be to use the filewrite() function to write out a file in .csv format which could be opened in Excel.

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 10:02 am
by htuser
Hi Josh,
I imagined that the export statement could do this job. Does CSEntry Android doesn't support this statement?
Please let me know.
Best,

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 10:34 am
by josh
Export statement is not supported on Android.

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 11:21 am
by segxy4manu
Alright, thanks Josh
I will try the filewrite and see how it does work.
So this is achievable through bar on Android or Menu?

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 1:13 pm
by segxy4manu
Josh,
Can you help with the script/syntax to filewrite and to save the file in .cvs and I want it to be on the menu bar if possible rather than to be in a menu in a question variable.
Thanks

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 2:06 pm
by josh
Do you want to export just the current case or do you want to export all the cases in the data file? For the later you need to be in a menu program since you cannot access the other cases in the main data file.

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 2:15 pm
by segxy4manu
josh wrote:
November 8th, 2019, 2:06 pm
Do you want to export just the current case or do you want to export all the cases in the data file? For the later you need to be in a menu program since you cannot access the other cases in the main data file.
I want to export the current case, and wish to rename it incase of different cases.
Thanks

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 2:37 pm
by josh
In that case look on page 59 of the workshop materials https://www.csprousers.org/resources/CS ... rkshop.pdf in the section labeled "Writing and Viewing Reports". That shows how to use write out a text file using filewrite with data from the current case. The complete example app is available at https://www.csprousers.org/resources/CS ... erials.zip under session 7. It adds a user bar button to write out the text file.

To write out csv instead of plain text just change the file name to end with .csv and format it as comma separated values. Something like:

filewrite("%v,%v,%v,%v", NAME, AGE, SEX, RELATIONSHIP);

Re: EXPORTING TO EXCEL FROM ANDROID

Posted: November 8th, 2019, 3:03 pm
by segxy4manu
josh wrote:
November 8th, 2019, 2:37 pm
In that case look on page 59 of the workshop materials https://www.csprousers.org/resources/CS ... rkshop.pdf in the section labeled "Writing and Viewing Reports". That shows how to use write out a text file using filewrite with data from the current case. The complete example app is available at https://www.csprousers.org/resources/CS ... erials.zip under session 7. It adds a user bar button to write out the text file.

To write out csv instead of plain text just change the file name to end with .csv and format it as comma separated values. Something like:

filewrite("%v,%v,%v,%v", NAME, AGE, SEX, RELATIONSHIP);
Thanks for this,
Hope it will help and will soon get back to you.

Josh, thumb up to you