tec_user Posted February 24, 2016 Share Posted February 24, 2016 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 More sharing options...
hozawa Posted February 24, 2016 Share Posted February 24, 2016 Try executing your report without using any parameter by hard coding the value to see if that'll work. If you still don't get your report, it's a problem with your data. Link to comment Share on other sites More sharing options...
tec_user Posted February 25, 2016 Author Share Posted February 25, 2016 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 More sharing options...
szaharia Posted March 1, 2016 Share Posted March 1, 2016 Hi,If possible, please post your JRXML sample here. Thanks,Sanda Link to comment Share on other sites More sharing options...
tec_user Posted March 3, 2016 Author Share Posted March 3, 2016 <?xml version="1.0" encoding="UTF-8"?> Link to comment Share on other sites More sharing options...
tony.dunlop Posted August 16, 2019 Share Posted August 16, 2019 you might have to convert the param to a string first depending on what type your year param is. Like this :$P{year}.toString()+”-01-01” Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now