Entries from February 1, 2011 - February 28, 2011

Monday
Feb282011

SharePoint central administration tip - use those resource links

Some of the service application administration pages in SharePoint 2010 are incredibly hard to get to.

Hands up who knows - in their head right now, without checking their central administration: how to get to User Profile Service Application, or Search Administration page?

For those of you that don't want to be hunting for the link - find them once, and add them to the Central Administration Resources links on the right hand side of the landing page.  There's a big empty links web part there waiting to be used!

 

image

 

I should probably give them better names.

Thursday
Feb242011

Can't save SharePoint 2010 site as template with a library called Forms

Error exporting the list named "Forms" at the URL: Forms

 

I have problems this afternoon saving a very small site as a template for deploying, and was getting the above strange error.

 

Workaround: Using SharePoint designer, browsing via All Files - rename the Library "Forms" to something else - "TravelForms"

You can now save the site as a site template.

 

The old stories are still true - don't use research words for your content.

Wednesday
Feb232011

SPD 2010 conditional formatting to hide columns based on a related column in the list

I was discussing hiding columns using SharePoint Designer 2010 and thought I'd dig into the UI a bit more to see if there are any special tricks, as well as how it works with inline editing.

Here are the steps.

 

Set up ConditionalList

  1. Create a list with "MyCondition" - checked box
  2. MyExtraInfo - text

When adding a new item, we have:

image

 

Drop into SPD - modify AllItems.aspx

 

image

 

If your list is currently empty and you don't have any rows right now, show some sample rows, so you can add conditional formatting to the data.

image

 

Select the field, then create a conditional formatting on that field.

image

 

Set the condition

image

OK, then save everything.

 

Go back to the list

image

 

The field is now hidden.

 

Inline editing

 

Enable inline editing in SPD

image

 

Check my condition, and click save (floppy disk)

image

 

Field is hidden again.

image

 

Sorry for confusing "Bakai", hope this helps.

Wednesday
Feb232011

Windows 7 SP1 login screen

In my opinion, if the Windows 7 SP1 login screen had looked like this, it’d be a lot better. Microsoft seems so… uncool sometimes.

login screen

 

For comparison, Windows 7 and Windows 7 SP1 both look like this:
Try spotting the difference.

login%20screen

Wednesday
Feb162011

Office - fixing the repairing problem when opening Word or Access

I spend the evening hunting down why every time I run Office 2010 in my demo machine, it would first launch configuration...  Always configuring...

After a few attempts at reinstalling that doesn't seem to lead anywhere, I decided to read the registry and see if there's some residue key that's causing problems.

While I didn't find the key, I did find a few very suspicious looking keys that it was requesting, right before launching into the Configuration Wizard (again).

 

NoRereg DWORD

For Word, Excel, PowerPoint... and most of Office:

Create a DWORD NoRereg=1

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Options
NoRereg=1

 

NoRepairNeeded KEY

For Access:

Create a KEY NoRepairNeeded.  I don't seem to need to add any default values or any other values in the key.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access\NoRepairNeeded

Tuesday
Feb152011

SharePoint 2010 Branding tools

About to head off to a client to do about a week’s branding work.  I was loading my SharePoint laptop with all the tools that I think I’ll need.  I thought I would publish the list as well.

 

Designer tools

  • SharePoint Designer 2010
  • Browser: IE 7, 8 or IE9
    • With IE Developer toolbar (in IE8 and IE9 this is built in)
    • Later versions of IE has compatibility modes and can render SharePoint in IE6/7/8 modes.  Strictly speaking this is no substitute for using the corresponding version of IE that your client is using – but you should aim to have a clean HTML that will work anyway.
  • Browser: FireFox (latest stable)
    • With FireBug – you need a stable version of FireBug, so I don’t recommend using the latest alpha/beta FireFox.
    • (Optional) YSlow
  • Browser: Google Chrome
    • Google developer tools are built in
  • Paint tool:
    • (Optional) Adobe Photoshop
    • Paint.NET
  • CSS tool:
    • (Optional) Expression Studio
  • (Optional) Office 2010 Client Applications
    • Is necessary to check various components and menus that only appear when you have the corresponding ActiveX.  In general, if you have SharePoint Designer 2010 installed you should have most components already.

 

Packaging tools

  • Personal SharePoint 2010 VM
  • Visual Studio .NET 2010
    • CKS Dev
    • SharePoint Powertools for Visual Studio .NET
  • Reflector
  • ULS Viewer
  • Fiddler 2
Tuesday
Feb152011

InfoPath exception occurred during loading of business logic for central published form

 

