IcCube Reporting V8 : Multi Header Pivot - Conditional Color expression - iccube

Using IcCube Reporting V8, I want to do conditional colors in the cells of a pivot column, the problem is that I can't identify this column when there are multiple header levels :
In the sample below, I want to identify the column "Interventions/Evolution"
Picture below shows that $_currentColumn.mdxName$ reports only the 1st row header text "Interventions" even though the current column mentions the complete one "Interventions, 2019":
How can I catch the complete column name in order to apply conditional colors ?

The Current Column selection menu in the expression editor sets the currentColumn only for the editor (so you can test the expression). The transformation itself runs on all the selected columns where each iteration the currentColumn changes.
There are two ways to apply a conditional color transformation to a single column from the table.
Set the columns option of the transformation to only the "Interventions/Evolution" column.
Set the columns option to All Columns and use the following expression:
if ("$_currentColumn.caption$".startsWith("Interventions")) {
return "blue";
}
return "purple";

Related

How to customize showing NULLs for a given column

In my Interactive Report I am trying to customise the way of displaying NULLs for a given NUMERIC column. That is I am trying to display value "NO DATA" instead of default dash "-".
I know there is a way to set this up for a whole report in the Pagination section via 'Show Null Values as'. The case is that I want to have it customised only for a given 1 column, not the whole report. So I can't use this solution.
Definition of this column must stay NUMERIC and since I can't mix Numbers with Strings NVL is not an option here.

BIRT report: dynamically adding columns to a table based on dataset data

In my report, a table is displaying results from a dataset and it has 6 columns.
But sometimes the dataset returns more than 6 columns depending on the report parameters.
So I need a way to dynamically add columns to my table
Thanks
I'd do it the other way round.
The number of the columns in the query is fixed anyway (for example: FIXED_A, FIXED_B, DYNCOL01, ..., DYNCOL20).
In the layout, your table should have columns for all columns (FIXED_A to DYN_COL20).
Clear the table's width. Set a fixed width for the fixed columns (with enough room left for the dynamic columns). Clear the width of all dynamic columns.
From now on, do not resize and column with the mouse, because this would set individual widths for each column again.
In your table properties, add aggregate bindings for each DYN_COLnn using the MAXIMUM function (let's call these MAX_COL01, ..., MAX_COL20).
For each columns, use a visibility expression like this (the number matching the layout column to the query column accordingly), e.g. for the first dynamic column:
!!row["MAX_COL01"]]
The !! means basically: interprete this as boolean, so the result is: show this column only if MAX_COL01 is not null - or in other words: if DYN_COL1 is not empty in any of the rows.

BIRT, How to get Dataset Row Count using Javascript

How can I get Dataset Row Count from Javascript function in BIRT. I tried searching this in BIRT exchange, but the only solution offered there is to have a new dataset getting count of values of required data set. This wont suit my needs.
Is there any way to obtain it using dataset events.
An easy way would be to count dataset items in a report variable.
Declare a new variable in your report outline:
Reset it in beforeOpen script of the dataset (in case this dataset is invoked multiple times during report execution):
vars["items"]=0;
Increment the variable in onFetch script of the dataset:
vars["items"]++;
Use your variable in any expression. For example add a dynamic text element in report's body such:
"Items count="+vars["items"]
Important 1: This approach works if and only if the dataset is bound to at least one report element (a table, chart, data element, etc.). For example, it won't work if the dataset is only invoked to fill a list of selection choices of a report parameter.
Important 2: In the body of the report, this variable can only be used after the first report element using the relevant dataset, otherwise it won't be initialized
Dominique has a great answer; It is not clear to me from your question if this simpler solution might also meet your needs.
In your data set use a computed column with a value of '1', then sum the values.
You can write JS that only adds the value if specific criteria are met.
Or you can use an aggregation on your report to sum the values, which would be after any filters or groups are placed.
There is a simpler way if you use the row number in your tables footer:
In the 'Dynamic Text' element you can select:
Avilable Column Bindings > Table > RowNum
Add 1 as the index starts with 0.
You could also make a variable and then add to that for each row created in a table.
For example, in the Table-Detail script, set an onCreate event to check for a value in each row and if there is one to increase the row count. The following onCreate script would check if the row is empty. If the row is not empty, the script increases the counter and goes to the next row.
var checker = this.getRowData().getExpressionCount();
if( checker > 0 ) vars["Counter"]++;
Then you could add dynamic text after the table with the following expression:
"Row count="+vars["Counter"]

How to make RDLC report two column

I have a simple report which is supposed to be used for printing stickers. The sticker paper is A4 size and it has two columns. I successfully managed to print data to left column. I also want to print data to right column too. My current report looks like this :
[Title]
[NameLastName]
[Address]
How can I make my report to fill data to two columns? Thanks.
EDIT :
I have generated another column as suggested in other questions. But the result is still one column, Can anyone tell me the next step?
The simplest way to do it [I think] is to:
add additional "columnNumber" column and make it "1" for, say, all odd rows and "2" for all even rows.
then place two tables side by side and make the same DataSetName property for both of them
then filter the data in each table based on the columnNumber Value (add Filter to Filters property of the table)

Expression to Exclude rows that have a specific column blank

I want to exclude entire rows that have blanks for a specific column....I dont want to show a row that has the first name column as a blank...I was thinking maybe a case statement would help with this
case when [First Name] = blank then exclude???
If this is SQL, in general you could do this:
SELECT *
FROM myTable
WHERE myCol IS NOT NULL
I had to add a calculated column that would be used as a flag, and then filter on the flag.
if(Len([First Name])>0,1,0)
Now I am able to filter on the calculated column to show only rows that have 1 in it (which will be the rows where First Name is not empty).
This doesn't delete the row from the dataset, but has the same effect in visualizations as if it had been.

Resources