IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

A Quick Way to Hide TopBar Navigation Link in SSRS

This is just a quick hack to hide the breadcrumb and navigation links in SSRS.

SSRS TopBar Navigation Link

Under default installation, locate ReportingServices.css file under the following path:
C:\Program Files\Microsoft SQL Server\MSRS10_50\Reporting Services\ReportManager\Styles

This path is for SSRS version 2008 R2. If you use a different version of SSRS, then you need to replace the path MSRS10_50 to something else specific to whichever SSRS version you’re using.

Open the file with a text editor.

Find a css element called .topBar.

Just add display:none; after the open curly bracket on the first table.msrs-topBreadcrumb element under the .topBar.

table.msrs-topBreadCrumb { 
	display:none; 
	[leave the rest as is]... 
}

ReportingServices.css Customization

The final result would look like the screenshot below:
SSRS TopBar Navigation Link Hidden

Caveat

This only works if you want to hide the links but there’s no concern over the security of having the users accessing them. The links themselves can easily be seen from the page’s HTML source code.

July 29, 2013 Filed Under: How To Tagged With: SSRS

How to Create SSRS Report with Dynamic Query and Multi-Value Parameters

Continuing from the last SSRS tutorial on creating a SQL Server Reporting Services report with dynamic query and parameters, one caveat about the report is that it only works for one record search at a time.

While this may be fine for a customer who needs to search a particular record specific to the person, this is not generally useful for office use, where one person may need to search possibly hundreds or thousands of records that will be exported to an excel spreadsheet for further scrubbing and presentation.

We want to enable users to enter several search keywords and have the report rendered if any matched records.

In order to accomplish this, we need to modify the Parameters to allow multiple values. If we go to the left pane on the Report Designer and open the @SearchString Parameter Properties, under General tab, click on the Allow multiple values check box and click OK.

SSRS Multiple Values Parameter Checkbox

What this does is to change the Search for: text box to a drop-down list box to allow search based on multiple keywords. However, the report can still only search for one value. If we entered two values as in the example below, no records will be retrieved because the search keyword is actually a concatenated value of those two words separated by comma (i.e., ‘brown,baker’).

SSRS Multiple Values Search (Preview)

The concatenation is done using =Join(Parameters!SearchString.Value) built-in function. SSRS is smart enough to do this automatically when you selected Allow multiple values on the Parameter Properties. While the report is stored enough to concatenate the multiple values, the linked stored procedure still doesn’t know that it’s supposed to split the parameters into several individual values.

To do this, we need to create a user-defined function (UDF) that will split the concatenated parameters as a one column table.

Create a Split Function

CREATE FUNCTION dbo.ufnSplit (
  @Input NVARCHAR(MAX), 
  @Delimiter CHAR(1) = ','
)
RETURNS @Values TABLE (Item NVARCHAR(100))
AS
BEGIN
  DECLARE @Pos INT
  DECLARE @Single NVARCHAR(100)
  SELECT @Pos = 1 
  WHILE @Pos > 0
    BEGIN
      SELECT @Pos = CHARINDEX(@Delimiter, @Input)
      IF @Pos > 0
        SELECT @Single = LEFT(@Input, @Pos - 1)
      ELSE
        SELECT @Single = @Input
      INSERT  @Values(Item) VALUES (@Single)
      SELECT @Input = RIGHT(@Input, LEN(@Input) - @Pos)
      IF LEN(@Input) = 0 BREAK
    END
  RETURN
END 

Implement Split Function

Next, we implement the split function in the dbo.SearchEmployee stored procedure created in previous posting.

Modify stored procedure dbo.SearchEmployee by using ALTER PROCEDURE and replace the last line of the SQL statement from

= (@SearchString)

To

IN (SELECT Item FROM dbo.ufnSplit(@SearchString, ','))

The full SQL statement should look like this:

ALTER PROCEDURE dbo.SearchEmployees 
	@SearchBy NVARCHAR(MAX),
	@SearchString NVARCHAR(MAX)
AS
SELECT NationalIDNumber, FirstName, MiddleName, LastName,
       JobTitle, LoginID 
FROM HumanResources.Employee e
INNER JOIN Person.Person p
ON e.BusinessEntityID = p.BusinessEntityID
WHERE 
	CASE 
		WHEN @SearchBy = 'IDNo' THEN NationalIDNumber
		WHEN @SearchBy = 'Title' THEN JobTitle
		WHEN @SearchBy = 'First' THEN FirstName
		WHEN @SearchBy = 'Middle' THEN MiddleName
		WHEN @SearchBy = 'Last' THEN LastName
		WHEN @SearchBy = 'Login' THEN LoginID
	END
	IN (SELECT Item FROM dbo.ufnSplit(@SearchString, ','))

Execute the SQL to save the stored procedure (or press F5) and you’re done.

Once the stored procedure is modified, it will know how to parse the multi-value parameters and pass back the results as shown in the screenshot below.

SSRS Multiple Values Search

Please share this post if you find it helpful.

Futher Reading

Microsoft SQL Server 2012 Reporting Services (Developer Reference)
code-u-like: SSRS multi-value parameters with less fail
Passing multiple values for a single parameter in Reporting Services
User-Defined Functions
Using Parameters Collection References in Expressions (Reporting Services)
Single-Value and Multivalue Parameters (Report Builder and SSRS)

July 22, 2013 Filed Under: How To Tagged With: SQL, SSRS

How to Calculate Duration Between Two Dates in T-SQL

A simple way to calculate the duration of a running program with a start and end time. The information should be presented in an hour:minutes:seconds format with leading zeroes (i.e., 00:00:00). Two local variables are used to demonstrate the query.

