Display row with condition in Pentaho Report Designer - pentaho

Assume I have one data set with following fields:
Name, Amount, Time, etc
How can I display only those records with Amount > 100, for example?
Since I need this data set for other report, I can't filter these records when I prepare data set.
I searched around, but couldn't find any answer. I will really appreciate if anyone can help.
By the way, I used Pentaho Report Designer 3.9.
Thanks a lot.

Yes, you can.
You have to find your Details Band - not Details Body -, within your Report Structure, and set up the Style Attribute visible the expression:
=if([Amount]>100;true();false())
Besides, if you want your summaries to consider only the shown data, you can also add an Open Formula function field, that would say:
=if([Amount]>100;[Amount];0)
And you'd summarize it at the end of the report.
Here's the link with the full example built to your situation.

Related

(Excel-VBA) Specific data import (on the background) in the active sheet

Would you please help me (total beginner) to prepare a VBA macro that would open a sheet on the background and import specific selection as shown below:
Let's say we have downloaded wordcount analysis (xlsx) like this downloaded from a CAT tool for testing.
Now I would need to add a macro to my main sheet that would read lines starting (Column A) with "All". If "All" then I'd need to record columns of that line (specficilly Columns A - O) in array / hashtable?.
Please take a look at this image that summs it all (better than explaining it for me :-)
Let me know in case you need to know more details.
All tips / suggestions are greatly appreciated.
Many thanks!
My suggestion (I'm a beginner too) would be to use the Macro Recorder. Great tool to learn (example).
start recording
filter for 'ALL'
copy/past the Cells
stop Recording
Then have a look at the recorded code and adjust it :)
Looking at your data and the final layout you are looking for, using a Pivot Table would provide you with all of the flexibility you need.
You can:
filter which data to display
generate calculated values based on data in other columns
choose what order your columns are displayed
dynamically change the layout if you decide you want a different view
From your data, I was able to generate the following Pivot Table in about 15 minutes.
There are several good, simple tutorials on building Pivot Tables. A Google search will turn up plenty.
Things you will need to learn about for your particular problem:
Classic display (I used the classic display to get this particular layout)
Calculated Fields (many of the columns in the pivot table are calculated based on your spec). There is a maximum string length of 255 characters for a field calculation, so you may need to rename some of the columns in the original data set.
Of course, basics of Pivot Tables
Loading new data and updating your pivot table
Good Luck!

Get concrete value in Pentaho Report Designer

Let me explain my problem,
in Pentaho Report Designer I want to build such a report, where I have one data set, i.e. one request to database
SELECT code, name FROM EMPLOYEES
and show result of this request not in the form of list, but put every result in appropriate place. i.e. like in below picture
Where field "code" is unique, just one result can be put into red label in picture.
How can I do this in Pentaho Report Designer?
I can solve this problem by creating 3 data set, for each of caption. But what if captions like this will be much more, creating requests for each of this caption will not be so effective.
Hope I could explain my question.
I don't know if I got it right, but If you want to use the values returned by your query, you could create a new formula called "your_formula":
=MULTIVALUEQUERY("name_of_your_query")
This will give you an array with the result of the query. Then you could use another formula to get the 1st result of the array. For example:
=ARRAYLEFT([your_formula])
and get the first result of your query. This way let you use your_formula as parameter. This means you can drag and drop it on your report and use it.
I hope it helps.
Regards,
Tatan.

VB.NET Active Reports

I have a VB active report which has many different attributes. The report contains attributes area, balance, id and status and is currently grouped my area. What I need to do now is remove all lines from the report where the balance is equal to 0 and the status equal to deactive. The information for the active report is from my database. Thus I think the best way would be to only select records where the balance is not 0 and status not equal to deactive. Is there a way I can query my database and have the active report be based off the query results? Is there an easy way to do this? Thanks for any help.
Yes, the best way to do this is to change the query so that only the minimum records you need are actually coming into the report. The Modify Data Sources at Run Time topic from the documentation shows how to modify that SQL statement in the code dynamically at runtime.
If you can hard-code the SQL query for the report you should probably just modify the SQL at design time inside the designer. This Bind Reports to a Data Source topic shows you how to do that.
You can also programatically control the visibility of fields/textboxes based on the data using the Format event of the section containing those controls (most likely Detail_Format), but it sounds to me like modifying the SQL query is your best bet.

Customize SSRS report on the fly

We have a requirement to represent the data on SSRS report in a simple manner.
i.e. the sql query for this report will look like this.
Select col1, col2,....col8 from Table where Date between date1 and date2.
So the user will run this report by selecting it from the web application with some parameters (eg: date1 and date2)
But the critical thing which i am facing here is that on the interface user has the option to select the order of the columns to position as shown in the image below.
In the image you will see the customized format has col1,col4,col8,col6,col5,col3,col7,col2.
Please help me how to create an RDL file to organize this kind of requirement. Thank you in advance in understand the correct requirement and producing the result as requested.
Set the expression for the columns to choose among the different fields depending on the selected parameter. For example, the expression for the value of the second cell might be similar to
=IIF(Parameters!MyColumnParameter.Value = "Choice1", Fields!Col2.Value, Fields!Col4.Value)
(Above code not tested, but hopefully close enough to give you the idea.)

Pentaho Report Designer: How to create a chart based on an OLAP cube?

Using Pentaho Report Designer, I can successfully display my OLAP cube's data as a table.
But when I want to display the same data as a chart, it always fail saying "CHART.USER_NO_DATA_AVAILABLE".
Actually, I don't really know what I should enter for category-column and value-columns. I tried:
category-column = [Area].[prefecture]
value-columns = [[Product].[Product.Product].[All Products].[productA]]
And any other variation I could think of, but no success. Any idea? Thanks!
My OLAP cube is a Pentaho Analysis: sales count for each product and prefecture.
Just use:
[Product].[Product.Product].[All Products].[productA]
You only need the extra square brackets around the entire fieldname if it's a formula.
Or pick the field from the dropdown.. then you know you have the right one!
If you're doing a timeseries xy, note you have to repeat the category column value as many times as the value column.
also make sure you have a series name too.