I have a trouble that I need to get the top 10 busiest stations, right now, I have these columns (number of buses, datetime, station name). Now, I can dynamically change the time range based on user's selection. But, the BIRT just show all the stations' name in one chart. How can I get the top 10 stations' name? I tried to add filter in my chart, but after I added it, it only showed one station name. Can anyone help me solve my problem? (In my chart, the X-axis is the station name, and Y-axis is the number of buses)
This is probably because stations data are aggregated on-the-fly in the chart view, whereas the top 10 filter you added is filtering on details rows before aggregation. As far as i know we can't specify that a chart filter should be applied at a group level such as we can do it with a table element.
Therefore you should aggregate data before rendering the chart. There are a couple of ways to do this:
Aggregate data in your dataset (SQL group by, ...)
Aggregate in a hidden birt table element with groups, and base the chart on this table. Notice in this case the top 10 filter has to be defined in the table element
Aggregate using a datacube, and base the chart on this datacube or a crosstab
If you cant't make it work as expected, for this kind of issue you should post a .rptdesign based on "Classic models" database sample.
Related
I have an excel template which has the table and charts already setup, just need to add data. There is a collapsible table (using group row) which has a variable number of rows. Beneath this table are two bar charts at the same vertical level.
After filling the table data the two charts are shifted down so when the table is expanded there is no overlapping between the table and charts.
To enable this the chart properties are set to 'Move but dont size with cells'. This works but when any columns or rows are resized the two charts start to move. This can be fixed by using the 'Dont move or size with cells' option.
I have tried the below code but am getting NPE with the following code. The getGraphicFrame() returns null.
dbSheet.getDrawingPatriarch().getCharts().get(0).getGraphicFrame().getAnchor().setAnchorType(AnchorType.DONT_MOVE_AND_RESIZE);
Can someone advise how this can be done? Thanks.
I am trying to display the no of players and best players statistics in a country for specific games in a report
Need to modify the cross tab to show only statistics of the football.How to hide the cross tab column when name of the game(column) is "cricket".
I don't want to achieve this using filters in data sets or by adding condition in where clause of the query.
I have a strange problem with Jasper Reports`iReport:
I have to use Version 3.7.6 and in this version I have to create a dynamic table.
The user is able to define how many columns the table will have and I am calculating this table in the Java - Backend before report initialization and present it to the user. I am not using the table component for this but instead a List of Textfields:
The Java Representation looks like this (very simple):
List<List<String>>
What I am doing is to take a list component that is using subreports to print the contents of the many strings into the report. The List component is printing columns of text fields next to each other (Print Order Horizontal). The subreport consists of nothing but a textfield. This textfield is printed over and over for every column and in the end I have a nice table.
This works very well.
What doesn´t work is when I try to make the text field in the subreport wider.
When it has the standard size of 53px the table looks very well.
When I increase the size I notice that the textfield itself gets wider but the list component still thinks the next column should be 53px. So the text fields overlap each other because the list component refuses to increase its size.
Is there any way to tell the list component to increase its column size when printing horizontal ?
Ok, here is the answer:
The size of the columns for the list component is derived from the columnWidth property of the report. When I change this I can create wider textfields ...
I have to build a page within a java application containing 4 tables (we've chose to use javaFX to use, therefore we're using TableView tables)
There is a problem though. Using multiple tables on 1 pane doesnt seem succesfull. Here you can see the result: http://i.imgur.com/lmPB6Ih.png?1 (I cannot post images yet..)
As you can see it only shows 1 player (a goalkeeper) instead of all the desired players. Whenever i disable all tables but one it shows the desired information.
You can find my code via this link: http://pastebin.com/5AAchCKh
You can't reuse the TableColumn objects.
This fails:
tableTeamField.getColumns().addAll(name,position,age,worth,shooting,...);
tableSelectionField.getColumns().addAll(name,position,age,worth,shooting,...);
When the data is applied to the tables, only the data from the last table is shown in all of them. Basically, you are applying to the sane column different values: only the last one will be visible.
So you need to create different TableColumns for each TableView. This will work:
tableTeamField.getColumns().addAll(name1,position1,age1,worth1,shooting1,...);
tableSelectionField.getColumns().addAll(name2,position2,age2,worth2,shooting2,...);
Is anyone familiar with the graphs and charts availability in javaFX?
I know how to create a bar graph but I have some doubts..
I'm creating a bar graph with the tutorial provided by Oracle, but it is taking the values on y-axis that are provided in the program itself. So every time you run it, it'll display a graph with the same set of values.
But what I want is the graph should be able to read the values from a table in Ms access and then display the graph according to the values from table ,so that every time I run it, it'll be showing the values currently in the database.
Is it possible?
Please let me know if there's a way of achieving this. There must be a way else what's the point of having these graphs and charts in javaFX if they're only going to take static values.
Please let me know..
Thanks..
Scenario
I have a table in ms access with 2 columns "blood group" and "no.of units".
see now the no of units in a blood bank keeps varying when a patient reuires some units of a blood group or when a hospital adds up units to it's blood bank.
so what i want is that graph should be able to read the "no.of units " from the table and display the level of each blood group accordingly.so even when the column "no of units" gets modified due to certain operation when i click on a button it should be able to display the graph with the current values of each blood group from the table..
Now can you tell how should i do it ??
Thanks.
You must have used the following site to go through the documentation on BARCHART IN JAVAFX
http://docs.oracle.com/javafx/2/charts/bar-chart.htm
Over here, when we are filling series1, using series1.getData().add(), instead of passing hardcoded values, you can pass the values that you have fetched from the database.
You can do the same thing for series2, series3.. As many series as you want to make ! Hope things are clear for you, or feel free to comment ! :)
-AA