April 18, 2017

Page-break-before doesn't work with IE.

I came across the requirement to print web page using JavaScript. Normally, If we need to add page break while printing the web page, we use "page-break-before" property in CSS. But "page-break-before" does not work with Internet Explorer (IE) browser. Here, I'll show you how we can achieve the desired behavior.

Resolution:

Below is the HTML snippet which is generated using JavaScript. Here, we want to add page break before each Div element. So, I've used "page-break-before:always" style property in each Div element. It will break the page while printing web page. It works fine with "Chrome" or "Mozilla" browsers but it doesn't work with Internet Explorer (IE) browser.

<h1>Page Title</h1>
<!-- content block -->
<!-- content block -->
<div style="page-break-before:always;"></div>
<!-- content block -->
<!-- content block -->
<div style="page-break-before:always;"></div>
<!-- content block -->
<!-- content block -->
<!-- content -->
To have "page-break-before:always" property working in all browsers including Internet Explorer, we need to add one extra Div tag (highlighted) with empty space ("&nbsp;") as shown in below code snippet.

<h1>Page Title</h1>
<!-- content block -->
<!-- content block -->
<div style="page-break-before:always;"></div>
<div>&nbsp;</div>
<!-- content block -->
<!-- content block -->
<div style="page-break-before:always;"></div>
<div>&nbsp;</div>
<!-- content block -->
<!-- content block -->
<!-- content -->
If you have any questions you can reach out our SharePoint Consulting team here.

April 13, 2017

Power BI – Develop BI Reports from Wikipedia using Power BI

Power BI is a great business analytics service provided by Microsoft. It provides wide range of interactive visualizations with self-service business intelligence capabilities for analytical reports and dashboard development. Now, for analytical reports and dashboard development, source of data is very important. Power BI is flexible enough to consume data from variety of data sources.

We can also develop Power BI Reports & Dashboard using Wikipedia as the source of data. Let’s create a report consuming Notable firms in India.


We will develop this report in Power BI Desktop. First, we need to connect to data source in Power BI Desktop.

Connect to Data Source (Notable firms in India):

1. Open Power BI Desktop, and click “Get Data”:

2. Select “Web” as data source and click “Connect”:

3. Specify Wikipedia Page URL and click “OK”:

4. Select appropriate Page URL and click “Connect”:

5. As we want to develop report for Notable Firms in India, load the data for “Notable Firms”:

So, now data is loaded to Power BI Desktop.


Develop the Report (Notable firms in India):

We will develop the report that will help us to visualize the companies by industry and headquarters location.

1. Select a Pie Chart from Visualizations and configure as shown in below image so that we will be able to get company count by industry:

2. Select Slicer Tool and configure as shown in below image so that we will be able to filter the data by company headquarter location:

3. Select a Matrix and configure as shown in below image to display the data:

4. Select a Stacked Column Chart and configure as shown in below screenshot so that we will be able to see visual of companies by headquarter location:

5. Now, we have configured the visuals and report will appear as shown in below image:

 We can use Pie Chart, Slicer and Stacked Chart to filter the data by Industry and Company Headquarters Location.

Publish the Report (Notable firms in India):

 We can publish the developed report to web. To publish the report to web, we must have Power BI account. If you don’t have account, you can sign-up here.

1. Click “Publish” in ribbon bar and sign in as your account in Power BI Desktop:

2. Enter your credentials and click “Sign In”:

3. Select “My workspace” as destination to publish the report.

4. So, report is published to Power BI web. Please click the provided link to open the report on web.

5. Report is opened now on the web:


 For anonymous access to this report, I have created embed code and hence if you wish, you can access this report here.

If you have any questions you can reach out our SharePoint Consulting team here.

March 9, 2017

Add/Move SharePoint 2013 farm Search Topology in Single or Multiple Search Servers using PowerShell

SharePoint 2013 farm provides Search Topology that comprises Admin, Crawler, Content Processing, Analytics Processing, Query Processing and Index Partition.

  • Search Administration Component administers new instances of Search components and Search processes.
  • Search Crawler enables us to crawl all the content in our site thereby allowing us to retrieve results via SharePoint Search. 
  • Search Content Processing allows us to process different types of contents and indexing them in a single index.
  • Search Analytics Processing component of Search topology deals with analytics related stuffs. It carries out search analytics and usage analytics.
  • Search Query Processing component handles incoming queries and returns suitable results.

