subdataset / SQL query

Hi,

I want to build a crosstable with a subdataset but I've a problem with the sql query :

Code:
SELECT VED_complet,YEAR(VED_crea_date) as VED_annee<br />
FROM VED_vedette</td></tr></tbody></table><br />
<br />
The problem comes from YEAR(VED_crea_date) as VED_annee<br />
<br />
When I execute the report, I have the following error :<br />
<br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>org.springframework.webflow.ActionExecutionException: Exception thrown executing [AnnotatedAction@141e072 targetAction = com.jaspersoft.jasperserver.war.action.ViewReportAction@1f680ea, attributes = map[[empty]]] in state 'verifyData' of flow 'viewReportFlow'; nested exception is com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: Unknown column name : VED_annee</td></tr></tbody></table><br />
<br />
I think that Jasper doesn't support the keyword "AS" but I don't know to do without<br />
<br />
Can anyone help me ?<br />
<br />
Thanks
babarincairo's picture
Joined: Sep 10 2006 - 11:59pm
Last seen: 16 years 9 months ago

3 Answers:

What database and JDBC driver (incl version) are you using?

Regards,
Lucian
lucianc's picture
76962
Joined: Jul 17 2006 - 1:10am
Last seen: 2 hours 55 min ago
I use :

- MySQL 5.0.21
- JDBC 5.0.3
babarincairo's picture
Joined: Sep 10 2006 - 11:59pm
Last seen: 16 years 9 months ago
There are a couple of bugs ([url=http://jasperforge.org/sf/go/artf1368?nav=1]artf1368 and [url=http://jasperforge.org/sf/go/artf1545?nav=1]artf1545) related to this. There is not fix yet.

MySQL JDBC connector 5.0 breaks backward compatibility by [url=http://dev.mysql.com/doc/refman/5.0/en/cj-news-5-0-0.html]changing the semantics of the ResultSetMetaData.getColumnName() method. According to this [url=http://bugs.mysql.com/bug.php?id=20372]bug report, the 5.0.4 connector will feature a compatibility flag (useOldAliasMetadataBehavior) so that applications which used to work with the 3.1 connector work with the 5.0 connector as well.

Regards,
Lucian
lucianc's picture
76962
Joined: Jul 17 2006 - 1:10am
Last seen: 2 hours 55 min ago
Feedback
randomness