Jump to content
JasperReports Library 7.0 is now available ×

Field Name Question


confutatis

Recommended Posts

Hello to all,

I've been working to convert some personal finance reports from an old NextReports 9.0 report writer using SQLITE to Jaspersoft Studio reports.  I've been noticing that when one of my query's field names is identified using an alias table, such as in the following example (not complete code, just paraphrasing):

     select
          tb_collect.payee
    from
        (select * from payee_master) tb_collect 

The field name will not display when rendered by Jaspersoft Server, but will display in Jaspersoft Studio.  To correct the issue up to this point, I've just been adding as "as" to the field declaration as in "tb_collect.payee as payee".  In a previous post, I mentioned this issue, but I never followed up on a real solution because I found this work around.  Somehow I feel there must be a config setting that might allow JS Server to recognize the field name when declared with a table alias.  Anyone have any idea?  It's not a huge issue, because I simply just add the "as" extension, but it would save me a little time if I didn't have to change all of my queries.

Thanks in advance,

David in OH

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

With subqueries in Jaspersoft Studio Report, the field name in the subquery may not be referenced when running the report on JasperReports Server vs. in Jaspersoft Studio (where it can be referenced). This is due to differences in the way reports are rendered using the Jaspersoft Studio vs. JasperReports Server engines.

There are only two options for the versions available today, either you use the field name aliases as you have been doing or use derived tables or CTEs, which allow you to define field names within your query.
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...