Align odd and even rows separately in BIRT report - birt

There is a query which brings in more than 100 records and I have mapped row number for each record. There are 2 tables designed in the BIRT layout which is mapped to the same dataset. The output of this report should be such that all the odd row numbers should appear in the LEFT and right row numbers on the RIGHT side. This works for the first few pages however after that the LEFT side remains empty and all of them come to the RIGHT side. Below is the condition used in table Filters,
LEFT Side Table
BirtMath.mod(row["srnbr"],2) Equals 1
RIGHT Side Table
BirtMath.mod(row["srnbr"],2) Equals 0

Add the style from BIRT outline for left alignment ,
add the condition in highlight for data element from properties and apply the style.enter image description here

Related

BIRT Report Designer - Table to Produce Rows in Multi Columns

I have a table, which is listing the name of benefits and it is only 1 column (just name of the benefit).
I'm wondering if there is any native function of BIRT Report Designer to produce rows not only vertically but also populate horizontally to 3-4 columns.
Something like below:
Benefits List
Benefit-1 Benefit-3 Benefit-5
Benefit-2 Benefit-4 Benefit-6
Thanks in advance for any advice.
Ok, I found a solution!
Under the following link there is a Eclipse Community Page Link recommendation about an additional computed column. Even though I don't have any computed column, the recommendation gave me an inspiration. Instead of creating an additional column, I used the rownum that is used generally to bind dataset parameter. For the table row, I created "visibility" condition that checks if the rownum + 1 is divided by 3. Depending on what is the result, it will be hidden or viewed:
Main Grid
It includes a grid with 2 rows and 3 columns. 1 row is merged to view the header. In each column of second row, the same table is placed with the same dataset.
Image Showing Main Structure
Select Table Row
Image Indicating Row Selection
Set the Visibility
Image Showing Details of Visibility Condition
The syntax basically means: "Do not show the row if the division result is not 1".
For the second column, you will need to compare with 2: (row.__rownum + 1) % 3 != 2 and the third column with 0: (row.__rownum + 1) % 3 != 0
Hope it'll be helpful for someone.
An more straightforward approach ist to use a List item instead of a Table item.
In the detail area of the List, create a Grid item of fixed width and height.
Put the content (e.g.) text into the grid's cells.
Important: Set the "display" property of the grid to "inline" instead of the default "block".
This way BIRT will put the grids from left to right until the line is full.
Then it will fill the next line (think of "display: inline" like adding words to a paragraph).

Insert cell in table row eclipse birt

I can't seem to find a way to insert another cell in a row of my table in a Birt report in Eclipse, does anybody know how to do that?
Thank you
Not exactly sure which problem you are having but the solution should either be;
1 Insert a column in the table
Select the table
Right mouse click at top of column and insert a column to left or right
2.Insert a grid into an existing cell, without adding a column. (Usually you do this when you want to have a label and an aggregation in the same header or footer cell)
From the Palette, drag and drop a 'Grid" element into the cell,
set 'number of columns' to 2 and 'number of rows' to 1.
put you other elements (i.e. label and aggregation) into the seperate cells of the grid in the single cell of the table.

Hide some charts and show other in one report

I have a report with 24 charts, one for each hour of the day. The user can choose to show one, a couple, or all the charts, based on a drop down. The drop down is tied to a parameter that allows multiple values. See below:
The problem is that if the user chooses one or a few hours from the drop down, all the charts show, and the one(s) chosen give data while the others say "no data available".
Currently for each chart I've added the following to show data if the value was chosen in the drop down:
=Switch(Parameters!HOURINPUT.Value(0) = "0", false)
Is there a way to hide the charts that the user did not choose from the drop down?
It would look nicer to hide the chart and see only the ones chose than have a blank box that says "no data available" in them.
UPDATE:
More than one parameter.
Assuming that the only differences between the charts are the hour of the day specified, then I suggest:
Add a new dataset to the report with values 0 to 23 as selected in the entered HOURINPUT parameter - something like: with cte as (select 0 n union all select n+1 n from cte where n < 23) select n report_hour from cte where n in (#HOURINPUT)
Add a new tablix to the report, with a single detail cell only, bound to your new dataset.
Move one of the existing graphs into the new table's detail cell so that it becomes a subreport, replacing all hard-coded time references in the graph with references to the report_hour value from the new dataset.
You can then remove the other 23 graphs.
In addition to ensuring that graphs are only displayed for the times selected, this should also simplify future maintenance of the report, since any changes required to a graph will only have to be entered onto the one graph (instead of all 24).

How do I change the orientation of a table in a BIRT report

I need to change the orientation of a table in a BIRT report so that the table header is vertical instead of horizontal.
Is this possible? I don't want to use a Crosstab.
It seems this thread is still being pointed at so I posted an example of a horizontal table layout using a crosstab. I know it won't help the original author but others following this thread now may find this helpful.
To create the horizontal grouping, first create your query like normal, then create a Data Cube. In this data cube, drag each field that you want into a group. Then drag a new crosstab on the report and drag each field into the top right column group area. It will create a new header row for each field. Don't put anything in the left side (Rows) and don't put anything in the measure field (bottom-right). This will create labels on the left... and the data will extend out to the right.
The report design example can be downloaded from: http://developer.actuate.com/community/forum/index.php?/files/file/1079-horizontal-table-using-crosstab/
Virgil
If you want dataset records to be reported across the page, this would have to be done via a crosstab.
If you want dataset records to be reported down the page, this can't be done automatically as far as I know. However, it can be done by inserting a new detail line in your report table object for each database field to be reported, then moving column headings from the heading row into the first column's detail rows and moving record values into the second column's detail rows.
So, for example, a report with 6 columns in it would become a two column report with six detail rows.
Not in box (up to 3.7). You have to use 3'd party libs like that one.

SQL Server Reporting Services 2005 Column Wrap on a Subreport

Does anyone know how to set a height and width on a subreport so that it forces the subreport to wrap into several columns?
The delimma: I have to show a legend in a limited amount of space in a page header above a tabular report, and I'd like to limit the height of the legend so that it wraps into multiple columns, as needed. For example, the subreport might be pulling from a dataset containing 8 items: 1-red, 2-blue, 3-purple, 4-green, 5-yellow, 6-orange, 7-brown, 8-black. I'd like for the subreport to be formatted into 3 columns/3 rows, showing the first 3 in the first column, the next 3 in the 2nd column, and the last 2 in the last column.
Currently, the subreport is setup to have 3 columns, and the size of the subreport area inside of the master report is set to the exact same size as the subreport, itself. However, when I run either of the two, I'm getting only 1 column, and the height of the subreport is expanding to fit everything into 1 column.
Does anyone know of a work-around for this?
I would structure my query so that there are 4 columns, handling the logic for what colors are in your legend in SQL. That way you can guarantee that you always have at least 4 columns. If you have less than 4 just pass in null or empty values. Then the 4 column table for your subreport would be pretty straight forward.
The only other option I could think is to use a single text box and build your string with carriage returns after every 4th color...but that could be rather messy as well and you would have less control with the formatting (since you're using 2005).
HTH
PS. If you need some help structuring your query I'll be happy to help with that if post some code.

Resources