In SQL Reporting Services 2008, can you format a field conditionally? In Crystal Reports it is doable. I have a field which I want to be bold if another field is Y, and unbold if its value is N.
Use the FontWeight property of the field, and set it to an expression like this:
=iif(Fields!YourTestField.Value="Y","Bold","Default")
You can find FontWeight in the properties pane for the report item, or under Font -> Style -> Bold in the properties dialog (right click -> properties). Use the f(x) button to edit the formula.
Related
How I can pass SSRS parameter with #? When I am trying to choose email from parameter list, I get:
An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'DataSet1'. (rsErrorExecutingCommand)
Parser: The syntax for '#xx' is incorrect. (ASF#xx.com).
I need it to filter my MDX dataset.
The values in cubes uses are not simply text, they are members of a dimension with attributes. In order to make the comparison, it needs to be converted to the proper syntax. A good way to add a parameter is to use the SSRS Query Designer.
Go to your Dataset properties.
Click on Query Designer.
Drag the attribute to the top-right corner.
Check the box in the Parameters column.
Click OK.
This will create a hidden dataset along with the parameter. It also formats the dropdown list for you.
If you look in the MDX it creates, there is a StrToSet function that it uses to interpret the string.
Another option that is simpler, but less efficient is to simply apply the filter to your dataset within SSRS.
Go to the Dataset properties.
Go to the Filters tab.
Add a filter that ensures the Email column equals your Parameters!Email.Value
I'm using BIDS Helper in a tabular project and I used a functionality to go from a Excel pivottable to a report with complete list of BI metrics. I already constructed the link as
http://reports.ABCDEFJ.net/ReportsDW/Pages/Report.aspx?ItemPath=%2fABCD+BI+Reports%2fDEV%2fDicion%c3%a1rio+de+Dados%2fR07+Dicionario+Dados&PRM_CUBE=01_CUBE_STOCK&rs:Command=Render
the link has a PRM_CUBE parameter with a cube to filter. My SSRS report already has a parameter PRM_CUBE with a combo box.
What do I need to do to link the PRM_CUBE parameter to the SSRS parameter/combox? The objective is naturally to:
nothing selected on combo, nothing appears
A is selected in the combo or sent via link, show it on combo and list associated values
B is selected in the combo or sent via link, show it on combo and list associated values
At this moment the report completely ignores the query string parameter.
There are 7 built in options for exporting SSRS 2008 reports.
I was wondering if there is an easier way to code the following in SSRS when chosing the export option:
=IIF(Globals!RenderFormat.Name="WORD" OR Globals!RenderFormat.Name="XML" OR
Globals!RenderFormat.Name="CSV" OR Globals!RenderFormat.Name="TIFF" OR
Globals!RenderFormat.Name="PDF", Globals!RenderFormat.Name="MHTML" OR
Globals!RenderFormat.Name="EXCEL",true,false)
Is there a way to write the code above without having to list each export option listed? A way that includes all the export options? If so, how would you write that code?
The suggestion from ShellNinja won't work as a visibility expression because of the order in which expressions and other report items are processed and rendered.
The article Built-in Globals and Users References on TechNet hints at this (allbeit a very vague hint) under the RenderFormat subheading where it says that:
Globals!RenderFormat.Name is available during specific parts of the report processing/rendering cycle.
Globals!RenderFormat.Name is not populated prior to expressions being evaluated, it's populated on completion of the current render request which is why it can't be used in a visibility expression but will display the name in a textbox.
Globals!RenderFormat.IsInteractive is populated prior to expression evaluation and is the only way of hiding/showing a report item prior to a report being rendered. RPL and HTML are considered fully interactive formats, all other formats are not or only support some interactive features. More information on this can be found in the article Comparing Interactive Functionality for Different Report Rendering Extensions on TechNet.
Use "RPL" for a simpler IIF expression so that any other format is "EXCEL", "CSV", "WORD", etc. When the report is displayed in the report server viewer or a ReportViewer control the RenderFormat is "RPL".
=IIF(Globals!RenderFormat.Name = "RPL", true, false)
The above code when set as a visibility expression will show the field when rendered in SSRS and hide it on export.
Tip: When you have a long IIF expression use a switch expression Reporting Services Expression Examples they are by far cleaner and easier to manage.
The expression below, placed in the Column Visibility dialog box for a selected column, displays the column only when the report is exported to Excel; otherwise, the column is hidden.
=IIF(Globals!RenderFormat.Name = "EXCELOPENXML" OR Globals!RenderFormat.Name = "EXCEL", false, true)
This is mentioned in the MSDN itself. Hence it does work!
We are in the process of updating from the SSRS package in SQL 2005 to SQL 2012. SSRS seems to work fine, even with the original report model, but none of the reports we create have clickthrough functionality. Even if the entities are linked in the report model, the table simply doesn't have any clickthrough links. The older reports carried over from the SQL 2005 SSRS do still have the functionality however.
We are using the enterprise version of SQL, which claims to have the feature. Is there a manner in which I need to turn it on?
Clickthrough doesn't only matter on the underlying reporting server's capability which supplies the data, but also if the report designer application (in our case Report Builder 3.0) support it too.
#djangojazz is using SSDS (successor of BIDS) in his solution, and it also requires cubes. I think #ChargerIIC wanted to use Report Builder. It seems that Report Builder 3.0 is not a successor of Report Builder 1.0 in all respects. Particularly this clickthrough feature may be a difference.
See Report Builder 3.0 FAQ: http://download.microsoft.com/download/7/F/D/7FDAA75C-1273-4DFE-8EC6-D9699C3EE47F/SQL_Server_2008_R2_Report_Builder_3_0FAQs.docx
See the question: "What are the key differences between Report Builder 1.0 and Report Builder 3.0?". The last row in the answer table is crossed out, but it says that 1.0 support infinite click through, while 3.0 is manual.
"Q. Is this a replacement for Report Builder 1.0?
A. Not for this release. It does replace Report Builder 2.0 but there is still some additional functionality from Report Builder 1.0 that did not make it into this release that has been prioritized for a future release."
To set up a drill through report for a master report you must have two reports. For the sake of simplicity I will keep my example super simple. Let's start with the drill through report as that is the lowest level. For both examples assumple you are using a Shared Data Source you make up. This is written with instructions for 2012 Business Intelligence Development Studio assuming you are in a Report Solution for SSRS and a working SSRS Project. You get to this with All Programs > Microsoft SQL Server 2012 > SQL Server Data Tools (Once you open it, it will be called Business Intelligence).
Create a new 'Item' for a blank report and call it 'SubReport'
Open up 'Report Data' and add your Shared Data Source
Right Click 'Parameters' and 'Add Parameter'. Add a simple text parameter and call it 'Prompt'.
Open the 'Toolbox' and drag a text box onto the surface.
Type in 'Hello from [#Prompt]'. You can test the report in 'Preview' mode and see that you can pass whatever text string you want to it to get a value.
Now for the master report, repeat steps 1 and 2 but call the report 'MasterReport'
Add a 'DataSet' by right clicking the 'DataSource' you just created and click 'Add DataSet'. For example I will just create a super simple set I call 'People'
DECLARE #Person TABLE (person varchar(8)); INSERT INTO #Person
VALUES ('Brett'), ('Sean'), ('Chad'), ('Michael');
SELECT TOP 100 *
FROM #Person p
Now go to the 'Toolbox' and drag and drop a 'Table' element onto the report.
Click on the most left 'Data' cell of the 'Table' you just dropped and hover over it and select the little box that appears in the upper right and you should see a column named 'person' that matches my dataset above. Select that and the cell and header will now be populated.
Now for the real magic to actually happen.
A. Right click the cell you just created and 'Text Box Properties'.
B. Select 'Action' on the left pane.
C. Choose the radio button 'Go to Report'. (More options now appear)
D. Under 'Specify a report:' select the dropdown for the value 'SubReport'
E. Under 'Use these parameters to run the report:' click 'Add'
F. Under 'Name' you will see the parameter name 'Prompt' from the report we created in step 3
G. Under 'Value' select '[person]' which is from the dataset we created in this report in step 7.
Preview the report and now when you 'hover over' values in the table a pointer appears. When you click on a cell you DRILL THROUGH to the other report in a new screen.
I hope this helps, the important thing to keep in mind is that you can isolate your logic to seperate the two reports as distinct entitites that are loosely coupled by passing values from one to the other. You can make the parameters hidden, make more of them, you can nest the report inside of your cell if you like, etc.
I have an Access 2003 report and some of the fields within the report are NULL. I can use conditional formatting to change the color and other aspects of the text-box control but what I want to do is to display "XXXXXXXXXXXXXX" in fields where there is no data (i.e. NULL). Can this be done using conditional formatting?
The best place to do this is in the query which the report should be based on. However, it is possible to set a control in a report to, say:
=Nz(MyField,"Text")
You will have to ensure that the control has a name other than the default assigned name, which is the name of the field.