Issue 110190 - Column headings used in report writer instead of column names
Summary: Column headings used in report writer instead of column names
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOO320m12
Hardware: Unknown Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2010-03-17 12:45 UTC by ianst
Modified: 2013-01-29 21:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description ianst 2010-03-17 12:45:33 UTC
This issues also occurs in OOo 3.3 DEV300m75 build 9488

In OOBase table column definitios definitions
Comment 1 ianst 2010-03-17 12:59:05 UTC
Oops, sorry dropped keyboard before completing issue

Using JDBC to connect to database

When using report writer the SQL that is generated uses the column
descriptions/column heading instead of the column names.  This results in a
query that cannot be executed

This also occurs in the Sun report writer extension


Column ACC_NAME in table CBCHEQUES defined with description SOURCE_NAME.  When
SQL is generated uses SOURCE_NAME instead of ACC_NAME



Comment 2 r4zoli 2010-03-19 09:18:36 UTC
Please follow general

Provide more details and if you can, upload example file.

And give JDBC driver and back-end database information.

It will help to reproduce/check/confirm the issue.
Comment 3 ianst 2010-03-19 16:00:07 UTC
The problem seems to be slightly different in DEV300m75 - I will do more testing
in this regard.

For completeness below is documented a more detailed ( I hope) description of
the problem.

The driver is IBM's JDBC driver for UniVerse - many thanks again to Frank
Schonheit for helping to resolve some of the issues with this driver.

To explain what is happening I'll compare what happens when a "standard" query
created in Query Design is run versus what happens when generating a report via
the report wizard.

Query in Design View

When using "normal" query builder the SQL that is generated refers to the column
names provided by the database.  When the data is loaded into a spreadsheet or
datasource window the column headings are replaced by the column labels stored
in the dictionary of the table - this is all good because cryptic table column
names are replaced by the more meaningful labels.

For example - the following query runs just fine

The column labels for columns FM_M1_TY,  FM_M2_TY , FM_M3_TY etc are October,
November, December etc.  The column names are replaced in the result by these
labels.  The labels are derived from the metadata provided by the database schema.

However when creating a report using the report wizard and basing the report on
an existing query the available fields in the query are shown using the label
names (instead of FM_M1_TY October is shown).  This in itself is not a problem
if the SQL that is generated and executed later referred to the column names.

Then,  when you are presented with the dialog where you can define the labels
for the columns, the label (eg October) is shown and not the column name - still
not a problem and makes sense to use the column label instead of the column name.

Further dialog (eg grouping, sorting ) also refer to the column label instead of
the column name - makes sense to me so far.

However when executing the report the SQL is generated using the column labels i.e 
SELECT "ACC", "FM_DESCRIPTION", "October", "November", "December",  FROM "COAM"
which results in an error from the database when trying to execute the query as
there are no columns named October, November, December

Hope this makes sense.