Tuesday, July 24, 2012

SharePoint 2013 - Excel Interactive View

In almost all custom web apps, as long as a html table returned, there is always the requirement to export the html table to an excel file for reporting purpose. Now SharePoint 2013 has a new feature simplified this and present the data in a popup window called Excel Interactive View.

All you need to add a link above your html table and include a script

I just insert a content editor web part into sharepoint page, then click the "edit html" to add the next code snippet.

<a href="#" name="MicrosoftExcelButton" data-xl-buttonStyle="Small" data-xl-tabletitle="My Table Title"></a>
<table>
   <tr><td>Name</td><td>Price</td><td>Group</td></tr>
   <tr><td>Orange</td><td>2</td><td>Fruit</td></tr>
   <tr><td>Apple</td><td>3</td><td>Fruit</td></tr>
   <tr><td>Cake</td><td>5</td><td>Desert</td></tr>
</table>
<script src="http://r.office.microsoft.com/r/rlidExcelButton?v=1&kip=1" type="text/javascript"></script>

After the page saved, it will be shown in browser like this




And if you click the links, a pop-up page will be shown to give you all the Excel functions such as filter and graphing.



However, if you click the link to show the view in IE8 on a Windows Server 2008 R2 environment, a javascript error is returned, which seems to do with un-supported property for JQuery running on IE8.


Instead, it runs well in Google Chrome.

If you use a different port number rather than 80 to browse in Chrome, you may have the following error,
Error 312: ERR_UNSAFE_PORT

You need to right-click the chrome icon to enter properties, and append the command arguments like,
--explicitly-allowed-ports=yourportnumber at the target.





Thursday, July 19, 2012

.Net 4.5 new features highlight

.Net 4.5 has been released for a month. There are a few interesting findings that would be useful for future work to be noticed.

First, .Net framework 4.5 is only an in-place update. That means when installing 4.5, 4.5 will replace all the assemblies in .net 4.0 and keep the original version number there. Not even like 2.0/3.0/3.5, which is just extension of additional assemblies. There is a good blog discuss the compatbility of .net framework 4.5.

In WCF 4.5,

- add a ?singleWSDL append the svc to to generate metadata in a single WSDL document.
This is very helpful if we need to publish the service to wsdl and distribute it to another team without reference to svc. This happens quite a lot in BizTalk published service

- updates to the XmlDictionaryReaderQuotas class to reduce the likelihood to modify it.
MaxReceivedMessageSize will still need to be set, but all other attributes is max by default.

- Visual studio compiler build will check the service configuration.

- BinaryEncoding now supports compression, this actually provides the best performance that optimized for WCF to WCF communication. So it is not interoperable. MSDN has a detailed document for choosing a message encoder.

- 4.5 add asynchrounous streaming, add the DispatcherSynchronizationBehavior endpoint behavior to the service host and set its AsynchronousSendEnabled property to true.

- When adding service reference, generated client config file will be simplified not specify all the binding attributes.

- The svcutl.exe tool has a /serviceContract switch which allows you to generate service and data contracts from a WSDL document

- Need to have a look this to understand how to access WCF service with Metro style app client

Wednesday, July 18, 2012

SharePoint 2013 Site Settings for publishing

The below is the 2013 site settings, here let us discuss the features and changes in the web design and look and feel sections.


Web design gallaries

Composed looks is a new feature. It is a evolution of themes. Styles can easily defined from Composed Looks Gallery, then it can be selected from "Change the Look".


In the Look and Feel

Design Manager - create minimal master page or covert from existing design



Device Channels - allow users to have different site templates by user-agent substring match



Change the look - show the site with a preview.



Navigation - now it is easily to user terms store for the managed navigations and shown as friendly url. Also by enabling cross-site publishing, you can have a global navigation combined a site collections.



Image rendition - for images to have different versions of sizes bu not add up server storage space. It would be useful for mobile scenario.

*** The blob cache needs to be enabled, so the web.config needs to updated to make it enabled and the folder exists with right permission.
<BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)quot; maxSize="10" enabled="true" />







18 useful sharepoint 2013 preview links

Found this link 18-useful-sharepoint-2013-preview-links

SharePoint 2013 Design Manager

The design manager allows site master page created from existing design. It does not mean the master page will be generated and ready. It saving the developer effort to manually merge the html design into a minimal master page. Also SharePoint 2013 provides Snippets function, which generate the html snippet of sharepoint components.

SharePoint 2013 add a new feature called design channel. By adding rules to match substring from the user-agent, it can return diffeent site design.


To be able to use "Open with Explorer" function to manage the design files, need to make sure on the server, IIS should have the Webdav publishing role installed.



The webclient service also needs to be installed in client pc. The service can be installed by add the "Desktop experience" featue.


In Edit MasterPage, select Convert an HTML file to a SharePoint master page, then select jus uploaded html design file, a same name master page will be converted. This master page is auto matically generated from the original html template file, so it can not be edited, renamed or deleted.

The html file has its own content type. By edit the html file properties, there is a check box to decide wheter the master page is associated to it.


Make sure the html design file needs to be published first, only after that, the master page of the site can be changed to this style.


Even the html is converted into a master page, there still a lot components to be added.
Such as replace the current dummy navigation to SharePoint global navigation.
SharePoint 13 provides this code snippet pages to generate the needed control source for you to update them to the right place in html design. This can be accessed from the top panel of the site preview.




The screen shot shows all the SharePoint controls you can add, also you can customize their styles easily to match the new site design. Then a html snippet will be created.

How to use Snippet gallery and add custom control to Snippet gallery on Ribbon should be another topic to discuss later. 







SharePoint 2013 Public Beta adventure notes - Part 1

It is a perfect time now to record my adventures in SharePoint 2013 since public beta is just out. In this series, it will share the resources I have been using and any issues I met for the exciting new journey.

1. Download the beta installation file here. Please write down the beta testing key in the bottom of the page. The downloaded file is an .img file, which still can be mounted in by VMWare workstation. Also you may want to download the SharePoint Designer 2013 here.

2. Go through all the pptx slides in SharePoint 2013: presentation: IT pro training
That provides a very detailed look to all the new features and changes in SharePoint 2013.

So far the most changes interested to me will be
  • Design manager for converting HTML to master page
  • New product catalog site template
  • The community site for the social feature
  • oAuth support
  • Office web app service change
  • .
  • . and more
 3. SharePoint 2013 installation is very smooth and similar to 2010. Download all the prerequiste and there is no drama to install it.

4. The first thing to try will be the design manager.
And Benjamin Niaulin has already put a tutorial to follow.

Here is the new team site.