Jump to content
We've recently updated our Privacy Statement, available here ×

Concatenate two strings in Jaspersoft


tec_user

Recommended Posts

Hi !! I am a newbie to Jaspersoft. I am trying to concatenate two strings(“2016” and “-01-01”) to get a complete string like “2016-01-01”.

I created two parameters of class String. First parameter named as "year" is prompted from the user and the expression is $P{year}, where the user is expected to enter a year(like 2016, 2015,etc). The expression for the second parameter named as start_date is $P{year}+”-01-01”. When I run the program, it says document is empty without any errors. I tried using concatenate function of string without using + . It still failed. In the query, I used to_date function to convert the string to a date. Can anyone help why this is happening? Thanks in advance

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I tried hard coding the entire string “2016-01-01” and named it  start_date under parameters, it is executing fine without any issues and generates the report. It is not working only when I try to concatenate something like this, $P{year}+”-01-01”.

Link to comment
Share on other sites

  • 3 years later...

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...