My database query fetches list of data like:
id key noc date
1 abc 4 1-10-2016
2 abc 12 2-10-2016
3 abc 23 3-10-2016
4 abc 2 4-10-2016
5 def 23 1-10-2016
6 def 44 2-10-2016
7 def 12 3-10-2016
9 def 43 4-10-2016
10 def 43 5-10-2016
abc and def made those no of calls on those dates.
I want to display these data in chart.
But I am fetching this data with a single query, and I want to create 2 charts , one for abc and another for def.
How can I create multiple charts in jaspersoft with single query and making a single chart? As the number of persons making the call can be different , and I will have to create a chart for every person.
When creating or modifying each chart you just need to link them back to the relevant dataset. This can be either the main report dataset or a sub-dataset created just to run the charts.
You only need to follow the instructions on the relevant jaspersoft wiki page and link each new chart back to the required dataset.
Regards,
For getting multiple charts from a single query you need to do :
First create a jasper report, and add a subreport to it. ( Make sure to make the layout growable and the width of the main group should be larger than the subgroup)
Create the dataset
Create Group on right clicking the report from outline panel.
Provide a group name by selecting a column.
Add a expression pointing the column which is grouping the data.
And select reset on group .
Don't forget to set the evaluation time and the evaluation group
For example :
<chart evaluationTime="Group" evaluationGroup="KeywordGroup">
Related
im building a report that has multiple tablix in it and i am grouping each one by name. i want to display each table, grouped by the name so that all of the tables for a particular name are on the same page. for example on the first page of the report i should have something like:
name
address
city
bob
123 main st
los angeles
name
hobbies
age
bob
fishing
44
name
net worth
salary
bob
$2,400,000
$78,000
and then the second page of the report should have something like:
name
hobbies
age
felicia
54 gordon ct
atlanta
name
hobbies
age
felicia
yoga
33
name
net worth
salary
felicia
$750,000
$224,000
where the data for each of these tables comes from either one large query or multiple queries(I've tried it both ways). I have tried multiple approaches to solve this but the one that got me the closest was creating 3 separate subreports (each grouped by name and with page breaks) and putting them all in a main report. When i do this the main report does not respect the page breaks in the subreports and instead puts all of the data for each subreport in a clump like this:
name
address
city
bob
123 main st
los angeles
felicia
54 gordon ct
atlanta
I have also tried creating 3 separate tablixes and putting them one after another with page breaks but the tables dont show up on the same page, so i end up with everything on separate pages
I've tried tinkering with group settings and also tried to use rectangles but get the same output. Can this be done in SSRS?
There are a few ways to do this but my preference would be using a single sub report.
Create a report that takes 'name' as a parameter (e.g. pName). Build the report as normal so it handles just the data that relates to the name parameter, so make sure your dataset query only returns data for the 'pName' provided. Include all three tablixes and whatever else you want.
Test the report and then..
Create another report with a dataset that contains just a distinct list of the names you want to report on.
Add a tablix (table of list) to the report and set it's dataset to be the dataset containing the list of distinct names. This will generate one row per name. Inside the first textbox in the tablix, you need to insert a subreport. Go to the subreport properties, select the report you created at the start of this. In the subreport's parameters section set the pName parameter to the name field of the dataset.
Finally, in the rowgroups panel, go to the rowgroup properties (there will probably only a be a details row group- that's OK) and then set the pagebreak property to 'between each instance'
That should do it.
I want to get the values from the list and show it in a tabular form. I m using sub reports. However, I am able to get the first row values from the list, i can't access the rest of the values.
I am using Ireports version 3.
Here is the Sub report:
The first row matches the Pojo fields. I need to print from second row, the other values from list.
However, The error shows that Cant' retrieve the value from material1....
As suggested in the prevoius comments, you should probably better understand how the detail band works.
The detail band iterates every "row" of your datasource, so unless you did something unconventional in your datasource, you just need a single field for every "column" in your datasource.
Basically, if your data source is something like:
Material Quantity Actual_Cost
AAA 100 5
BBB 200 10
CCC 150 7
DDD 50 8
Having 3 "columns" to show, you need only 3 fields in your detail band.
Running your report, you will get 4 rows (like your datasource should suggest you).
Thanx Fabio.
I solved my problem. It was a mistake at the java end. i didn't iterate through the list and set the values in the Hashmap. I set the values directly in the main report. ;)
First of all: I've read this question but it is not working for me.
What I need:
I have an SQL query that returns a 3 column set with about 50 rows that looks like this:
year | month | number
2012 | 1 | 35
2012 | 2 | 24
2012 | 3 | 127
and so on. Now I need two different representations of this data. The first one is a 2D bar chart and the second one a table with the numbers presented. I managed to do both, but what I'd like to have for the whole report is, to have 3 pages in total.
First page should be a simple cover page with the title of the report, which I can get by simply adding the title band, as far as I've understood. The second page should be the bar chart (filling the whole page) and the third page should be the table (also filling the whole page).
I've tried the following and didn't get the result I need:
Created 2 subreports (1 for bar, 1 for table), added them both in a main report (in the details band) with a page break in between. The result was 2 pages, but the chart and the table filled only half of their page. When I tried to resize the subreports to the full size of the page I got the error message that they're out of range...
Created 1 report with 2 detail bands. Added the chart into the detail band 1 and the table into the detail band 2. This worked for both elements to be the full size of the page, but the whole compiled report now has 100 pages --> 2 pages for one row in my sql set
So how can I accomplish what I need!? Is it even the right tool to use? Or should I simply create two reports, export them as PDFs and combine the PDFs by hand?
My suggestion - in your SQL query, add a fourth column that concatentates your year and month (let's call that year-month). Create a detail band with the following fields: year, month, number. Create a summary band for your chart with year-month as your x-axis and number as your y-axis. Make the title and summary bands the size of your output paper. In iReport, right-click on the name of your report and go to the Properties box for the report. Check the box for "Summary on a new page."
I have the following problem with MS Access:
Suppose I have a list of companies with monthly performance values. I can view the performance of a single company in a chart by hooking the chart into a query with a Month column and a Performance column.
Now suppose I want to display a chart for N companies. I could theoretically do this if I were to generate a query with a Month column and N Performance columns (one for each company). Is there any way to create a query with a variable column count like this? I have a SQL backend that I can use if necessary, and I'm fine with putting together any VBA code necessary to support it. The only impediment I'm seeing is that I'm stuck using MS Access, which I am not very familiar with.
So here are my main questions:
Is this even possible?
How would I go about tackling this issue? I'm trying to minimize research time, so it would be great if I could just get pointed in the right direction.
Thanks!
With this table:
company pmonth performance
1 1 10
2 1 8
3 1 15
1 2 15
2 2 5
3 2 25
1 3 5
2 3 4
3 3 20
I create this query:
SELECT p.company, p.pmonth, p.performance
FROM MonthlyPerformance AS p;
Then change the query to PivotChart View and drag company field to "Drop Series Fields Here", drag pmonth to "Drop Category Fields Here", and drag performance field to "Drop Data Fields Here".
If you prefer, you can create a form using the same query SQL as its data source, then set the form's Default View to PivotChart, and set up the chart the same way as I did for PivotChart view on the query.
If that's not what you want, give us some more information about the type of chart you want and the context in which you will display it.
I have a dataset which has a daily count spanning over several months and I want to create a graph showing the daily counts however I want to have a separate chart for each month. Is this possible to do by isolating each month?
For example if I have
2009/1/1 45
2009/1/2 21
2009/1/3 11
2009/1/4 11
2009/2/1 34
2009/2/2 45
2009/2/3 11
2009/2/4 34
Chart A would filter the dataset so only January's data would be displayed
Chart B would filter the dataset so only Febuary's data would be displayed
Using Chart Expert click the 'Order...' button and set Chart Sort Order to 'specified order' then define the month you want to see. A new tab will appear called 'Others'. Click it and check 'Discard all others'. The chart now only should display data for the specified period.