Skip to Content
Former Member
Jun 09, 2016 at 06:43 PM

ireport: "SQLServerException: An object or column name is missing or empty. For SELECT INTO ..."


  • ireport 5.6.0 (have also tried version 4.0.4, because that's the version of the jasperreports jar I see in my hybris installation, but I had issues trying to get the MS-SQLServer driver set up in it);

  • hybris;

  • SQLServer 2012 running in VMWare Fusion (because on a Mac but need to implement report-queries involving date-functions, which are database-specific, and the project uses SQLServer)

  • on a Mac running El Capitain (10.11.2)

  • within ireport, create a new jrxml-file

  • therein create a table using even a simple query such as "select {name} from {customer}"

  • upon selecting the fields from the query to be used in the table, I get the following error in hybris' log:

  • "[ReflectiveCommand] Unexpected invocation target exception: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name."

  • note that my query is not a "SELECT INTO" query

  • the query works in the hac (so does my compex group-by query, which causes the same error in ireport)

  • it actually worked previously and somehow seems to still work in a previous jrxml-file; so, I suspected a jrxml format-issue

  • I've experimented with the "Compatibility" option in ireport, though I did that in order to deal with the "uuid" output-format issue I'd encountered; I don't know if that could somehow be relevant; I did meanwhile notice that changing that output-format version did not remove the offending "uuid" attributes that hybris's reportcockpit isn't compatible with; I removed them with a regex-replace instead.

  • back before I first saw this error, I wasn't seeing results, though the hac showed such; then, I found a property one needs to set at the top-level "when no results" (or the like"); otherwise, processing seems to get short-circuited; so, I set that as directed and did see the expected result; a few days later, upon re-starting ireport to revise that report, I first saw this SQLServerException