Page 1 of 1

Import table from CSV?

Posted: Tue Apr 02, 2019 9:36 am
by alan_sh
I'm trying to create a table and import data from a CSV file. I've created my table. I right click and select import... I select my CSV file and then nothing happens. Nothing imports, no further dialog box. I'm using the 64 bit version.

This is the contents of my CSV: - what am I missing?
Group Name,Postcode,Beavers meeting night,Cubs meeting night,Scouts meeting night
First Rochdale,OL16 2DA,Thursdays,Mondays,Mondays
1st Heywood,OL10 2NN,Mon-Tues,Mon-Wed,Tues-Wed
1st Middleton,M24 5DL,Thursday,Thursday,Thursday
1st Milnrow,OL16 3HB,Wednesdays,Thursdays,Mondays
2nd Middleton,M24 1BT,Tues-Thurs,Tues-Thurs,
3rd/4th Heywood,OL10 3DD,Wednesdays,,Thursdays
5th Pennine,OL11 1DS,Fridays,Fridays,
6th Rochdale,OL11 5PQ,Fridays,Fridays,Fridays
7thA Rochdale,OL12 7AG,Wednesdays,Wednesdays,Thursdays
8th Heywood,OL10 4JH,Thursdays,Mondays,Mondays
8th Middleton,M24 1PP,Wednesdays,Wednesdays,
9th Heywood,Ol11 5PP,Tuesdays,Mondays,Wednesdays
10th Rochdale,OL12 7SJ,Thursdays,Mondays,Tuesdays
12th Heywood,OL10 3PD,Wednesdays,Wednesdays,Tuesdays
12thA Rochdale,OL15 0DY,Mondays,Mondays,
17th Middleton,M24 2RE,Thursdays,Thursdays,
17th Rochdale,OL12 9PG,Tues-Wed,Wed-Fri,Thursday
27th Rochdale,OL16 4UJ,Thursday,,
29thA Rochdale,OL15 8NL,Wednesdays,Mondays,Thursdays
37th Rochdale,OL11 3EY,Fridays,Wednesdays,Fridays
40th Rochdale,OL12 9TF,,Thursdays,
41st Rochdale,OL12 8DP,Wednesdays,Tuesdays,Thursdays

Re: Import table from CSV?

Posted: Tue Apr 02, 2019 10:13 am
by kibble
alan_sh
I use Pablos Responsive Data Table (in a layout grid) and that works fine, I can set a breakpoint for the layout to change to fit phones.
You can only see the table populated when published or previewed.

Re: Import table from CSV?

Posted: Tue Apr 02, 2019 10:24 am
by WWBman
The table import option from the standard menu works for me.
Try specifying just 1 row when you create the table.

Re: Import table from CSV?

Posted: Tue Apr 02, 2019 10:26 am
by alan_sh
Weird - it does absolutely nothing. Whether I create a 1x1 table or a 23x5 table - import does nothing once I have selected my file.

Alan

Re: Import table from CSV?

Posted: Tue Apr 02, 2019 10:35 am
by alan_sh
OK. I loaded my file into notepad and saved it as a different name. That worked.

Ah - I know what it is. The file, although saved as a CSV, was still open in Excel.

Pablo, can you consider changing the import so it will import a file even if it's locked for editing? [Notepad was able to read it OK] or at least put up an error message with some information as to why it failed?

Alan

Re: Import table from CSV?

Posted: Tue Apr 02, 2019 11:12 am
by Pablo
I will investigate if this is possible.

Re: Import table from CSV?

Posted: Tue Apr 02, 2019 11:57 am
by alan_sh
Thank you

Alan

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 6:38 am
by alex4orly
Looks an interesting object, works fine first time, but:

1) I have columns with $values, how can I make them right justified?
2) Is there a way to remove the heading sorting option, all table data needs to be loading as it is in the CSV file

Iused just Notepad, not Excel which add some extra size to the file

Cheers

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 7:43 am
by Pablo
Are you referring to the "Responsive Data Table" extension?
- you can set the alignment in the 'Alignment' property. Each column can have its own alignment.
- The "Responsive Data Table" extension does not have support for sorting headers.

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 10:55 am
by alex4orly
No, I am using the Data Viewer Version 1.5
This Responsive Data Viewer says it is a DEMO and says that setting wil not be saved...
Or do I have an old version? If so, how do I update what I have?

Thanks

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 11:15 am
by alex4orly
OK, I purchased the extension but can't see how to control each column alignment

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 11:28 am
by kibble
alex4orly
In the help (from object properties) under Alignment it explains that you can align each column as you wish.
So in the alignment box in the appearance tab just type what alignment you want (left, right, center) for each column separated by a comma.

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 11:29 am
by Pablo
From the documentation:
Alignment
Specifies the alignment of columns. By default all columns have the same alignment, but you can also configure a different alignment for each column. To do this simple add multiple values separated by a comma: left,right,right,left

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 11:30 am
by alex4orly
I can't install the new extension.
I removed the DEMO I had, unpacked the zip content and when trying to install it it comes up with an error:
The process cannot access the file because it is being used by another process

I do NOT have it in use on any page in the project, so - what should I do now?
I closed WB and restarted it, but no go

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 11:38 am
by alex4orly
Ok, installed it.
Can't figure the alignment, please give an example.
Thanks

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 11:41 am
by Pablo
From the documentation:
Alignment
Specifies the alignment of columns. By default all columns have the same alignment, but you can also configure a different alignment for each column. To do this simple add multiple values separated by a comma: left,right,right,left

Re: Import table from CSV?

Posted: Wed Apr 03, 2019 8:07 pm
by alex4orly
Very good, works just fine.
And, to help the user use Notepad instead of Excel, I called the file .txt instead of .csv and it works fine.

Thanks for your help

Re: Import table from CSV?

Posted: Fri Apr 05, 2019 5:09 am
by alex4orly
Well, it is doing something strange...
The data file is not showing the line brakes and the table flows out of the intended place inside the Layout grid.

Please see this URL : http://www.nmaa-rc.org.au/renewal.jpg

Re: Import table from CSV?

Posted: Fri Apr 05, 2019 6:24 am
by Pablo
A HTML table cannot be smaller then the sum of all columns.
To make the content fit you will have to reduce the number of columns.

Re: Import table from CSV?

Posted: Fri Apr 05, 2019 7:35 am
by alex4orly
Hello again,

The Responsive data object is placed inside a 3 column layout grid, it was set to be 3 columns : 2-8-2
I changed it following your suggestion to be : 1-10-1 , that didn't fix it.
I found out that the problem is this - extra line, once I manually remove it after uploading, it works fine:

Senior,$60.00,$54.00,$110.00,$224.00,$110.00

Pensioner,$60.00,$54.00,$80.00,$194.00,$80.00

Junior,$30.00,$27.00,$20.00,$77.00,$20.00

Non-Flying,,,,$20.00,xxxxxxx

My custom code is irrelevant here, it changes the file name, but the uploaded file content is the problem, not sure why does it do it

Thanks anyway