Get concrete value in Pentaho Report Designer - pentaho

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.

Related

How to group a text row in multiple data rows in Microsoft Report Builder

Basically I'd like to from this :
What I have
To this :
What I Want
Case in Orange are data that I pick up with an sql request while "This e-learning phase..." is just a plain text.
Does anybody knows how to do that ?
You could add a Parent Row Group and Group by the Information field.
Unfortunately, this would place the Information on the Left side of the table. Fortunately, there is a Layout Direction property for the table that can be switched from LTR to RTL so that the table is created from Right to Left instead of the default Left to Right.
This way the grouped information field on the right would only have one cell while there may be multiple Activities.
I'm not sure you'll be able to do this exactly how you want. This is because you cannot add rowgroup columns after non-grouped columns.
The only way you could get close is to not show the text if it's not the first row in the dataset (or rowgroup if the report is grouped somewhere)
You could use something like this in the Value expression.
=IIF(
ROWNUMBER("myDataSet_Namehere") =1,
"This e-learning phase must be completed before the start of the classroom part indicated below.",
Nothing
)
You could use a similar check to then set the vertical alignment property.
It looks like this...
The other option would be to move the test to the top of the table on it's own row in above the column headers, it would probably look neater..
Or you can wait for somebody else to come up with a better solution :)

SSRS - Fields working in Data Set, but won't appear in report

I have a data set that gets its values from a stored procedure, and I'm positive that the stored proc is working correctly since I'm getting results in SQL Server. However, when I call the fields in an expression (for example, =Fields!CustomerName.Value) and preview, it just displays a blank spot in its place. If I simply typed some text in that spot, the text does appear when I run it.
The DataSet IS working, and it's refreshed to show all of the fields. They just don't display anything in the report, despite definitely returning values when I check in SQL Server. Does anybody have any suggestions as to what steps I could take to fix this?
Thanks.
Try referencing your dataset explicitly, by changing this:
=Fields!CustomerName.Value
To this:
=Fields!CustomerName.Value,"MyDatasetName"

Issue related to the parameter of report in Pentaho Report Designer

I have a chart that contains 4 parameters and every parameter is related to the following one, i success i having the result of the chart by selecting the whole parameters one after the other,
The probleme is that i want to have another option by having the result of the chart by selecting also just one parameter or having the result without selecting any parameter
Can you please help me as soon as possible
Thanks a lot
There is one checkbox available while creating a parameter "Mandatory".Just remove the Right click from the checkboxes while creating all four parameters.Now you can check your result while selecting any parameter you want.

Display row with condition in Pentaho Report Designer

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.

Dynamic SSRS report

I had a problem in creating the Dynamic report in SSRS. My problem is:
In a table I have stored SQL scripts with the column SQLScripts. If you execute these SQL scripts you get different number of columns for each script.
My problem is, I have one report with buttons of these scripts, for example test1, test2...like that. If you press test1 button this should take the test one SQL script and should display the report with appropiate columns in that sqlscripts.
I can't create individual reports for each test report, they are plenty. Are there any options for me to solve this problem...
The only way I've been able to get this to work sofar is:
Each report has 2 datasets.
ReportData
DataHeaders
The "DataHeaders" need to have the proper name of the datafields in "ReportData". Be careful since SSRS replaces blanks and special characters with "_"
Now, create a table (or matrix) and drag the DataHeaders as the Columns of your report. (This should be a grouped column). If you run it at this point, you'll see all your columns without any data. Now comes the magic:
Create another report that takes a "DataField" parameter. Create another table or matrix within this report and set it's dataset property to be "ReportData". In the DATA cell for the table, set it to the expression =Fields(Parameters!DataField.Value).Value
Now go back to your first report. Right click and insert a subreport. Right click on the subreport and select "Subreport Properties". Under general, select the second report you created to be used as the subreport. Under parameters, select the DataField parameter and set its value to something like =Fields!DataField.Value
In my case I did some formatting in this expression to fix the above mentioned issue with spaces and special characters, since my stored procedure was initially used in ASP.NET and this was just a proof of concept.
Also in my experience the performance isn't great. In fact it was kinda slow, though I haven't had a chance to switch it to use a shared dataset, which I suspect would help a bit. Please let me know if you find a better solution.
I have not found a way to do this completely dynamically. Here is a similar question with some possible solutions:
How do i represent an unknown number of columns in SSRS?
You basically need to create a 'master dataset' from the other Datasets that are based on your multitude of SQL scripts first.The master dataset should contain the data to be presented in it's most simplistic form, i.e. in a simple list format.
Finally, go to the toolbar in SSRS and drag a 'Matrix' into the report. A Matrix table acts similar to a pivot table in Excel or a CrossTab query in Access that will display whatever's in the Dataset.