In SSRS 2008, how do I show the labels and values of a multi-value parameter together in a text box? - sql-server-2008

This seems like it should be trivial, but I just can't seem to find the correct expression or work it out myself.
Using Microsoft SQL server report builder SSRS, I have a multi-value parameter named "Diagnoses", with the following properties:
In a text box in my report, I would like to list the labels the user has selected, along with their corresponding values. For example if the user selected "Breast" and "Lung", you would see something like this:
You have selected the following site groups / diagnosis codes:
Site Group Diagnosis Codes
Breast (List of breast codes)
Lung (List of lung codes)
Are there any expression gurus out there who could help me? Maybe the solution is to use a Tablix?

You can achieve the result you want with 3 textboxes (optional: use rectangle for container), follow the layout I have below:
Use this in the Expr in Site Group:
=JOIN(Parameters!Diagnoses.Label, vbcrlf)
Use this in the Expr in Diagnosis Codes:
=JOIN(Parameters!Diagnoses.Value, vbcrlf)
If you want your labels to repeat across pages, I'd recommend putting them inside the report header section.

Related

SSRS Font Color Using Wildcard parameter

Hi I have a report that i used a wild card search parameter so that i can pull record that contains a certain text.
For example: I need to search for subscription for Mary Johnson so on the keyword search box i just type "John". This set-up is working fine, but now I need to color that search keyword when found for each row. so i need assistance on expression code that mimics SQL syntax of LIKE in SSRS expression. I started to change the font color with =iif(Instr(Fields!ReportRecipients.Value)=Parameters!Keyword.Value,"Maroon","Black"), but it didnt work.
Please advise.
Sample
TOJo.eger#m.com; ruth.tuker#m.com;sandrae.espe#m.com; dan.gay#m.comIncludeReportTrueRenderFormatPDFSubjectDaily Report for IBC Medicare? was executed at #ExecutionTimeIncludeLinkFalsePriorityHIGH"
You can use some .net string functions directly in SSRS expressions. In your case you can use the Contains() function like this.
=IIF(
Fields!ReportRecipients.Value.Contains(Parameters!Keyword.Value),
"Maroon",
"Black"
)
If you are dealing with HTML and only want the search term to be highlighted then you can simply use this as the Value expression. You must leave the text box color properties as default.
=REPLACE(
Fields!ReportRecipients.Value,
Parameters!Keyword.Value,
"<span style=""color:red;"">" & Parameters!Keyword.Value & "</span>"
)
Finally, right-click the placeholder, choose properties and select Mark-up type as HTML
In this example, I used a country list and searched for the word "land", here's the results. The first column just uses the first method I described. The second column adds HTML tags.

SSRS - Multiple font or color within a chart item

I'm using Report Builder 3.0. Long story short, I want to make the font bold for the text in the red box that you see in the image below:
Basically, it's just one expression in the legend field of my value, however, for clarity's sake (for my end users) I wish to make the "title part" bold. I found the following solution for textboxes in a tablix using Html by checking off the "HTML – Interpret HTML tags as styles." checkbox within the Textbox's properties. (http://www.sqlchick.com/entries/2010/10/31/using-different-formats-within-a-single-textbox-in-ssrs.html)
However, I can't find anything similar for graphs! I mean if MS thought about it for tables, I presume they must've given it some thought for a chart setting too.
Thanks to all!
p.s. As an aesthetic solution to my problem, I did think of simply creating a new title field, moving it to the exact same location and formating it. But I'm surious whether there'd be some more "proper" way of doing this.
I'm using the same approach for one of my charts.
STEPS.
Select the Chart series to open property pane. In my case, the chart series name is TWR Chart Series
Select the color property and select to build the expression.
I'm posting one of my expression. You can build your own expression base don your field names etc.
=IIF(Fields!ProductID.Value = 1 OR Fields!ProductID.Value = 6,"#00425E",
IIF(Fields!ProductID.Value = 3 ,"#6B8797",
IIF(Fields!ProductID.Value = 5 OR Fields!ProductID.Value = 7,"#799179",
IIF(Fields!ProductID.Value = 4 AND Fields!sort.Value=99,"#6bb1be","#48597B"))))
If used sensibly, you should get your desired results.Good luck.

SSRS - Changing tab name when exporting to excel

