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.