Tuesday, April 14, 2015

SSRS – Join Multiple SharePoint List Columns Using LookupSet Function

Problem:
How to create SSRS reports by joining multiple SharePoint List columns with foreign key relationship
Solution:
There are three lookup functions in SQL Server 2008 R2 Reporting Services:
  1. Lookup
  2. LookupSet
  3. MultiLookup
In this article I will explain the functionality of LookupSet Function and provide a simple report to show how it is used.
LookupSet:
Returns the set of matching values for the specified name from a dataset that contains name/value pairs.
Syntax:
Lookup(source_expression, destination_expression, result_expression, dataset)
Parameters:
source_expression
(Variant) An expression that is evaluated in the current scope and that specifies the name or key to look up. For example, =Fields!ID.Value.
destination_expression
(Variant) An expression that is evaluated for each row in a dataset and that specifies the name or key to match on. For example, =Fields!CustomerID.Value.
result_expression
(Variant) An expression that is evaluated for the row in the dataset where source_expression = destination_expression, and that specifies the value to retrieve. For example, =Fields!PhoneNumber.Value.
dataset
A constant that specifies the name of a dataset in the report. For example, “ContactInformation”.
Return:
Returns a VariantArray, or Nothing if there is no match.
Example
  • Create two Data Sets as shown below(here “ds_Orders” is the main dataset and “ds_Products” is the master dataset):


  • Create a report and drag and drop the necessary columns from the “ds_Orders” dataset as shown below

  • In the fourth column of this report, we have to bring the data from the “ds_Products” dataset with lookup option. To do this write the below expression on the fourth column
=Microsoft.VisualBasic.Strings.Join(LookupSet(Fields!ProductCode.Value, Fields!Code.Value, Fields!ProductTitle.Value, "ds_Products"), ",")
  • Now your Report will look something similar to this

  • That’s it you are done. Run the report you will see the below output
 Reference:

Monday, January 12, 2015

Adding CSS reference to a SharePoint master page in 2013

There are a couple of techniques for adding a reference to a css file to a master page, but ​in 2013 there is a new element to use.

CSSRegistration.

An example in a standard .master file looks like this:

<SharePoint:CssRegistration Name="<%$SPUrl:~Site/SiteAssets/MetroJs/MetroJs.css% >" runat="server">

If you are using the Design Manager feature and creating a master page in HTML, then you need to encode the < and >

<SharePoint:CssRegistration Name="&lt;%$SPUrl:~Site/SiteAssets/MetroJs/MetroJs.css%&gt;" runat="server">


Enabling PDF preview in search

SharePoint 2013 now crawls and indexes PDF files by default, what it doesn't do is provide the preview (when you hover over the search results and the callout displays the pdf).

It's simple to get going, follow this article.

http://www.wictorwilen.se/sharepoint-2013-enabling-pdf-previews-with-office-web-apps-2013-march-2013-update