I have tabbed my report in SSRS 2012 by having my page breaks based upon grouping classname and it works great. How do I change the tab names when exporting to Excel? I tried having an expression for page name =Fields!classname.Value. In doing so, it makes all 4 of my tabs equal the first page break of Sales Division.
My tabs are based upon the grouping of classname, which in returns gives me the 4 tabs: Sales Division, VRS, ClearCaptions, and IP-relay.
You need to set the PageName of the Tablix Member (group), NOT the PageName of the Tablix itselfs.
If you got the right object, if will say "Tablix Member" (Tablix-Element in German) in the title box of the properties grid. If it's the wrong object, it will say only "table/tablix" (without member).
Also, be advised to set the sort order of the group expression, so the tabs are alphabetically sorted.
If you get the tablix instead of the tablix member, it will put the same tab name in every tab, followed by a (tabNum). That is exactly your current problem.
This solution was not working for me.
I had to add group break page.
https://www.mssqltips.com/sqlservertip/3527/export-sql-server-reporting-services-report-data-into-multiple-excel-worksheets/

SSRS - Replace the Chart

I have a question, want some assistance.
Q) My question is that i have a chart in which analyst assigned for many incidents and some analyst have 1 or two incident assigned. just because of this the bar chart looks ugly some time. So thats why i used a new chart to represent Min incident count. But i want there some creativeness, for which i want there a radio button or OnClick event ( I do not know how to use both these. When report runs by default it`ll show Max incidents count chart and when we used radio button it will show Min incidents count chart, on the same chart area no need of new area or on new page.
Kindly help me or refer me some links and with ideas. As i have searched many blogs but i didn`t get any big achievement.
Below is my Simplified query;
SELECT
Count(IncidentDimvw.Id)
,UserDimvw.FirstName AS Analyst
FROM
IncidentDimvw
FULL JOIN WorkItemDimvw
ON IncidentDimvw.EntityDimKey = WorkItemDimvw.EntityDimKey
JOIN WorkItemAssignedToUserFactvw
ON WorkItemDimvw.WorkItemDimKey = WorkItemAssignedToUserFactvw.WorkItemDimKey
JOIN UserDimvw
ON WorkItemAssignedToUserFactvw.WorkItemAssignedToUser_UserDimKey = UserDimvw.UserDimKey
WHERE
WorkItemAssignedToUserFactvw.DeletedDate IS NULL
GROUP BY
UserDimvw.FirstName
Having (Count(IncidentDimvw.Id) = (#Count))
Having Clause is right or wrong, i donot know.
I used the following expresion in series as you suggested.
=iif(Parameters!Count.Value, Max(Sum(Fields!ID.Value)), Min(Sum(Fields!ID.Value)))
Sample data is as folows;
Regards
Muhammad Ahsan
I can think of a couple of ways to approach this:
Dynamic expressions based on parameter
Say you have a simple DataSet like:
And also a boolean parameter called showMax.
We can create a simple bar graph based on this:
The most important thing to note is that Series value is expression-based:
In the above example the expression is:
=IIf(Parameters!showMax.Value
, Max(Fields!value.Value)
, Min(Fields!value.Value))
i.e. when showMax is true, report the Max values, otherwise report the min values.
In this case I've also updated the Axis title, Chart title, and Custom legend text to be expression-based:
Axis Title: =IIf(Parameters!showMax.Value, "Max", "Min")
Chart Title: =IIf(Parameters!showMax.Value, "Max per group", "Min per group")
Custom legend text: =IIf(Parameters!showMax.Value, "Max value", "Min value")
The chart behaviour changes based on what parameter is selected as required:
Set Visibility based on parameter
Another option is simply to have to charts and hide one depending on parameter selection.
For example, for the Max chart the Hidden property can be set to:
=Not(Parameters!showMax.Value)
Setting this property correctly for each report will mean only one is ever displayed to the user, i.e. it will look dynamic.
Either of these options should work; the first keeps the layout simple in the designer makes the chart more complex, the second makes the layout more complex but keeps the charts simple.
Hopefully one option will work for you.

How do I insert a dataset value to a BIRT report outside of a table / cube?

okay, this has got to be simple - but I can't seem to find an answer...
I am creating a summary report (using BIRT 2.6.1), and laying out a few specific summary values in a grid (not a table or a cube).
Say it's a simple query:
SELECT decision FROM dataTable
I created a data binding / aggregation (named "sumDecision") on my grid, of a type count, where my expression is:
dataSetRow["decision"]
Now, I've tried to insert this into a grid, either as "data" or "dynamic text" with the column binding:
row["sumDecision"]
But when I run the report, it comes up blank. How would I do this? Using dataSet["decision"] doesn't seem to do anything either.
I would create a Text Item (not Dynamic Text, just Text) and use the "Value Of" tags on the text item. This will give you an expression editor and as long as your grid is bound to the data set in question, you will be able to choose your data element there.
Since you just want to see the text in the grid, make sure and choose "HTML" for the format of the text item.
One solution is to create a table of 1 column, 1 detail - then delete the detail & header rows, and create my grid inside the footer of the table.
From here, I can add a dataset to the table, and create aggregations that work to my hearts content.
Is this the right way to do this, or am I missing something?