dataBridge > dataBridge Sharepoint Tips Blog
dataBridge Sharepoint Tips Blog
March 19
SharePoint 2013 Foundation - Secure Store Service to be Removed

In the initial release of SharePoint 2013, the Secure Store Service was said to be available in Foundation, according to a TechNet article.  The Secure Store Service was even listed as an option under New Service Applications in the Central Administration.  That being said, the Secure Store Service does not work in SharePoint 2013 Foundation.  Microsoft has just closed a case that we opened months ago.  The official decision, as it stands now, is that the Secure Store Service will be removed from SharePoint 2013 Foundation in a future hotfix or service pack.

This makes the Business Data Connections (Business Connectivity Services) much more difficult to configure.  Without setting up Kerberos, the secure store service was the way to get around the double-hop issue from one system to another.
In SharePoint 2010 Foundation we often installed the free Search Server Express.  This enabled the Secure Store Service, allowing easy BDC/BCS connections.  This was a big capability for a free product.  There are major Search upgrades in 2013, with the server search being available in Foundation and FAST search becoming the new server default.  This change has made Search Server Express disappear meaning that to easily leverage the BDC/BCS, the server edition of SharePoint is required.
We see this as a major functionality loss and are disappointed at Microsoft’s decision on this matter.
Brandt Fuchs -
Vice President of Operations
February 21
SharePoint 2010 – How to Create Custom XSLT Horizontal Bar Charts

Recently, one of our clients requested that we display a dashboard view of active projects which included a requirement for a horizontal bar chart depicting the percentage of the available budget used for each of their various projects/initiatives.

 

To facilitate this request, a column was added to the projects list which allowed the client to enter a two-digit number to represent the percentage of the budget that had been used, and then go back to the list item and update the budget amount as needed. To help simplify this example, the screen shot below is a custom web part displaying just the project name and budget percentage used.

 

 

 

This blog will walk you through the steps required to create a custom XSLT web part which will dynamically display a horizontal bar chart filled to the budget percentage specified in the list:

1.  To get started, insert an empty data view and connect to the list which contains the budget information for the projects/initiatives

 

2.  Next, select the column which stores the budget information and add it to the web part as a "single line item" to get something similar to the example below

 

 

3.  Now you will want to adjust the custom web part and insert a new column between the column label and column value that were automatically added when you inserted the data from the data source; an example is shown below with the code

 

 

4.  For this demonstration, we will be using a grey background to show the full width of the bar chart and blue color will fill to the percentage specified by the budget column 

  •  A snippet of the grey background is shown below, and the blue color will use the hexadecimal code of #2f63c2

 

 

5.  Now we can insert this grey background into the column using the code below, which results in the updated screen shot of the custom web part also listed below

6.  As you can see from the code below, we are setting a class for the div, floating the image left, specifying that the div's width is 100%, setting a transparent background, and repeating the grey bar snippet along the x-axis to fill the background as grey:

<div class="exampleBarChart" style="float:left; width:100%; background:transparent url('/HR/images/graphBackgroundGrey.png') scroll left top repeat-x;"> </div>

 

7.  Now we can add the code to fill the bar chart to the specified percentage from the budget column, which is accomplished by adding the code below into the div we just created for the grey background:

<div style="width:100%; background-color:#2f63c2; height:17px;" />

 

8.  Now to make the bar chart fill blue for the percentage specified by the budget column, we will replace the width of "100%" with {@Budget}%

  • Simply replace @Budget with your column value and be sure to add the % after the {}s

 

9.  Unfortunately, that does not accomplish our goal because the blue is simply filled in all the way across as shown below

 

10.  This is because the value of @Budget is coming across as "## %" and the system is not recognizing the string as a numeric value

 

11.  To correct this, a simple adjustment to the @Budget value is required using a substring-before command to isolate the numeric value and provide it as the width; the code for this is shown below:

12.  Success! Now we are getting the value we need for the system to understand that we want the width to be filled to a percentage specified by the @Budget value, and the results are shown below:

 

13.  A few final adjustments are needed to replace the generic "budget" with the actual project/initiative name, adjust the widths of the columns, and add bold styling to the project name and budget amount results in the final product shown below:

 

14.  As a quick exercise, I will adjust the percentage budget for "test project #6" and will create an item for "test project #7" to demonstrate that the bar charts are dynamically populated based on the latest update to the budget column:

 

 

15.  Here is the new list:

 

16.  And here is the new custom XSLT bar graph web part:

-
February 11
Creating Free Digitally Signed Certificate for InfoPath Code Solutions

These steps will allow you to create a certificate for free, that will last for a couple years, so that you will be able to publish custom code to your InfoPath form.

All Programs > Microsoft Office > Microsoft Office 2010 Tools

11.jpg
Give Descriptive Name to Certificate click OK and open up InfoPath Form

Apply Certificate by clicking Select Certificate under Security and Trust Tab - Form Options > Security and Trust > Select Certificate.

Also Make sure below settings are checked (set to Full Trust, Sign this form Template)

22.jpg

Install certificate

44.jpg

Select browse and place Certificate in the “Trusted Root Certification Authorities” Store 

55.jpg

Dylan Skinner -
Design & Development
February 01
Cross Browser Support for SharePoint 2010 Public Site Branding
When building a public facing website in SharePoint 2010 it is important that the site function properly in all major browsers. Ordinarily with Intranets the company is accessing the site almost exclusively in Internet Explorer as it is the only browser that supports all OOB (Out-of-the-Box) functionality. However, with public facing sites you have no control over what browser the user will be using to access the site. Internet Explorer, Mozilla FireFox, Safari, and Chrome are the “big 4” and it is reasonable to build a public site with support for these browsers in mind.

Use a Minimal Master Page

When you begin to build out your public facing site it is best to start with a minimal master page. While a minimal master will strip out a large amount of SharePoint’s OOB functionality this is the desired result as much of that functionality will not be used in a public facing website. This initial step will save you time later when you are attempting to troubleshoot branding issues across browsers by eliminating the possibility of superfluous structure and functionality causing problems. You can find a copy of a widely used minimal master by visiting CodePlex and downloading the file provided.

Conditional Comments are your Friends (In IE)

When troubleshooting CSS issues that affect IE specifically it can be tempting to use CSS Hacks to target and solve the issue. However, it is not recommended that you use CSS Hacks unless absolutely necessary, rather it is best practice to avoid them at all costs. The main reason for this is that CSS Hacks can break due to a browser update rendering the fix put in place useless. Alternatively, conditional comments are safe to use and allow for you to easily target different versions of IE using separate CSS files for each version needed. Conditional comments behave just like simple HTML comments, but they have a specific syntax that IE/Win browsers can recognize. When that syntax is exactly correct, IE will look inside the comment and parse whatever is inside. Below is an example of what the conditional comments would look like in the header of your master page. 

1.jpg

You might be wondering why you would break the CSS into separate files for each version thus leading to multiple http calls and potentially affecting performance. In fact there is a better alternative solution that involves replacing the html tag with a different one depending on what version of IE is loaded that looks like this:
2.jpg

The problem with this solution is that unfortunately this can cause potential problems in SharePoint that otherwise may not occur in normal web development. This is especially true in dialog boxes which use a different html header than the rest of the site and if replaced the dialog box will lose much of its functionality. Which it is why it is best to use separate CSS files when you are troubleshooting IE problems.

JavaScript/jQuery can Work in a Pinch

If you find yourself needing to target other browsers, like Firefox for example, there is an alternative to CSS hacks that you can be sure will always work. However, there is downside to utilizing JavaScript to correct or fix css issues. Since JS is client side script it will not run until the user has loaded the page and more often than not it will execute only after the rest of the css has been loaded. Which is why, even though this is a possible solution it is best to not become dependent on it. Also refrain from using this script to fix big problems that will make the change obvious when the page loads.

In order to target a specific browser using jQuery you will need to reference the jQuery library on your master page or page you will be using the script, this can be downloaded here. In the jQuery library there is a property “$.browser” this property enables you to detect what browser your page is being loaded in and take appropriate action. For example if we wanted to load css whenever our site is loaded using Firefox the code would look like this: 

3.jpg

As a Last Resort, Use Hacks

More often than not if you use conditional comments to target IE, the branding should function properly in all other browsers as they are standards-compliant. However, sometimes there is no getting around using CSS hacks, especially when building on a platform like SharePoint that does not offer full functionality across all browsers. For instance, let’s say you’ve taken care of all the bugs in IE, Firefox, and Chrome but there is just one bug in safari where a div is not aligned properly. You can’t use JS in this situation because chrome and safari are both built off of “webkit” thus any fix in JS will affect Chrome as well. So then you are left with one option, CSS hacks which when used properly and sparingly can be very useful.

Below is a comprehensive list of CSS Hacks for modern browsers currently in use:

 IE6 and below   - 
html #uno  { color: red }

IE7 -  :first-child+html #dos { color: red }

 IE7, FF, Safari, Opera  -  html>body #tres { color: red }

 IE8, FF, Safari, Opera (Everything but IE 6,7)  -  html>/**/body #cuatro { color: red }

 Opera 9.27 and below, Safari 2 -  html:first-child #cinco { color: red }

Safari 2-3 -  html[xmlns*=""] body:last-child #seis { color: red }

Safari 3+, Chrome 1+, Opera9+, FF 3.5+ -  body:nth-of-type(1) #siete { color: red }

Safari 3+, Chrome 1+, Opera9+, FF 3.5+ */ -  body:first-of-type #ocho {  color: red }

Saf3+, Chrome1+ - @media screen and(-webkit-min-device-pixel-ratio:0){ #diez  { color: red  }}

iPhone/mobile webkit - @media screen and(max-device-width:480px){#veintiseis{color: red}}

Safari 2 - 3.1 - html[xmlns*=""]:root #trece  { color: red  }

Safari 2 - 3.1, Opera 9.25 - *|html[xmlns*=""] #catorce { color: red  }

Firefox only. 1+ - #veinticuatro,  x:-moz-any-link  { color: red }

Firefox 3.0+ - #veinticinco,  x:-moz-any-link, x:default  { color: red  }

I hope this helps you better tackle potential branding issues that you come across as you attempt to brand a public facing site. However, using these tools and hacks should not be your immediate reaction to fixing a problem you come across. Always be sure that your HTML structure and CSS has correct syntax and is not broken before you attempt cover it up with Conditional Comments, JavaScript, or CSS Hacks.

Matt Metcalf -
Design & Development
January 29
Property Promoting Text Fields to Form Libraries in SharePoint/InfoPath 2010


When creating InfoPath forms on a SharePoint 2010 site and publishing them to Form Libraries, there are many times when having the text data only within the form does not suffice.  Example situations include:

·       Needing to view the text in a web part without having to open the form

·       Passing the text to another list

·       Including the text in a workflow e-mail

·       Making the text available in search results

There are of course many other scenarios that could be added to this list, but these are the most common in my experiences.  In order to satisfy these types of requirements, the text fields from within InfoPath must be “Property Promoted” to the SharePoint form library.  This can be set up from either the Form Options or Publish options under the File menu in InfoPath Designer.

SharePoint Consultants.jpgSharepoint Training.jpgSharePoint Experts.jpg

Promoting properties or fields in InfoPath to the SharePoint form library creates fields/columns in the column.
  These fields are somewhat special in that they can only be updated by InfoPath when an instance of the form is submitted (unless you are using content types and map the InfoPath fields to the Content Type field, but that is the topic of a different blog.)

Keeping all of this in mind, the only time a normal text field SharePoint Hosting.jpg
should be used when property promoting the field to the SharePoint form library is if you know that more than 255 characters will never be entered.  A normal text field in InfoPath holds as many characters as you would like in the form, but when property promoted it is created as a single line of text field so it only holds 255 characters. If you have more text than that in the field it will just truncate at 255 with no warning or error message. If you want to property promote a text field that may contain more than 255 characters, you must add it to the InfoPath form as a Rich Text Field. SharePoint Development.jpg
This will be created in the form library as a multiple lines of text field when property promoted (although will still only be plain text, but again this is the topic for a different blog).​

 

Peter Hill -
Solutions Architect
December 20
Creating Custom Roll-Down Data View Web Part – SharePoint 2010

Have you ever wanted to display items from a list or library on the root site on one or more of your subsites? An out-of-the-box solution is the Content Query Web Part, but that is very limited for styling and applying custom features. Instead, use a Data View Web Part. Here are the steps needed to accomplish that:
 
1.     First thing you need to do is setup your data source
 
2.     Open the root site in SharePoint Designer 2010, and select “Data Sources” from the menu on the left
    Roll down Data View Web Part 1.png
3.     Click on “SOAP Service Connection”
 
                           Roll down Data View Web Part 2.png
4.     In the “Service description location:” field, enter http://(server)/_vti_bin/lists.asmx (replacing (server) with your specific server/site information)
                Roll down Data View Web Part 3.png
5.     Click on “Connect Now” to establish the connection
Roll down Data View Web Part 4.png
6.     Once the connection is made, the Data Source Properties dialog box will become populated with additional details.
 
7.     Then select “Get List Items” from the “Operation:” drop down list.
     Roll down Data View Web Part 5.png
8.     What you need to do now is find the ID for the list or library you’d like to connect to.
 
9.     To find the ID, click on “Lists and Libraries” from the menu on the left.
          Roll down Data View Web Part 6.png

10.  Then select the list or library you’d like to connect to in order to display the list information.
 
11.  You need to copy the “List ID:”, as shown below
  Roll down Data View Web Part 7.png

12.  Now, with your List ID in hand, you can finalize the data source connection.
 
13.  In the Data Source Properties dialog box, click on “listName” and then choose “Modify”.
 
14.  Here is where you will enter the List ID for the list or library you want to establish the data connection with; once you enter the List ID and select “OK”, your parameters should look something like the screen grab below.
 Roll down Data View Web Part 8.png
15.  Then select “OK” and voila you’ve now created a new data source from an existing list or library.
 
16.  Now, to utilize the data source, navigate to the page you’d like to display the roll down web part
 
17.  Locate the area where it should be inserted and select “Insert” and then “Data View”
 
18.  Scroll all the way to the bottom, and select to insert “Empty Data View”
 
      19.  Next, click on the hyperlink that states “Click here to select a data source”
Roll down Data View Web Part 9.png
20.  Scroll to the bottom of the list and select the new data source connection that you just created (remember to name it appropriately, or you will end up with a generic SP assigned name, as you can see in the example below).
    Roll down Data View Web Part 10.png
21.  Once you connect to the data source, you can utilize the Data View Web Part just as you normally would to style, filter, sort, etc. the items from the list or library.
-
December 11
Hooray for Looping and Copying/Pasting in SharePoint 2013 Workflows

Introduction

Writing SharePoint Workflows in SharePoint Designer 2013 is going to be a big improvement and provide much greater functionality than developers have today in SharePoint 2010. This is due to several reasons that will be listed below, but in particular because of a couple of huge pain points with 2010 that have now been resolved; creating loops and the ability to copy and paste sections within the workflow designer.

Windows Azure

There are also a couple of key changes in the architecture of the workflow model with SharePoint 2013 including a new configuration and use of the Windows Azure Workflow model. Workflows are now treated as a service and no longer run in the content farm and it is no longer a requirement to run on SharePoint WFE / App servers. The SharePoint deployment drives where workflow runs. If hosted in Office 365 they run on the Azure Workflow server and if hosting servers yourself they run within the Windows Azure Workflow Service. This improves stability, scalability and transparency. The diagram below from Microsoft's SharePoint 2013 presentations illustrates this new architecture.



Stages/Looping

SharePoint 2013 introduces what they are calling "Stages" within a workflow that essentially allow for looping and "state machine" workflows that can basically test a condition and then jump to an appropriate section or set of instructions. This allows unnecessary portions of the workflow to be skipped when certain conditions are met and avoids the need for a developer to write separate workflows or test for conditions over and over again in each section to determine if they should run or not. The looping enables developers to say things like, "loop this number of times, or loop as long as this condition is met, or loop as long as a certain expression is true." In 2010 this had to be done with many variables being set within a workflow and within a list item, checking these variables over and over again, and restarting the entire workflow over and over again.

Connecting to Data

SharePoint 2013 also has some major improvements to the ability to connect to data within your site. As most developers know, workflows in 2010 have been limited to looking up data that exists within the same site as the workflow itself. In 2013 workflows have the ability to connect to REST and SOAP services so developers could create their own data connections to just about any list and the workflow will be able to access this data no matter where it actually lives within your site collection.

Interface Options / Copying and Pasting

SharePoint 2013 offers some flexibility in the interface options. A developer can choose to still use the workflow model from 2010 or can use the 2013 platform to take advantage of all these great new features. Developers can also choose to work with a text-based designer view or a visual designer view that provides a Visio interface right within Designer. Whichever view is chosen, copying and pasting is now as easy as selecting the stage, section or line of code, right clicking and choosing copy!

Text-Based Designer

 


Visual Designer

 

Conclusion

All of these enhancements and improvements that Microsoft has made to workflows in 2013 will give developers a lot more power from right within SharePoint Designer without ever having to open Visual Studio. I am looking forward to putting them into action!

 

Peter Hill -
Solutions Architect
November 07
Custom Data View Web Part - Formatting Date & Time – SP2010

In order to compare dates in a custom data view web part, you must first format the date in a way that SharePoint will recognize as comparable. To accomplish this, you will want to display the date in the yyyyMMdd format, with yyyy standing for the year, MM is the month of the year, and dd representing the day of the month (i.e. January 1st, 2001 would be displayed as 20010101, December 31st, 2001 displays as 20111231, etc.).

 

This is quite useful if, for example, you wanted to only display events in a custom data view calendar web part that are current, meaning they are scheduled to occur today or some date in the future. Here are the steps needed to accomplish that:

1.   For this example, let's say after creating the custom data view web part, the date field (@EventDate) displays as MM/DD/YYYY XX:XX AM/PM

        

2.  A little experimenting with SharePoint Designer shows that the Today() function returns the date field formatted as MM/DD/YYYY

    

3.  A small modification to the @EventDate shows that we can return the date to match the format of the Today() function, but that date format (MM/DD/YYYY) will not allow SharePoint to compare them and only display results from today forward as required

4.   So, what we really want to do is return the date for both fields in the format of yyyyMMdd

5.   To accomplish this, the following code shown below was used for each field and the results are displayed in the correct yyyyMMdd format

6.   Now those formatted date values can be used to construct a filter that will only display events on the rolled up calendars that are scheduled to occur on the current date or some date in the future, and no events will display that appear in the past  

7.   Here is a snapshot of the custom data view web part preview from SharePoint Designer, and as you can see there are a number of events that are set to occur in the past (as you probably noticed from the previous steps, the Today() function is returning the date this blog was created, October 25th, 2012)

 

8.   Now, we apply our filter using the newly formatted dates so the web part only displays events that are greater than or equal to the current date:

 

9.   And here are the results after applying the filter, the only events displaying are from today and tomorrow, which is exactly what we wanted

10.   As a quick exercise, I'll try to filter the data without using the formatted dates and see what the results are

11.   Here is the filter

 

12.   And here are the results

 

13.   So, as you can see, it is necessary to format the date into the yyyyMMdd format in order for SharePoint to utilize that date to make comparisons and/or filter correctly

-
September 04
Displaying Enhanced Rich Text from a SharePoint 2010 List within an InfoPath 2010 Form

rich text ribbon - Copy.jpg

We recently had a client who wanted to have a the ability to edit/modify an Enhanced Rich Text field on a SharePoint 2010 list; then, using a data connection, display the Enhanced Rich Text field from that list within an InfoPath 2010 form. Unfortunately when InfoPath pulls the text from the list it strips all HTML tags before displaying the text on the InfoPath form. After a little bit of research, I found the below workaround:

1.      Establishing the Data Connection

   
a.       Before adding any Enhanced Rich Text to the list, you will want to establish the data connection. The key is that you must have the list column set as plain text at the time of establishing the data connection within InfoPath or the HTML tags will be stripped.
b.      Once the data connection has been establish (with the list column defined as plain text), you will then go back to the list settings and change the column back to an Enhanced Rich Text column.
c.       Enter a little bit of styled text to the enhanced rich text column of the list and add a calculated value to the InfoPath form to see what is displayed when the form is previewed; you should see the text and HTML tags within the calculated value field (like the below example):
InfoPath enhanced rich text fields 1.png

2.      Editing the XSL Stylesheet

a.       Now that the HTML tags are not being stripped when the text is imported into the InfoPath form, you must open up xsl source file, and modify the tag that renders the data. First, you will need to export the Form Templates source files: Go FILE > PUBLISH > EXPORT SOURCE FILES (save the source files in a location you can easily access)
b.      Open up the source files you just exported, locate the XSL Stylesheet for your form and open it with a text editor; such as Notepad ++. Hint: The file name is a direct reflection of the View name in InfoPath, so most forms will have an XSL Stylesheet named “view1.xsl”; unless the view name has been changed.
c.       Locate the expression box in the markup. It should look something like: <xsl:value-of select="Example"/>
d.      Add the following parameter to the xsl:value-of tag: disable-output-escaping=”yes”
So the tag will read something like: <xsl:value-of select=”Example” disable-output-escaping=”yes” /> (where “Example” reflects the data source element).
e.      Save and close the XSL Stylesheet.

3.      Republishing the Form and Previewing Changes

a.       Using Microsoft InfoPath Designer 2010, open the manifest.xsf file and republish your form
b.      Once you republish the form and preview it, you should see that the enhanced rich text is rendered as HTML in the form now; instead of being rendered as plain text.
InfoPath enhanced rich text fields 2.png

-
August 08
How to “Disable” Mobile View in SharePoint 2010 Sites

You may have discovered that deploying mobile browsing in SharePoint 2010 is remarkably easy. In fact if you use pretty much any built in site template, tada! You just setup mobile view.

You may also have discovered that getting rid of it, when you don’t want it, is NOT remarkably easy. You can’t just “go uncheck something” in Central Admin.
There are already articles on the web that try to mitigate the issue, and are mostly, if not somewhat effective at it. I will plagiarize them here for your convenience;
Well, no but I’ll provide a link to an excellent article that describes the three main approaches that others have taken;
I will also explain why none of these produced the result we were hoping for. In our case, we had a customer with a public facing site and anonymous access enabled, even to list data.
Later, they decided they did not want anonymous mobile browsers to be able to access all site content. In fact they simply asked us to disable mobile view. No, I mean disable it, not merely micro manage the mobile browser redirect behavior in such a way that a mobile device would land on the standard view. They wanted it OFF, to go away, to cease to exist. NO mobile view.
Despite having done all three of the suggested workarounds in the article above. You find that if a user explicitly hits the <rooturl>/m or <rooturl>/?mobile=1 URLs in their browser, any browser. They can and will still access mobile view.
So now what?

Well, this is how I deceased the ^/m and ^/?mobile=1 URLs  for this customer. It also takes care of ^/_layouts/mobile/* URLs
First, download and install URL Rewrite;
http://www.iis.net/download/URLRewrite
Start INETMGR site and click on the site on which you wish to disable mobile view. In the center view of the site’s HOME page under the IIS subsection you’ll see a new icon for URL Rewrite.
Open URL Rewrite and click Add Rule(s)… in the upper right corner. Select a blank rule template and click okay.
Fill it out like this;
 disable mobile view img 1.png
Then click Apply in the upper right hand corner.
 
<UPDATE>
WARNING: the below image example is too generic. You should instead at least be as specific as /mobile, don't use /m
 
It later became obvious that using the simple pattern /m as pictured below, will destroy the common use of the //odern alphabet on your sharepoint site...
 
Also, you may have to get very comfortable and familiar with URL rewrite syntax for patterns and conditions to work out any conflicts with pattern matching as your sharepoint site develops.
 
If you choose to use the example below substituting /mobile as a starter, keep in mind that any url that contains /mobile will be rewritten.
 
If, for example, you had a list named 'mobile' it will 403. You've been warned.
</UPDATE>
 
Add another rule with a blank template and fill it out like this;
Disable Mobile View img 2.png
Click Apply.

 

That’s it! You’ve just “disabled” mobile view.

 

-
1 - 10Next
 

 About this blog

 
About this blog
Welcome to SharePoint Blogs. Use this space to provide a brief message about this blog or blog authors. To edit this content, select "Edit Page" from the "Site Actions" menu.