iReports: Creating charts using crosstab "total variables"? - charts

Is it possible to use variables ,that are defined in crosstab like total measure variables etc
in the formation of charts in iReports...
Like I need chart of percentage of certain measure which in crosstab I calculated using total variable. How to do that ??

As per my understanding for reporting with iReports, it is not possible to use those variables that are defined in the crosstab in charts. Crosstab is a seperated component from charts. All the variable that are defined in the crosstab are defined in the scope of the Crosstab only.
For this fix I have to modify by query. Now they are somewhat complex I have used Common table expressions http://msdn.microsoft.com/en-us/library/ms190766(v=sql.105).aspx to get all the desired fields in my query only and used them directly in the iReports charts.
Hope this helps..

Related

Crosstab with additional column

My report needs a normal cross-tab section, but with an additional pre-computed column (It's the average of all the non-zero weeks of activity, so a normal cross-tab average will not work). This is a column that is supplied in my dataset.
How can I get it to look like this?
Have you considered adding a SQL Command to your report in the Database Expert?
If you perform the pre-calculations in SQL and pass the results in as a Command table, you can use the calculations like regular table fields. These can be used in a Crosstab like normal fields.

Cognos Crosstab Report Calculated Column Totalling Incorrectly

I have a report in Cognos 10.1.1 that is pulling Profit, Pounds, and Profit/Lbs. Each query has a field 'Measure Unit' that is labeled as 'Spread $', 'Spread Lbs' or 'Spread $/Lb'. It joins these three queries via a union and then loads them into a Crosstab list. The individual queries work correctly, and when dumped into a List Report are fine, but for some reason when in the crosstab report, the calculated profit/lbs column is always wrong. How can I get the calculated column to total correctly in the crosstab?
Three queries pull seperate Measure Units and measures for Profit, Lbs and Profit/Lbs.
The calculation for Profit.
The Calcuation for Profit/Lbs
Properties for the measure fields.
What the report looks like. Middle column should equal Spread $ / Spread Lbs, but does not when in crosstab.
Try to customize Solve Order for your calculations.
Default behavior is Total(Value1/Value2). You need to archive Total(Value1)/Total(Value2)
(Don't change your formulas, just set Solve Order for calculations)

How to pass values from datasets back to main report?

Problem:
I have composite JRXML report. Composite report contains many charts. Each chart is assigned to some dataset. I need to pass the variables/parameters values back to main report from datasets?
Tried:
I tried scriptlets, customizers but they are all scoped to the dataset to which they are assigned and cannot see or change the parameters of the main report.
Global scriptlets do not have knowledge about dataset parameters(to be precise they do not know their values and they can't assign their values, they only can find out their description and names via usage of JASPER_REPORT parameter which has mainly lookup functionallity).
This poses a fundamental problem for me as I can't aggregate values in one place as I can't extract them from each individual dataset.
Context problem:
The reason I need to do this because Jasper reports design is flawed for one fundamental requirement: "consistent colours" across all the charts in the composite report. So if you have "China" in Pie Chart and it has colour GREEN and you also have Bar Chart having different query but returning some values which exist in Pie Chart - you'd want the China to have GREEN colour in Bar Chart too.
Approach to context problem:
For this task you need to exctract all the field values from each dataset and save them in main report parameter. You then have to assign each value to some color value and check aggregate main report parameter inside customizers whether current value has a color assigned. This is at least my plan. For this task I need to be able to get back data from datasets generated by their local queries. But I am limited by the scope of datasets as they work only on input data not output data.

Adding grand totals to chart birt

I have a BIRT crosstab report with a grand total column. I created a chart based on that report. But in the chart wizard, the grand total column is not available to add as either an axes or an optional grouping. In fact, it doesn't display at all.
I want a pie chart that uses the grand total. I even thought that maybe I could sum the data in the wizard with a BIRT function, that didn't work either.
Here's the scenario: I have an aggregated data element, E, that contains multiple values.
So, for example, count(E1) = 10, E2 = 32, etc.
I want a grand total of all the elements so that I can create a pie chart that displays each data element count as part of the total count.
I don't see a mechanism to accomplish this. I'm new to BIRT so it's very possible that I'm overlooking something basic. Any help is appreciated. Please ask if you need more information.
Regards,
Mike.
If you created the chart from the crosstab (right-click the crosstab->create chart view), then all databindings are made available in the chart, including the grand total.
However generally these bindings don't have a very explicit name, it is tricky to recognize them when designing expressions in the chart.
In the crosstab view if we double-click the grand total, its data-binding name is displayed (greyed out) at the top of the dialog. Use this in your chart expressions.

How to make the following report using Jasper Reports

I collect test results between different locations. I can never predict the amount of locations that I should generate the report for and I need to make a dashboard representing these results. The dashboard should look like this (Assume a tabular structure):
Title
Report info 1|Report info 2
Conditionally displayed report (info 3) spanning the whole table columns
Report info 4|Report info 5
Blank Cell|Location A|Location B...etc
Location X|X-A result|X-B result...etc
Location Y|Y-A result|Y-B resutl...etc
.
.
etc
I've read A LOT and after a lot of reading I still don't think I can start making a JR report !
Although, after a while of chasing the solution of doing so using tables, I found that I should use crosstabs instead because tables aren't dynamic enough (i.e. since I can't predict the amount of rows\columns that will need to be displayed). But then after reading the crosstabs section I found that it's purpose is to summarize results, like calculate totals, averages, minimum and maximum..etc and still, that's not what I need. I'll have to provide all the results locations on the x\y axis and their results, no SQL will be involved.
Also what data structure would be suitable for that ? A datasource ? A java collection\object passed as a parameter ?
Any idea how can I do that with JR ?
Also a I'm finding JR VERY confusing and complicated. I was very happy to read the freely available ultimate guide and check the demos but that didn't help much, it still looks very complicated !
Thanks in advance.
if you cannot predict the amount of columns, crosstabs are the elements you have to choose. But be aware, that the width of a Jasperreport is static (and like this possibly not optimal for your purposes).
A crosstab will summarize your data only, if you have a column or row label twice, and only if the data is not sorted by the crosstab itself or by your datasource.
According to your description, I would use a report layout like
Title-Band: Title, Infos etc
Summary: Crosstab
You could pass the static title content as parameters into your report, the crosstab content as a datasource (e.g. a bean collection)