Showing posts with label Reporting Services. Show all posts
Showing posts with label Reporting Services. Show all posts

Friday 3 May 2013

Getting Started Formatting SSRS Reports

Introduction
The SSRS report once ready needs to be formatted to make it pixel perfect for viewing and printing. The formatting can be classified into the following types:
  • Conditional Formatting
  • Unconditional Formatting
Conditional Formatting
The conditional formatting is done using the IIF and switch statements. For conditional formatting can be used to display the alternate rows with the specific color codes.
Unconditional Formatting
Unconditional formatting can be used to format the report for the date and number values in a report. For example displaying the date in the Indian format, with the default date is displayed in the US format.
Implementing Formatting in SSRS Report
Let work through a sample report formatting exercise.I created a sample report whose output is below. As you can see the report is just the raw draft of the requirements given to the developer but still not in the state to present it to the end business user and also lacks the basic formatting for the displaying the data as well.
clip_image002
We can begin with setting the Title to the center. The SSRS has a tool bar button to horizontally center align the Titles or any other report item in the exact center of the page. The tool also has the similar functionality for the vertical center alignment of a report item.
clip_image004
The following screenshots show the steps to format a number in the SSRS for applying the thousand separators to the numbers. You may also add the currency symbol to the Amount fields used in the reports.
Right click on the textbox of the Number field you want to format and go to the textbox properties :
clip_image006
Click on the number and select the Number in the category. Click the check box for the thousands :
clip_image008
To display the values in the currency format right click on the sale amount field
clip_image010
In the text box properties click on the currency and check the thousand separator box. By default it will show the Dollar sign ($) but you can customize it to specify the currency of your country by clicking on the symbol button.
clip_image011
Next we will do some conditional formatting to display the report rows in the alternate color for better visualizations. For this click on the details row on the table and right click and go to the properties (F4) and enter the following code in the background color expression:
= IIF(Row Number (Nothing) Mod 2 =
0,"LightGrey", "Transparent")
clip_image013
This will display the Table rows in the alternate colors. You may change the color scheme as per your requirement.
The sales amount total is being shown in the thousands and therefore only few digits can been seen as the values have been formatted to thousands.
 clip_image015
· Now to format the date to be displayed in the Indian format. Right click on the date textbox and go to expressions and add the following expressions to format the date:
clip_image016
Preview the report to see the output which will be as follows:
clip_image018
More details on the date formatting can be found on the meson documentation. You can find it here.
Alternatively, the conditional formatting can also be achieved by using the switch statement as follows:
Click on the Sales Amount and press F4.
clip_image020
Go to the color and specify the following code in the expression
clip_image022
clip_image023
To make it look a bit more professional I will just add some fields, displaying the report run date and the report user who has generated the report.
You can do this by adding the Global variables such as the page numbers and the use rid fields which are available as the built-in fields when you click on the expressions. Also I have used the built in Date Time function Now to get today’s date and time.
clip_image025
Finally the report will look like the following which has been made pixel perfect for the printing as well.
clip_image026
Going forward you may also want to refer to MSDN which gives a detail documentation on the SSRS formatting tips here










































Wednesday 20 March 2013

How to resolve Reporting Services Catalog Database File Existence Failed Error

When user uninstall SQL server instance from the machine and after some time, again install SQL server instance with same name on same machine then this error occurred, because some files still exists in the directory.



For resolve this error, go to the data directory of SQL server instance. Assume that the instance name is MSSQLSERVER then default data directory location will be as below.
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
Now delete following files.
  • ReportServer.mdf
  • ReportServer_log.LDF
  • ReportServerTempDB.mdf
  • ReportServerTempDB_log.LDF

Click on back and then next button on the installation window.

Azure AzCopy Command in Action

Azure AzCopy Command  in Action -  Install - Module - Name Az - Scope CurrentUser - Repository PSGallery - Force # This simple PowerShell ...