Apache OpenOffice (AOO) Bugzilla – Issue 110190
Column headings used in report writer instead of column names
Last modified: 2013-01-29 21:47:38 UTC
This issues also occurs in OOo 3.3 DEV300m75 build 9488 In OOBase table column definitios definitions
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 EG Column ACC_NAME in table CBCHEQUES defined with description SOURCE_NAME. When SQL is generated uses SOURCE_NAME instead of ACC_NAME SELECT SOURCE_NAME FROM CBCHEQUES should be SELECT ACC_NAME FROM CBCHEQUES Rgds Ian
Please follow general rules:http://qa.openoffice.org/ooQAReloaded/Docs/QA-Reloaded-BasicRules.html 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.
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 SELECT "ACC", "FM_DESCRIPTION", "FM_M1_TY", "FM_M2_TY", "FM_M2_TY", "FM_M3_TY", FROM "COAM" 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. Rgds Ian