Home
Analytics
Problem using alias names in SQL query
hacki77
Hello,
my workmate and me have got a problem using alias names in SQL queries.
We are both using birt-rcp-report-designer-2_3_1 on win xp systems.
If I design a report with alias names in the sql query of my data set this alias names are shown at output columns in the Edit Data Set dialogue as Alias and Display Name. In the preview all works fine on my local system.
But when my workmate opens this reportdesign file on his PC all Alias and Display Names are removed in the Output Columns view, some of the Names get a number at the end and the report doesn't work neither in his preview nor on the web server.
If he manually copies all the Names into the Alias field then it works.
Does anybody know the reason for this behaviour? How could this issue been solved?
Thanks in advance, hacki77
Find more posts tagged with
Comments
mwilliams
Hi hacki77,
Are you able to reproduce this problem with the sample database? This way I can test if I have the same problem when trying to open a report that you created.
hacki77
hello Michael,
finally I have managed to install the sample database!
I have tested this again. The problem seems to be a bit different from what I wrote first. The issue is that if you edit the SQL query of an existing report, all of the formerly set Alias Names are removed in the Output Columns view.
This is also the case with the simpe report I designed with the sample database.
I attach it so you can try it out yourself.
When you go to Data Sets -> Cars -> Edit you can look at the Alias Names in Output Columns which I have set manually.
If you make any changes in the SQL query and then switch to the Output Columns view the Alias Names will be removed.
If you have any idea to solve this issue it would be great to let me know!
Thanks and regards, hacki77
mwilliams
hacki77,<br />
<br />
What changes are you needing to make to the query once you have the aliasing done in the dataSet editor? It looks like there is a <a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=254889'>bug</a>
; for at least a very similar issue already reported. It looks like this issue could be changed as early as release 2.5. Are you not able to use the aliasing in the query itself?
hacki77
Hi Michael,
sure i am able to use the aliases in the query. But the problem is that these aliases are not taken over in the data sets within the report. This is only the case if I use a database function to format the value of a specific database column.
For example: ROUND(orders_total.value, 2) AS orders_total__value
In this case the given alias is taken over.
Fixing the bug you posted could possibly solve this issue. But this will apparently take a while.
Regards, hacki77