Page 1 of 1
csv file view using a variable filename (based on login username)
Posted: Wed Apr 10, 2024 11:54 am
by kenderuiter
Hello Pablo,
I want to build a website which starts with the login function (this i already have).
When i login with a valid username/password combination, I want the site to open a page with a csv-viewer in which the contents of a csv-file should be shown. The filename of the csv-file however must be <user name>.csv. So it will be a different file for each username. For example: when I login with username kenderuiter, the csv-viewer must show the content of kenderuiter.csv
My question is whether this (or anything remotely like this) is possible using WWB? And if so, how.
Kind regards,
Ken de Ruiter
Re: csv file view using a variable filename (based on login username)
Posted: Wed Apr 10, 2024 2:25 pm
by Pablo
There is no standard solution for this, so this will require a custom script.
Re: csv file view using a variable filename (based on login username)
Posted: Wed Apr 10, 2024 2:31 pm
by kenderuiter
Ok, thank you for your reply.
I just posted a new ticket because using the data viewer with the csv (online) option does not show any data.
Can you enlighten me about this issue?
Regards,
Ken
Re: csv file view using a variable filename (based on login username)
Posted: Wed Apr 10, 2024 6:25 pm
by bkjohns
I don't know what csv viewer you are using (extension?) but if you are using an extension you may have to change the delimiter. Some use a semi colon while others default to a comma. Whatever it is it has to match the file or you won't see your data.
Re: csv file view using a variable filename (based on login username)
Posted: Thu Apr 11, 2024 3:20 am
by wwonderfull
I used a comma and that always worked on making the data come to view.
Re: csv file view using a variable filename (based on login username)
Posted: Thu Apr 11, 2024 8:04 am
by WWBman
kenderuiter.csv uses a semi-colon.
Re: csv file view using a variable filename (based on login username)
Posted: Thu Apr 11, 2024 6:33 pm
by kenderuiter
Thanks for the reactions you guys; I really appreciate it!
To explain what I did since sending in my ticket
Yesterday I came to the conclusion (confirmed by Pablo) that i need to use a relative path to the file. So instead of refering to it like
https://mywebsite/filename.csv I just needed to refer to "./filename.csv"
Reacting to the bkjohns question "what csv viewer (extension)"
I am using the 'Data viewer' extension. If anyone has a better suggestion though I am totally open to it because the 'Data viewer' extension seems rather limited in its options. One of the options I would like to have is the opportunity to download the csv-file. This option is not availble in the 'Data viewer' extension.
The 'Mobile Friendly Table' extension seems to have these options but they do not work in the DEMO version (which seems logical: why buy the cow if you can get the milk for free).
Does anybody know if the download function will work when you buy the extension? Or does anyone have a better alternative for the 'Data viewer' extension? If so, please let me know.
Kind regards,
Ken de Ruiter
Re: csv file view using a variable filename (based on login username)
Posted: Thu Apr 11, 2024 6:55 pm
by wwonderfull
I think the csv download feature for mobile friendly table should or would work. If there are problems then let us know.
Re: csv file view using a variable filename (based on login username)
Posted: Thu Apr 11, 2024 7:15 pm
by kenderuiter
Hi wwonderfull,
The icon for downloading is shown in the mobile friendly table (the tip text shows 'Export data') but when I click on this icon, nothing happens.
To be clear: I am using the DEMO version of the mobile friendly table extension.
Re: csv file view using a variable filename (based on login username)
Posted: Thu Apr 11, 2024 7:26 pm
by BaconFries
What was it you wrote? "but they do not work in the DEMO version (which seems logical: why buy the cow if you can get the milk for free)." So you may have simply answered this yourself. As it is a "Demo" all features are disabled and will only work when purchased.
Re: csv file view using a variable filename (based on login username)
Posted: Fri Apr 12, 2024 6:02 am
by wwonderfull
From my client side here is an example of that table with it's csv export functionality.
https://kingsvillepd.us/
Re: csv file view using a variable filename (based on login username)
Posted: Fri Apr 12, 2024 7:27 am
by BaconFries
From my client side here is an example of that table with it's csv export functionality
@wwonderfull are you and forum member
noesosa the same person? as he is asking for help regarding his template and the extension at the following urls and it is the same url as the one you say is your
client..
Settings.wtp template
Volume 3 pack Mobile Table not working
Cant open file , webform
Re: csv file view using a variable filename (based on login username)
Posted: Fri Apr 12, 2024 10:26 am
by wwonderfull
He became the client and asked the help and had emailed. Not just one but did 3 sites with him year ago. Also helped him with progress bar for file upload that was the first meeting I think
viewtopic.php?t=95757. Also had made kind of like a web app design for school shooting terror alarm.
Re: csv file view using a variable filename (based on login username)
Posted: Fri Apr 12, 2024 10:19 pm
by BaconFries
Nice work with a great colour scheme that suits the nature the site.