Question

I have the following problem: I have a data table that is fed by data from a SQL query. The query works just fine, but not all the data is displayed. I deleted one of the columns before and no wanted to readd it, but it does not show.

Is there a way to get this to work?

Basically, I have those columns:

Name, First name, birthday, gender

Now I deleted gender:

Name, First name, birthday

After a while, I wanted to readd gender, but the data table shows the following:

Name, first name, birthday

It does work, if I change the column name from gender to sex in the SQL query, but that is not a solution I can live with. If I change the name, then rename the column header, on the next refresh, the name is reinstated. If I rename the column header, then change the column name in the SQL query, the column disappears on the next refresh.

Anyone with a solution?

Was it helpful?

Solution

I'm guessing you have Preserve column/sort/filter/layout checked in the External Data Properties dialog (right-click> Table> External Data Properties). Try unchecking it, refreshing, and then checking it again. Save first!

OTHER TIPS

I had the same issue, and finally found an easy solution for adding columns. Click on the table, then Query>Edit>Advanced Editor (under the home tab).

You should see the source code for the query. In the first line of code, you will see Columns= (followed by your number of columns).

You need to change this number to reflect the correct number of columns in the new CSV file. I originally had 17 columns. I added two data columns, so I changed this number to 19.

Close the editor and refresh, and you should be all set.

For anyone who needs it: I did not find how to follow method described by Sullivan
I found different one. It needs editing XML in the unzipped XLSX file.
1. Add column to your table and rename it to column name you want to restore
2. Open in the notepad queryTable xml file extracted from XLSX (you have to find proper one)
3. Open (in notepad or IE) proper Table[#].xml with your table, find by name and remember ID of your column as your column ID
4. Find tag with name of column you need to restore and remove this tag. 5. Find column with text ' tableColumnId="[your column ID]" '
6. Add atrybute 'name = "[column name]"' and delete atribute 'dataBound="0"'.
7. save querytable[#].xml zip all folders to one file , rename to xlsx (never zip one folder that contains all, you need to select all objects and zip).

[#] of querytable is not always the same as # of table.
Relation is described in xl\tables_rels\table[#].xml.rels

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top