Jasper report creating multipe-tables from JRBeanCollectionDataSource groupe by field - java

In the first screen (capture1)enter image description here i have my first table which i want to split to multipe tables as shown in (capture2) enter image description here
what i want to do is to split the table 1 to multipe tables grouped by date , i m getting the data from java not from sql
i tried to use groupe band and i couldnt use it in a good way to solve my problem

Related

Getting data from a csv file to a sqlplus table -> getting this data from sqlplus table to html table skeleton

I am a newbie in programming, so please excuse me if some of the stuff I say sounds stupid or not to the point. I am trying to explain what I have to do as best as I understand. I am looking forward to having guidance from all, and hope it solves my problem.
So the steps which I believe I have to undertake is as follows:
I have a CSV file and I have to load data from CSV file into the SQLPLUS table. The file has 17 columns. Now here comes the tricky part, there is one column which has values which correspond to my column number 2 in different rows. For examples, lets say the cell first row of second column is "FRUIT" and the FIRST SECOND and THIRD row of the 14th column are APPLE, MANGO and ORANGE. all three correspond to the fruit so must be shown in the same row when displaying in the html table.
I want to know, how should I configure my control file so that the apple mangoes and oranges must come in the same row as fruits.
I dont want it just for the display purpose because after this is done, I have to retrieve info from the the (apple orange mango column) for the current row and display it as 3 radio buttons.
I am not sure how well I explained it. But please if anyone has any idea please let me know.
This is a sample table:
double quotes mean one row. so its basically fruits then null below and null below.
"|FRUITS|APPLES|"
"| NULL |ORANGES|"
"| NULL |MANGOES|"
What I want to implement is:
|FRUITS|APPLES,ORANGES,MANGOES(displayed one below the other)|
then take the information from the cell in which apples oranges and mangoes are displayed and display it as dropdown selector.
THANKS>.
What I have tried is uploading the csv through sqloader using the str x0d . It displays the fruits in the same row as fruit, however when I am getting the data from the current cell, I cannot extract apples oranges and mangoes separately.
What I believe is I have to introduce some delimiter and then segregate based on that delimiter.

How to get the top 10 value in BIRT

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.

how to fetch tables from database of mysql in JtextArea with checkbox in swing

Actually I want fetch tables and display like following image
.
Can you help me?
Steps:
Run a query on your database to retrieve the tables and their meta data.
Store the results in suitable objects and pass them to your front end
Use JXTreeTable from SwingX but customize the Renderer and Editor for it to display and allow users to interact with the check boxes.
Realize this is a complex GUI component you are creating so don't try it all in one shot, get the JXTreeTable working with your data, then try to add in the check boxes.

Droplist in Excel using Poi

How can I create a drop list in excel like drop list in html with the inbuilt "value" like attribute?
My Requirement is: I want to show the description which is not stored in database, but the code for description.
Ex: I have a subject list in an excel cell, for Science the description is "Science", but I want to store the code "SCI" in the Database.
You could use an ActiveX ComboBox in a worksheet, available from the Developers tab.
Enter both columns of data into the worksheet - you can hide the columns. Then set properties of the combobox:
ColumnCount 2
BoundColumn 1
ColumnWidths 0 pt; 20 pt
Set the ListFillRange and LinkedCell.
I understand there used to be issues with distributing workbooks containing ActiveX controls. I am not sure if this is still an issue, particularly when used a common (standard) control.
Of course, Excel is not designed to be a front-end to a database, so you'll need to write all the code to keep everything in-sync.
You could use the simpler Form Control/ComboBox. This will only store the index number in a cell - it does not have any events that you can use. You could use a formula based on the linked cell, that stores the description in another cell. When the user (presumably) clicks a button to submit the data, you would retrieve and store the description from this cell.
Hmm I can see many placeholder occurs all around the web related to java poi... but it seems there is no solution for your question. The only way I found to manage this is to set the cell value with my default text - the first value!

Binding database column to java jComboBox and JList

Ok, say I have a database table with two columns - one "Name", the other "Age", and there are over 40 names and their respective ages in the table. I want these names to be listed out in a jList/jComboBox, and also I want to be able to click on a name in the jList/jComboBox and have its respective age appear in - say - a text box. Do I have to go about this by simply writing a code that selects all the names from the table and populates the jList/jComboBox and then another code that takes the selected name, puts it in an sql statement, finds the matching age and sends it to a text box, OR is there some kind of a VB-esque column-to-comboBox/List-binding that I can utilise to go about this?
For only 40 name-age combinations, I would just query the database once, and store this information in a Map. Then you can just query the map when a name is selected, and update the age textfield. This will go a lot faster then running SQL queries each time the selection has been changed.
You have to set Model for your swing elements and for updating data based on changes at one place to other implement Listeners.
Have a look at this
Binding comboboxes in swing
Create a custom object that stores both the name and age values and add this object to the combobox. Then when you select an item you have access to both values.
For example: How to use Map element as text of a JComboBox

Categories