This is a really strange one.  I can’t fully explain it, but I totally stumbled upon a workaround.

  1. I publish an InfoPath form with domain trust through central administration.  It pushed my form into a form template for my site http://myserver/ 
  2. I try to create a new form in a forms library based on that published template.
  3. I get an error when I try to load the new form in Forms Service:

There are various errors in the event log and the log.  Event Log says:

An exception occurred during loading of business logic. (User: SHAREPOINTGURUS\john.liu, Form Name: MyForm, IP: , Request: http://myserver/_layouts/FormServer.aspx?XsnLocation=http://myserver/FormServerTemplates/MyForm.xsn&SaveLocation=http://myserver/Forms&Source=http://myserver/Forms/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:MyForm:-myXSD-2010-11-14T21-46-49, Type: FileNotFoundException, Exception Message: Could not load file or assembly 'file:///C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\FT-01-3032e4bd-bd7f-61d1-42aa-f9786a132aee\MyForm.dll' or one of its dependencies. The system cannot find the file specified.)

 

In you drill into the various errors you’ll see actually there appears to have been an error during the deployment of the form, thus the form actually haven’t been deployed properly.  What’s really strange though, is this fix that I came across and can’t explain.

 

Fix?

  1. Go to Library Settings for http://myserver/Forms/
  2. Since you are using central admin deployed forms – you should be using Content Types, I only have Forms content type here.  Click that.
  3. Then click Advanced Settings
  4. Check the Form content type’s Form Template URL in the advanced settings.  In my case it is still pointing to the file in /Form Templates/
  5. Don’t change anything - Click OK
  6. Suddenly I can create new forms again in /Forms/
Tuesday
Feb082011

Giving SharePoint a Silverlight Metro UI facelift!

 

image

My little baby's coming together.   I can't wait.

Tuesday
Feb082011

SharePoint's Silverlight webpart defaults to WindowlessMode

 

Because SharePoint’s Silverlight webpart defaults to windowless="true", there are some features of Silverlight that won’t work as you’d expect out of the box.

  • Drag and drop events
  • Transparency
  • Overlay DIV

By default, it renders something like this:

<object id="SilverlightObjectTag_xxx" data="data:application/x-silverlight-2," type="application/x-silverlight-2" style="display:block" height="100%" width="100%" class="ms-dlgDisable">

<param name="source" value="/sites/Home/Style Library/SilverlightCamera.xap"/>

<param name="onerror" value="…" />

<param name="background" value="white" />

<param name="initParams" value="…" />

<param name="windowless" value="true" />

 

Luckily, the SharePoint team provides an easy property to override this value.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.silverlightwebpart.windowlessmode.aspx

When packaging your Silverlight .webpart file, configure the XML to set the WindowlessMode property to false.

<?xml version="1.0" encoding="utf-8"?>
<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name=
"Microsoft.SharePoint.WebPartPages.SilverlightWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name="Title" type="string">Silverlight Metro UI Web Part</property>
        <property name="Description" type="string">Metro UI.</property>
        <property name="Url" type="string">~sitecollection/Style Library/Metro.Demo.xap</property>
        <property name="Height" type="int">800</property>
       <property name="WindowlessMode" type="bool">false</property>
      </properties>
    </data>
  </webPart>
</webParts>

 

Then the rendered HTML will have the value set appropriately, and Silverlight drag and drop events will work happily again, in SharePoint.

Thursday
Feb032011

InfoPath 2010 COM Add-ins not available in Form Design

In a previous life, I wrote Outlook and Word Add-ins to automate/extend those office apps.

I was looking up whether there’s a way to script or create a COM Add-In to InfoPath during Form Design, so we can do 1-click refresh/update all secondary data connection offline data, without manually clicking wizards. Or even hook into some sort of OnPublishing event so it does the update automatically when you are about to Publish the form.

INTERESTING…

You can write COM Add-in for InfoPath 2010! Apparently new in 2010.

BAD!

Can’t extend the InfoPath form designer. Can only extend the editing. But that means you have more deployment issues.

http://msdn.microsoft.com/en-us/library/aa946869.aspx

How to: Create a COM Add-in to Add Custom Features to InfoPath

Office 2010

Microsoft InfoPath 2010 supports COM Add-ins for extending the form editing user experience. Although support for COM Add-ins was first added in InfoPath 2010, other Office applications such as Microsoft Office Word and Microsoft Office Excel have supported COM add-ins since Office 2000.

COM Add-in support in InfoPath is available for the form editing environment. The form design environment cannot be extended by using COM Add-ins.

Did MS ran out of time?