thiel.walter Posted November 17, 2015 Share Posted November 17, 2015 Hello together!For you information, this is our framework:Our company want to use Jaspersoft Studio to create formulars like a contract or offer document. The enduser fill up some fields on a webpage and the values will written in the database. Then the printout of the contract or offer document over the webpage use a xml-file. In Jaspersoft Studio we use this xml-File with xPath, too. There we have a Jasper Book and at least two Jasper Reports. We design the formulars on the Jasper Report jrxml-Files and the build japser-files are on the Jasper Book. With a parameter "DataSource" in the Jasper Book we bring togehter later the xml-Values and the Jasper Reports. In the Jasper Book we also controll the order and visibility with the Print When-Expression.My Question:I want use a variable for Print When in the Jasper Book. So I have created a variable "Fehlerseite" in the Jasper Book.Because I tested the expression "$F{AS1_STAMM.ANREDE_ID}==0 && $F{KLK.VRR}!=0 && $F{AS2_STAMM.NAME}==null" within a Text Field on a Jasper Report, I know that I get a boolean value "true".But when I use the expression $V{Fehlerseite} in Print When for one page of the Jasper Book, I get the result "Document is Empty".I don't understand this. When I use the complete expression in Print When then it works. But I don't want to use the full expression every time.I hope you can help me.Thank you Walter Link to comment Share on other sites More sharing options...
Tiaguinho Posted November 17, 2015 Share Posted November 17, 2015 Try this:In the "Initial Value Expression" use$F{AS1_STAMM.ANREDE_ID}==0 && $F{KLK.VRR}!=0 && $F{AS2_STAMM.NAME}==null ? true : false When use expression, she test the expression, but not have return value, she is a simple test. If you want a return, must place the returns in the expression.Then use your $V{variable} Link to comment Share on other sites More sharing options...
thiel.walter Posted November 18, 2015 Author Share Posted November 18, 2015 Good morning tiago,it doesn't work. It set the values true and false in quotes.$F{AS1_STAMM.ANREDE_ID}==0 && $F{KLK.VRR}!=0 && $F{AS2_STAMM.NAME}==null ? "true" : "false"And think it works, but I forget to replace the value "true" out off the print when field :-/Why it works with the expression in the print when field or when I use only the value "true" in the print when field, but doesn't work when I set the variable $V{Fehlerseite}?Walter Link to comment Share on other sites More sharing options...
Tiaguinho Posted December 8, 2015 Share Posted December 8, 2015 If you use "true", we must test the variable like a string. And not as boolean.Maybe it is that. 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