Typically, this is more useful if done as a stored procedure.

DECLARE @StartTime DATETIME = '2013-07-16 13:02:29';
DECLARE @EndTime DATETIME;
DECLARE @Duration INT;

SET @EndTime = '2013-07-16 15:29:31';

SET @Duration = DATEDIFF(second, @StartTime, @EndTime);

SELECT RIGHT('0' + CONVERT(VARCHAR(2), @Duration/3600), 2) 
   + ':' + RIGHT('0' + CONVERT(VARCHAR(2), @Duration%3600/60), 2) 
   + ':' + RIGHT('0' + CONVERT(VARCHAR(2), @Duration%60), 2) 
AS Duration;

The result here is printed with a column heading Duration and a value of 02:27:02.
SQL Server DateDiff Result

Further Reading

DECLARE @local_variable (Transact-SQL)
DATEDIFF (Transact-SQL)

July 16, 2013 Filed Under: How To Tagged With: Microsoft SQL Server, SQL, SQL Server

Creative Cloud Desktop Failed to Install on Windows

Adobe Creative Cloud Logo With the latest release of Adobe Creative Cloud Suite, I’ve been having issues to install any of CC programs from the suite due to the issues to even get Creative Cloud Desktop application on my Windows 8 updated. Every time the update file is run, the Adobe Installer shows an error message:

We've encountered the following issues: 
Creative Cloud desktop failed to install.

Adobe Creative Cloud Installer Failed Installation

The following recommendation was provided by Adobe staff, which I followed to the dot but still didn’t solve my problem. It seemed the cleaner did not do the job correctly. The log shows many “access denied” issues in the directories it’s trying to clean up (C:\Users\(UserName)\AppData\Local\Temp\Adobe Creative Cloud Cleaner Tool.log).

It turns out the solution was much simpler, the recommendation would work by restarting the system for each of the step described.

So to sum up the steps:

  1. Restart Windows

  2. Download Creative Cloud Cleaner Tool

  3. Run Creative Cloud Cleaner tool and choose option 3 and then option 1 to complete the cleaning process.

  4. Once done please rename OOBE folder from these locations:

    Windows:
    C:\Program Files (x86)\Common Files\Adobe
    C:\Users\(UserName)\AppData\Local\Adobe

  5. Restart Windows

  6. Download Creative Cloud

  7. Run Creative Cloud file (CreativeCloudSet-Up.exe).

Another note: By default, CC programs are installed side-by-side with CS6. You can install Photoshop CC first before removing Photoshop CS6. Doing it this way enables you to migrate CS6 presets to Phothoshop CC.

If you’re still having other issues, you can contact Adobe support or start a new discussion in the Creative Cloud Download & Install forum.

Adobe Student & Teacher Edition Creative Cloud | Student/Teacher Validation Required |12-Month Subscription with Auto-Renewal, Billed Monthly, PC/Mac

Download

Creative Cloud Cleaner Tool
Creative Cloud Download Center

Further Reading

Creative Cloud Desktop Failed to Install
Creative Cloud Help

The link to Amazon is an affiliate link.

July 4, 2013 Filed Under: How To, Multimedia Tagged With: Adobe

How to Copy Data from One Table to Another

A quick way to populate data from one table to another using Transact-SQL. The objective is to create a copy of the table and populating it at the same time and then create an SQL script to refresh the data when necessary. This can be achieved by using two similar SQL (three if we want to include the TRUNCATE command).

The first run we use “SELECT INTO” statement to query the source table and create a new table and populate it at the same time.

SELECT [ID]
      ,[System Manufacturer]
      ,[Computer Type]
      ,[Computer Model]
      ,[Name]
      ,[Serial Number]
      ,[Image]
      ,[OS]
      ,[OS Revision]
      ,[Architecture]
      ,[Primary User]
      ,[Domain]
      ,[Last Logon User]
      ,[Last Logon Domain]
      ,[Client Date] 
INTO [dbo].[DiscoveryAgentCopy] 
FROM [dbo].[DiscoveryAgent]
GO

You can use * if you want to copy all fields from the table.

SELECT * INTO [dbo].[DiscoveryAgentCopy] 
FROM [dbo].[DiscoveryAgent]
GO

If the copy table is already existed and we want to refresh only the data, we use “INSERT SELECT” statement to read the data from source and map them to the fields on destination table.

-- CLEAR COPY TABLE OF ALL DATA
TRUNCATE TABLE [dbo].[DiscoveryAgentCopy]
GO

-- POPULATE DATA
INSERT INTO [dbo].[DiscoveryAgentCopy] (
       [ID]
      ,[System Manufacturer]
      ,[Computer Type]
      ,[Computer Model]
      ,[Name]
      ,[Serial Number]
      ,[Image]
      ,[OS]
      ,[OS Revision]
      ,[Architecture]
      ,[Primary User]
      ,[Domain]
      ,[Last Logon User]
      ,[Last Logon Domain]
      ,[Client Date])
SELECT [ID]
      ,[System Manufacturer]
      ,[Computer Type]
      ,[Computer Model]
      ,[Name]
      ,[Serial Number]
      ,[Image]
      ,[OS]
      ,[OS Revision]
      ,[Architecture]
      ,[Primary User]
      ,[Domain]
      ,[Last Logon User]
      ,[Last Logon Domain]
      ,[Client Date]
FROM [dbo].[DiscoveryAgent]
GO

June 27, 2013 Filed Under: How To Tagged With: Microsoft SQL Server, SQL, SQL Server

« Previous Page
Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2026 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure