buyak Posted January 26, 2010 Share Posted January 26, 2010 Hi all,I'm making a report that can pull info from one company or multiple companies. I want the company name to display in the Title band if they type in one company in the Parameters prompt... this i can do. I just pull the $P{Customer} unto the page. When they enter the wildcard % into the prompt, it pulls all companies, however, only the percentage sign will show.I don't know how to tell iReport how to Print "All Companies" IF % is used in the Customer Prompt just like it prints the Customer's name when they enter the customers info in the prompt.Thanks in advance for anyone that can help. I'm sure it's a real simple fix, but I'm not familiar with java and what the expressions ALL mean and I'm starting to realize I need to be if I want to get the full benefits out of this awesome report designer. Link to comment Share on other sites More sharing options...
mrcaffeine Posted February 22, 2010 Share Posted February 22, 2010 just write a simple expression("%".equals($P{Company})? "All Companies" : $P{Company}) assuming that your parameter is called Company. Be aware that report elements are case sensitive. Link to comment Share on other sites More sharing options...
alvintkl Posted March 5, 2010 Share Posted March 5, 2010 what you mean by "All companies" in the expression ("%".equals($P{Company})? "All Companies" : $P{Company})can give more detail Link to comment Share on other sites More sharing options...
mrcaffeine Posted March 5, 2010 Share Posted March 5, 2010 it is a static string you set instead of a variable. 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