Use a variable calculated average of a specific field in the Title band - jasper-reports

I have a variable which stores the calculated average of a specific field.
Is there any way to use this variable in the Title band? When I try to do it, I just get null in the Title but the correct value in the Column Footer.
The only other possibility for this I see is, to precalculate it in Java and pass it as an argument, but I'm trying to avoid that.
I'm using JasperReports and iReport in version 3.7.4.

The Variable and the Text Field both have the property Evaluation Time. Set it to Report for both and it works.
Also look at http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=67697

Related

Show all parameter values

My parameter field allows multiple values. How can I show all of these values at the top of the report? Currently it only shows one value at a time.
If your parameter is dynamic and takes the form of an array, you'll need to join the values together via a Formula:
Join ({?Parameter},", ")
Activate the Can Grow property for that field. Put this field in a new section so it can easily grow based on your content.

Crystal Report 2013 get most frequent value

I've a crystal report with a data set of values like.
{1,2,3,3,3,3,4,5}
I need to get the most frequent value in the set which is (3)
how to perform this??
In the Numeric Summary Calculation Options (you can use it in a Formula Field) you can use MODE
MODE that is the most frequentl used value in the field

SSRS Aggreation on Calculated Field

I am trying to perform an aggregation on a calculated Field in SSRS and am getting the following error:
[rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox43.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers
This is the formula I tried to use:
=Sum(ReportItems!PlanPurchPrice.Value, "Select_UCPUtilization")
In this Case PlanPurcPrice is also an Expression:
=First(Fields!PawPlanPurchPrice.Value, "Select_UCPUtilization")
Any suggestions on this would be greatly appreciated.
SSRS 2008 does not support the functionality you are looking for unless the report item is located in the header or footer (as is stated in the error message). I would, instead, propose two alternate solutions:
First Option
Place the calculation in your query (if possible) at which point you can then reference the field and the aggregate will work as desired.
Second Option
You essentially want to create the aggregate you're looking to return elsewhere in the report where it is directly connected to the Select_UCPUtilization scope, then reference the aggregated value elsewhere. Follow these steps:
Within the same scope as report item PlanPurchPrice, calculate a sum of the PlanPurchPrice. Name the textbox containing the aggregate something meaningful (e.g., Sum_PlanPurchPrice).
Reference that textbox directly wherever you were trying to use the ReportItems sum before (i.e., =ReportItems!Sum_PlanPurchPrice.Value)
Hide the workaround. Place the aggregate you created in an additional column or row attached to the Select_UCPUtilization scope. Turn the text white, turn off growth and shrinkage, and make the row very tiny (a pixel or two high).
Using the second option, the report item does exist (and is visible, which is important) on the report and contains the sum you are looking to return elsewhere.
Hope this helps. if this doesn't make sense, please reply via comment and I'll help you to the best of my ability.

Updating a variable whith a value returned by a subreport

I have a main report which loop over query's data on detail1 band.
In this main report I call a subreport which takes an integer in input parameter and returns a string in result (it does not display anything actually).
If I want to use this subreport once, it works and the returned value is affected to a variable that I can display in my main report.
But I can't make it works when I have to updates the variable in each iteration of detail1. In this case it displays null, or the result of the previous calculation.
I guess it's all about reset type and reset group but I'm really stuck here :(
PS : I'm using jasperserver 3.3.x
The returned variable is only available when the whole band is "printed". Try placing the variable in a text field in the same band as the subreport (detail1) with an evaluation time of 'Band'.
Also if the subreport isn't actually displaying anything you may be able to do what you want with a scriptlet instead.

Crystal Report - Placing decimal point

I'm getting an integer value as 2345 but I want to display it as 234.5
is it possible??
To get what you are looking for in a simple fix is like what kingpin stated above. Divide the value by ten. To do this just create a new formula in crystal by going into your field explorer and right clicking on the formula fields section. Under there should be a option to create a new formula. Then in window that comes up put the field you want to manipulate in the formula and then divide that by ten. And there you go. Now use the formula field in the report instead of the original field.
Here is a example of how it could look.
{Table_Foo.value_Bar} / 10
There is a field property for it. Don't have access to crystal reports at the moment, but I know it's there:
Crystal Report Provides an easy to use default thousand separator for numeric Fields. You can use it by checking Thousand Separator from Field Properties.
If you need a customized separator, check Customized Thousand Separator in Crystal Report.
You also might want to find some tutorials on the Crystal Reports themselves if you still have trouble.