Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Think of parameters as things that the end user supplies to the report at runtime. For example, you supply a StartDate and an EndDate that will get used in a query. The start date that you are interested in is something you know, it's not provided by the data source. (There are variations on this idea: maybe your application knows things about you based on your login, and it supplies these as parameters. But again, these are things known before the report is executed.)</p> <p>Think of the fields as the data that comes back from your data source. This is the stuff that you want to learn. For example, you run a query like this: </p> <p><code>select political_group, gullibility from mytable where the_date &gt; $P{StartDate}</code></p> <p>Presumably you would input a value of '802701' for the StartDate and then get results like this:</p> <pre><code>$F{political_group} $F{gullibility} Eloi 75 Morlock 25 </code></pre> <p>Think of variables as a way to manipulate this raw data. They can calculate totals and subtotals as well as line-by-line calculations like string manipulation or more complex things like running totals.</p> <p>Take a look at this pie chart report I posted a couple of years ago: <a href="http://mdahlman.wordpress.com/2009/05/02/limiting-pie-pieces/" rel="nofollow">http://mdahlman.wordpress.com/2009/05/02/limiting-pie-pieces/</a></p> <p>It has the main ideas you want. I put the title directly into the chart rather than as a separate field. That would be a very simple change. Likewise, you could change the title to "The author of this report is: $P{TheAuthor}" and then pass that param to the report at runtime.</p> <p>Using a field in the report title rather than a parameter is possible also. But typically it doesn't make sense. The fields will have many values in the data set. Which one belongs in the title? In the case above "Eloi" and "Morlock" are fields, and they really don't make sense in the report title. (You can imagine special cases, of course. You could concatenate all of the political_group values into a single string and put that in the report title. But in an overwhelming majority of cases this won't be reasonable.)</p> <p>Good luck.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload