Category Archives: Development

SharePoint Resources by Rackspace

Here is a link to a SharePoint resource centre created by Rackspace. It has got some great tutorials by MVPs and other useful tid bits, enjoy!

Click here.

Advertisements
Tagged , ,

SPCAF public release 1

SPCAF – SharePoint Code Analysis Framework, is in its first public release. It provides a number of options to analyse code against best practices from a number of perspectives and roles (Admins, developers, architects and quality managers) within a SharePoint environment. Here’s some more detail on the release.

Tagged , , ,

SharePoint: InfoPath vs ASPX

Personally, coming from a developer background I always have leaned towards using ASPX as it has provided me with the flexibility to create custom forms when using SharePoint. I think the main reason is the familiarity and there is no learning curve as it is based on something that becomes second nature. But over recent years I have moved away from coding and focussed more on what SharePoint can provide out of the box. InfoPath provides a good alternative for users of all types to create forms quickly and has some rich features which can be utilised. I have always looked at this subject with my ‘developer hat’ on but now as a Consultant/Architect I think the best solution should always win …

Here is a breakdown of the key features and benefits of using each:

http://sharepointsolutions.com/sharepoint-help/blog/2013/08/infopath-vs-aspx-which-electronic-form-is-the-most-useful-in-sharepoint/#!

Happy Reading!

V

Tagged , , , ,

Using Javascript to export a Dynamically created Data view in SP2010

As part of the current project I’m working on, I needed to create a data view which passed a querystring parameter into a data view web part to display filtered data. The idea was to export this data to Excel using the export feature on the office ribbon available on SharePoint 2010.

To create the the view and apply the filter was very simple. I used SharePoint designer 2010, created a new web part page and inserted a data view. I re-arranged my columns and then applied the Query string parameter filter to the view. When I tested the view, it worked nicely. So the next step was to export the data to excel. This didn’t seem to work… so I was left scratching my head…

It seems when you create this type of view using Querystring parameter, on the export to excel function, it loses the value due to a page post back resulting in a blank view. So to get around this I used some Javascript to export the HTML to Excel which I found here. I have extracted the code require below:

<Script Language="Javascript">
function isIE() // Function to Determine IE or Not
{
 return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}

function exportToExcel() // Function to Export the Table Data to Excel.
{
var isIEBrowser = isIE();
if(isIEBrowser== false)
{
alert('Please use Internet Explorer for Excel Export Functionality.');
return false;
}
else
{
var strTableID = "detailsTable"; // It's the Table ID of Table in Webpart
var detailsTable = document.getElementById(strTableID);
var objExcel = new ActiveXObject("Excel.Application");
var objWorkBook = objExcel.Workbooks.Add;
var objWorkSheet = objWorkBook.Worksheets(1);

for (var intRowIndex=0;intRowIndex<detailsTable.rows.length;intRowIndex++)
{
for (var intColumnIndex=0;intColumnIndex<detailsTable.rows(intRowIndex).cells.length;intColumnIndex++)
 {
  if(intColumnIndex != 3)
  objWorkSheet.Cells(intRowIndex+1,intColumnIndex+1) = detailsTable.rows(intRowIndex).cells(intColumnIndex).innerText;
 } 
}
objExcel.Visible = true;
objExcel.UserControl = true;
}
}
</Script>

<button onclick=”exportToExcel();”>Export to Excel File</button>

To find the table Id click here

So this worked, but there is a few gotchas:

  • This will only work in when using IE
  • You will need to set your browser to Allow Active X controls
  • You will need to have Excel on your machine 😉

Thanks to the guys on MS SharePoint forums!!

Tagged , , , , , , , , , ,

“The workflow could not update the item, possibly because one or more columns for the items require a different type of information” – SharePoint 2010 Workflow error

I came across this error when I was testing a workflow built using SharePoint 2010 Designer: 

‘The workflow could not update the item, possibly because one or more columns for the items require a different type of information’

SharePoint Designer workflows (in my experience) don’t really provide any meaningful error messages. So I did a quick google (as you do 🙂 ) and found this article –

http://antclegg.blogspot.co.uk/2012/01/workflow-could-not-update-item-possibly.html

It described the problem I was having so I tried the resolution and hey presto, it worked!!

It basically suggests rather than using an Update List Item Action on the current list, use the Set Field in Current Item Action as it prevents Sequential workflow errors.

Thanks to Anthony Clegg and Happy workflowing!

Tagged , , , , , , , ,

BizTalk 2010 R2 & Cloud Computing ….

I was looking around the web for news of the latest version of BizTalk (I know I’m a little late to the game) and came across this lovely article:

http://blogs.msdn.com/b/biztalk_server_team_blog/archive/2011/12/08/biztalk-server-2010-r2.aspx

It highlights the three focal points for BizTalk Server 2010 R2 (I’m sure they will change the name to suit the actual release year…) listed below:

  • Platform Support – Supporting new and current server and development platforms
  • Improved B2B – Aligning with industry standards and continuing to invest in performance improvements
  • Ready for the Cloud – Enabling customers to take advantage of the benefits of cloud computing

The first two are a common scenario as Micrsoft tend to build and improve on what already works well. The last option is an interesting development but not unexpected. I am looking forward to seeing how BizTalk will adapt to cloud computing. Watch this space for more news!

 

Tagged , , , , , ,

Removing Rogue WebParts – SharePoint

When adding web parts to a page (especially custom developed web parts), the page can stop working due to errors in the web part. I have expereinced this many times when you install a web part for the first time. Deleting or removing the web part can be difficult when this type of error occurs. Fear not, there is a back door, to removing this rogue web part. On the end of the URL of the page add “?contents=1”. This will bring up a maintenance page allowing you to close or delete the web part that has not worked as intended.

Happy SharePointing Y’all 🙂

Tagged , , , , ,

Getting the Current User Name or ID in SharePoint using SharePoint Designer (no code)

So there I was, a project purely to be developed without code, a former coder’s worst nightmare! I came across a slight issue where I needed to allow certain users access to edit fields on a form and others to view. The following article helped a bundle:

 http://blogs.msdn.com/b/joshuag/archive/2008/06/03/getting-the-current-user-name-or-id-in-sharepoint-using-sharepoint-designer-no-code.aspx?Redirected=true

It was written for SharePoint Designer 2007 but still applies for 2010 🙂

Thanks to Josh Gaffery …

Tagged , , , ,