Scenario 1: If you want to move SharePoint 2013 farm Search Topology from one server (e.g. Server1) to another (e.g. Server2), then follow below mentioned steps:

Prerequisites:
 - Search service application must be created and configured in the farm.
 - Search Topology must have been configured in Server1.
 - Server2 must be part of  SharePoint 2013 farm.
 - Ensure that no search crawl is running and search index is empty.

Connect to any of your SharePoint 2013 farm server and run SharePoint Management Shell as an Administrator. 

Run below given commands in SharePoint Management Shell one by one :

$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "Server2"
# Note: "Server2" is new server name, where we want to move Search Topology.

Start-SPEnterpriseSearchServiceInstance -Identity $hostA
Get-SPEnterpriseSearchServiceInstance -Identity $hostA
$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostA -IndexPartition 0
Set-SPEnterpriseSearchTopology -Identity $newTopology
Get-SPEnterpriseSearchTopology -SearchApplication $ssa
Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text

Finally, Search Topology will be migrated from "Server1" to "Server2", and you will be able to see Search Topology components in "Server2".

*After moving Search Topology to new server, start full crawl to get search results.

Scenario 2: If you want to add an additional search server (e.g. Server2),  along with existing search server -- Server1, then follow below mentioned steps:

Prerequisites:
 - Search service application must be created and configured in the farm.
 - Search topology must have been configured in Server1.
 - Server2 must be part of  SharePoint 2013 farm.
 - Ensure that no search crawl is running and search index is empty.

Connect to any server of SharePoint 2013 farm and run SharePoint Management Shell as an Administrator. 
Run below given commands in management shell one by one :

$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "Server2"
# Note: "Server2" is new server name, which we are going to add.

Start-SPEnterpriseSearchServiceInstance -Identity $hostA
Get-SPEnterpriseSearchServiceInstance -Identity $hostA
$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostA -IndexPartition 1
# Note: For Adding second Search Server Topology, we must have to give -IndexPartition as 1. Because, "Server1" would already have 0 as IndexPartition.

Set-SPEnterpriseSearchTopology -Identity $newTopology
Get-SPEnterpriseSearchTopology -SearchApplication $ssa
Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text

Finally, You will be able to see newly added search servers in SharePoint 2013 farm.

*After adding an additional search server in SharePoint 2013, start full crawl to get search results.

Scenario 3: If you want to add multiple search servers (e.g. Server1 and Server2) at a time, then follow below mentioned steps:

Prerequisites:
 - Search service application must be created and configured in the farm.
 - Server1 and Server2 must be part of  SharePoint 2013 farm.
 - Ensure that no search crawl is running and search index is empty.

Connect to any server of SharePoint 2013 farm and run SharePoint Management Shell as an Administrator. 

Run below given commands in management shell one by one :

$hostA = Get-SPEnterpriseSearchServiceInstance -Identity "Server1"
$hostB = Get-SPEnterpriseSearchServiceInstance -Identity "Server2"
# Note: "Server1" and "Server2" are new servers, which we are going to add.

Start-SPEnterpriseSearchServiceInstance -Identity $hostA
Start-SPEnterpriseSearchServiceInstance -Identity $hostB
Get-SPEnterpriseSearchServiceInstance -Identity $hostA
Get-SPEnterpriseSearchServiceInstance -Identity $hostB
$ssa = Get-SPEnterpriseSearchServiceApplication
$newTopology = New-SPEnterpriseSearchTopology -SearchApplication $ssa
New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostA -IndexPartition 0

New-SPEnterpriseSearchAdminComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchContentProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchAnalyticsProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $newTopology -SearchServiceInstance $hostB
New-SPEnterpriseSearchIndexComponent -SearchTopology $newTopology -SearchServiceInstance $hostB -IndexPartition 1
# Note: For adding an additional search server in farm, we must give -IndexPartition 1

Set-SPEnterpriseSearchTopology -Identity $newTopology
Get-SPEnterpriseSearchTopology -SearchApplication $ssa

Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Text

Finally, You will be able to see newly added search servers in SharePoint 2013 farm.

*After adding an additional search server in SharePoint 2013, start full crawl to get search results.

If you have any questions you can reach out our SharePoint Consulting team here.