Friday, February 8, 2019

SharePoint - Building What You Want How You Want. (Using SharePoint as a web host)

SharePoint OOB

SharePoint out of the box provides a rich toolset to allow you to build a web based system with lists, document libraries, content pages and custom elements.  If the project or issue you are working on fits well with the toolset, you have deep knowledge of SharePoint, and if you have a pliable client who is willing to tweak processes to work with SharePoint, then you have a fast functional solution package.

However, using the out of the box components of SharePoint restricts you in both functionality and look and feel.

One of the typical starting points of new projects is a wireframe, approved by the client and ready to replicate.  Trying to replicate a custom wireframe in SharePoint however can be very challenging and require changes to master pages, site layouts, and other elements to obtain a certain look and feel.  And if it includes HTML5 dynamic elements and other current web technologies, out of the box SharePoint may not support it at all.

SharePoint is most efficient and powerful when you can use the out of the box components, but customization can end up taking more time than developing a system a different way.


SharePoint Development

One way to handle the challenge of needing custom functionality and appearance is to code the solution in Visual Studio and deploy the resulting package to the SharePoint farm for deployment.  However, this requires a deep skill set, and an environment set up to support release of new applications through SharePoint.  And for smaller projects, the time and effort is also not justified.

So, for a larger scale application that is to be hosted in SharePoint, with a supportive environment, developing using code can be an acceptable way of meeting specifications.

But for smaller applications, a few custom pages, perhaps even a single page based on a precise wireframe, there is another alternative.


Using SharePoint as a Web Host

If you create a blank aspx page for SharePoint in SharePoint designer, you can put any design, any css, and text you wish on that page.  You have, as with any web page, complete control of the design.  You are not restricted by the appearance or functionality provided by SharePoint, you can create the page from scratch.

This means you do not need a .net developer to create the custom page, you do not need the overhead of creating and deploying through the farm, you can simply create a standalone page that exactly meets your requirements.

And if you wish to add css and custom java scripts, you can add those to existing site assets libraries and simply link to them in the head of your aspx page. 

Your page is still protected by the SharePoint permissions model, so you can control access as you would with any SharePoint resource. 

What about functionality?  If you use the SPServices jquery libraries for SharePoint, you can query and update any list that is hosted on the same site in your code.  So, you can create dynamic web pages that are populated using SharePoint lists.  This has the added advantage of allowing end users to modify the content using the list, without having to deal with HTML updates and approvals.

So, instead of using SharePoint's built in toolset, you instead use it more like a web host.  It hosts your web pages and resources, it hosts your jquery and SP services libraries.  It provides and updates dynamic data to your pages.  And it is covered by the SharePoint security model.  This way, particularly for smaller projects or non .net skillsets, you can achieve exactly what you need without being obstructed by SharePoints OOTB functionality.


Create a Stand Alone Web Page

  1. Open SharePoint Designer, open your site that you with to host the page, and select a new aspx page for that site.
  2. Put any css or other resources in the same sites site assets library and link to those libraries in the head section of your new web page. 
  3. Build your page as any web page, you have complete control of look and feel.  Use html5, keyframes and any other web technologies you wish.  Save it and view it.


Add data source

  1. Download the SPServices jquery libraries and put into your site assets library.
  2. Add a link in the head section of your page to the jquery libraries for the two libraries needed, like this:  <script type="text/javascript" src="https://..SiteAssets/jquery.SPServices-2014.02.js"></script>
  3. Using JavaScript and jquery, connect to your supporting lists and extract the data you wish to display on the page.  As we are developing this from scratch, we are not limited to list views or other ways of displaying data, we can build the interface to whatever we wish.


SharePoint Web Page Hosting

So, if you want to be able to create a page from a wireframe, use the latest HTML5 and css tools, and have complete control over functionality, then creating stand alone pages can achieve that functionality with a standard web developer skill set.  No need for the overhead of Visual Studio and application deployment, no need for a .net developer or help from the SharePoint farm team.  You can independently develop and release custom web pages to support your projects as needed.






Monday, June 25, 2018

Configure Visual Studio BIDS to deploy a SharePoint list report to SharePoint (SharePoint 2013)

The ability of Visual Studio Business Intelligence Services to report against a SharePoint list and create a report based on that list is a useful way of presenting data. You can then embed this report in a report viewer web part on a web part page to display. Deploying the report to SharePoint using the built in Visual Studio BIDS tools however can be tricky as it requires coordination between SharePoint site components and the report deployment configuration.

SharePoint needs to be configured in SQL Server Integrated Mode for sql server report deployment. Both of the site collection features "Report Server Integration" and "Reporting" must be enabled on the site collection level. If these are not enabled, you will not be able to create the data connection library and report library needed to support reporting.


Step 1 - Create the report

Open Visual Studio BIDS and create a new report project.  Create a new Shared Data Source that extracts data from the SharePoint list you wish to work on.  Create a new dataset based on that datasource to pull out the fields you wish from that list.  Develop your report locally using Visual Studio and its "preview" feature to complete and test the report.


Step 2 - Set up the SharePoint site repositories

The first component you will need to add is a data connection library.  Add this list type to your SharePoint site.  Navigate to this library and copy the url.  Remove any trailing data after the list name(in bold):

https://your_sharepoint_site/data_connections/Forms/AllItems.aspx

Next, you will need a report library. Add a the report library app type to your site. Copy the URL of the report library again removing the trailing information:

https://your_sharepoint_site/reports/Forms/current.aspx

Step 3 - Configure Visual Studio Deployment and Deploy

Within Visual Studio, right click on the name of your report. Select "properties". This will bring up the Configuration manager for your report project. Here are the configuration properties required to deploy the report to SharePoint:

Overwrite Datasets True
Overwrite Data Sources True
Target Dataset Folder: https://your_sharepoint_site/data_connections
Target Data Source Folder: https://your_sharepoint_site/data_connections
Target Report Folder https://your_sharepoint_site/reports
Target Report Part Folder:
TargetServerURL: https://your_sharepoint_site
Target Server Version: SQL Server 2008 R2 or later

Click the OK button once finished. Right click the project name and choose "Deploy". You will see the progress in the output window of your deployment. Now, navigate to your report library, click on the name of the report, and verify it is working. You can directly use this link on other pages in your site to refer users to this report.


Tricks and Tips

You will sometimes get a permissions error if you deploy a report to SharePoint if you did not specify credentials for the data source. Ensure that your data source has "Use Windows Authentication" selected within the data source properties.

Your reports will not be viewable by other non site admins until it is "Published". Once you have the report deployed and approved by your client (if necessary), navigate to the report library, click the three dots to the right of the report name and choose "Publish a major version". This will make your report viewable by all users who have permissions to your site.

Sometimes you will want to host the report in a webpart page, rather than have the report open directly. To do this, create a new web part page in SharePoint and insert the "SQL Server Reporting Services Report Viewer" located in the "SQL Server Reporting" category. Use the report viewer web part tools to select and embed your report.

Optionally, you can enable remote errors for reports in local mode using the "Site Settings->Reporting Services->Reporting Services Site Settings" site action. Put a checkmark in the box "Enable remote errors in local mode". This will give you a more detailed error message if your report fails.