<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3573440240682040988</id><updated>2024-09-14T08:26:37.655+02:00</updated><category term="Sharepoint"/><category term="MSSQL"/><category term="FXCop"/><category term="AS2008"/><category term="Eazfuscator"/><category term="ILMerge"/><category term="PowerPivot"/><category term="SSRS"/><title type='text'>xtrm Developer Tips</title><subtitle type='html'>Developer tips for .net, c#, asp.net, sharepoint, sql, olap etc</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-7906706193753243097</id><published>2012-12-05T20:16:00.000+01:00</published><updated>2013-01-21T16:57:14.202+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint"/><title type='text'>Enable CSS3 / HTML5 in SharePoint 2010</title><content type='html'>Ok i guess everyone that works with SharePoint 2010 has been hunting the holy grail of Sharepoint:&lt;br /&gt;
How to enable CSS3 / HTML5.&lt;br /&gt;
&lt;br /&gt;
Or maybe not, but i have, and all the answers i have found so far has failed..&lt;br /&gt;
&lt;br /&gt;
I really can&#39;t understand why SharePoint is so bound to IE8.&lt;br /&gt;
&lt;br /&gt;
Latest version of Chrome / FireFox, they all work like a &quot;charm&quot; in SharePoint with CSS3 support.&lt;br /&gt;
But IE9 made by Microsoft ?? Nope. &lt;br /&gt;
&lt;br /&gt;
Well it works but in IE8 mode only with no CSS3 support, the document mode is forced by the following meta tag in the master page:&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;meta&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;X-UA-Compatible&#39;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;IE=8&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
If you remove the tag, it renders CSS3 &quot;perfectly&quot; in IE9.&lt;br /&gt;
But unfortunately a lot of system functionality starts to fail.&lt;br /&gt;
Like saving a page, cancel out of a save, Peoplepicker starts failing etc.&lt;br /&gt;
&lt;br /&gt;
I found one javascript fix for fixing the people picker.&lt;br /&gt;
But that was really huge and ugly. &lt;br /&gt;
Several other issues still exists, even if you fix that one.&lt;br /&gt;
&lt;br /&gt;
Anyway so far i have noticed that the problems only happens when in edit mode.&lt;br /&gt;
So i decided to switch the IE8 document mode on / off dependant of the page mode.&lt;br /&gt;
Getting everything to work in IE9 mode seems to be impossible for now.&lt;br /&gt;
&lt;br /&gt;
So when in View mode, then remove the IE8 meta tag and render CSS3.&lt;br /&gt;
If not&amp;nbsp;then render the meta tag which will remove CSS3 and make the standard system functionality work.&lt;br /&gt;
There is also a second condition we need to check, we need to&amp;nbsp;check if the page is in web part edit mode.&lt;br /&gt;
If we don&#39;t include the IE8 meta tag in this mode, you are not able to move the webparts within the zones.&lt;br /&gt;
&lt;br /&gt;
Well basically the same situation, both are edits but needs to be handled separately.&lt;br /&gt;
&lt;br /&gt;
I also included a &quot;emergency&quot; fallback, just add ?ie8=1 to the current url if you still need to turn&lt;br /&gt;
off IE9 mode in a page.&lt;br /&gt;
Or ?ie8=0 to turn on IE9 mode in a edit page or whatever for testing.&lt;br /&gt;
&lt;br /&gt;
somesite.com?ie8=1&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: larger; color: red;&quot;&gt;UPDATE 21.01.2012&lt;/span&gt;&lt;br /&gt;
Had to do some changes to the rendering.&lt;br /&gt;
Because if you remove the tag completely then the IE compability mode button is displayed.&lt;br /&gt; And some users tends to click on it and disable the css3 rendering.&lt;br /&gt;
Which of course causes a lot of problems.&lt;br /&gt;
The solution is to always render the tag, but with IE=edge.&lt;br /&gt;
Which basically means the latest version of IE.&lt;br /&gt;
I also rewrote the fallback so that you can decide which IE mode to use:&lt;br /&gt;
somesite.com?IE=8&lt;br /&gt;
somesite.com?IE=9&lt;br /&gt;
somesite.com?IE=edge&lt;br /&gt;
&lt;br /&gt;
So how can we do this (Updated code):&lt;br /&gt;
&lt;br /&gt;
1. Create a new assembly, sign it, add this class:&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;
&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; MyAssembly.UI.WebControls
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.UI;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.SharePoint;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.SharePoint.WebControls;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.UI.WebControls.WebParts;

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; LegacyDocumentModeFix : LiteralControl
    {
        &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Render(HtmlTextWriter output)
        {
            &lt;span class=&quot;kwrd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; documentMode = &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;meta http-equiv=&#39;X-UA-Compatible&#39; content=&#39;{0}&#39;/&amp;gt;&quot;&lt;/span&gt;;
            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; ieMode = &lt;span class=&quot;str&quot;&gt;&quot;IE=edge&quot;&lt;/span&gt;;
            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; queryMode = Page.Request.QueryString[&lt;span class=&quot;str&quot;&gt;&quot;IE&quot;&lt;/span&gt;];
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(queryMode))
            {
                ieMode = &lt;span class=&quot;str&quot;&gt;&quot;IE=&quot;&lt;/span&gt; + queryMode;
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                System.Web.HttpBrowserCapabilities browser = Page.Request.Browser;
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (browser.Browser == &lt;span class=&quot;str&quot;&gt;&quot;IE&quot;&lt;/span&gt;)
                {
                    SPControlMode mode = SPContext.Current.FormContext.FormMode;
                    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (mode != SPControlMode.Display)
                    {
                        ieMode = &lt;span class=&quot;str&quot;&gt;&quot;IE=8&quot;&lt;/span&gt;;
                    }
                    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                    {
                        WebPartManager manager = WebPartManager.GetCurrentWebPartManager(Page);
                        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (manager != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
                        {
                            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (manager.DisplayMode != WebPartManager.BrowseDisplayMode)
                            {
                                ieMode = &lt;span class=&quot;str&quot;&gt;&quot;IE=8&quot;&lt;/span&gt;;
                            }
                        }
                    }
                }
            }

            output.Write(documentMode, ieMode);
            &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.Render(output);
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
2. Include the assembly in your sharepoint project:&lt;br /&gt;
&lt;br /&gt;
Package, Advanced, Add, Add assembly from project output.&lt;br /&gt;
And make it a safe control.&lt;br /&gt;
&lt;br /&gt;
3. Add a reference in the master page:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;asp&quot;&gt;&amp;lt;%@ Register Tagprefix=&quot;Fix&quot; Namespace=&quot;MyAssembly.UI.WebControls&quot; Assembly=&quot;MyAssembly.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=yourassemblykeytoken&quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
4. Replace the meta tag inside the &amp;lt;head&amp;gt; tags in your master page:&lt;br /&gt;
Replace:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;meta&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;X-UA-Compatible&#39;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;IE=8&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
With:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Fix:LegacyDocumentModeFix&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Thats it, deploy.&lt;br /&gt;
CSS3 renders nicely in view mode, and degrades to IE8 mode in edit / new mode&lt;br /&gt;
which is ok for now.&lt;br /&gt;
&lt;br /&gt;
Until SharePoint 2013 comes along ;)&lt;br /&gt;
&lt;br /&gt;
I haven&#39;t tested every functionality in SharePoint with this fix, only the publishing part that i use.&lt;br /&gt;
Some of the site settings functionality, all site actions etc.&lt;br /&gt;
Haven&#39;t found any problems yet..&lt;br /&gt;
&lt;br /&gt;
And i use this control both in&amp;nbsp;my custom masterpage and&amp;nbsp;in my&amp;nbsp;v4 system masterpage.&lt;br /&gt;
&lt;br /&gt;
If you still find something that fails, Please let me know.</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/7906706193753243097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/12/enable-css3-in-sharepoint-2010.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/7906706193753243097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/7906706193753243097'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/12/enable-css3-in-sharepoint-2010.html' title='Enable CSS3 / HTML5 in SharePoint 2010'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-2535106639923497471</id><published>2012-09-29T10:29:00.000+02:00</published><updated>2012-09-29T10:30:20.372+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint"/><title type='text'>Renaming a Term in SharePoint 2010 Glitch</title><content type='html'>I have been working a lot with SharePoint lately, struggling with all kinds of strange problems.
&lt;br /&gt;
So it&#39;s about time to update this blog and share some of my findings.
&lt;br /&gt;
&lt;br /&gt;
Let&#39;s start with renaming a Term in the Taxanomy Term Store.
I found some glitches regarding renaming Terms, so let&#39;s look into this in detail.


&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Prerequisites
&lt;/h3&gt;
Let&#39;s say we have a Termset Named Organization, and a Term named Logistics, like this:
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEionLxtG2M7jL8EtWeuSeb1_ehRHoXsijcRsvptaHKbXrWSwTNN1zshU4YPR1sHc7D2heOnfj_WA8r3AkWbFD4Nb_3mt065DECsgD32PUx1RWDQA9ELixELqy0M6-k3b7NUlnSfi-1L9jPn/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; width=&quot;253&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEionLxtG2M7jL8EtWeuSeb1_ehRHoXsijcRsvptaHKbXrWSwTNN1zshU4YPR1sHc7D2heOnfj_WA8r3AkWbFD4Nb_3mt065DECsgD32PUx1RWDQA9ELixELqy0M6-k3b7NUlnSfi-1L9jPn/s1600/3.png&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
Then we have a List with the following Taxaonomy Fields:

&lt;o:p&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 298px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 5558; mso-width-source: userset; width: 114pt;&quot; width=&quot;152&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 5339; mso-width-source: userset; width: 110pt;&quot; width=&quot;146&quot;&gt;&lt;/col&gt;
 &lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border: 0.5pt solid windowtext; color: black; height: 15pt; width: 114pt;&quot; width=&quot;152&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Field&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #d9d9d9; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; color: black; width: 110pt;&quot; width=&quot;146&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Type&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Organization&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;TaxanomyFieldType&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;OrganizationTaxHt0&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Note&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;TaxCatchAll&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;LookupMulti&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;TaxCatchAllLabel&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background-color: transparent; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;LookupMulti&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/colgroup&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
One document is uploaded and&amp;nbsp;tagged with Logistics like this:
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrPvYIlTlDsXVBRhOG-yMKj0rjoAtOam8rtw_Ouq2PbPCP3gCB8nWim0hrRp65B54C6H9ZBc78NIertSue5AKI9SaJRk3dEEZUr9kjF8mRk-lNy1okKEQNID23RnM586IStjZnFZHyDuVB/s1600/1.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;134&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrPvYIlTlDsXVBRhOG-yMKj0rjoAtOam8rtw_Ouq2PbPCP3gCB8nWim0hrRp65B54C6H9ZBc78NIertSue5AKI9SaJRk3dEEZUr9kjF8mRk-lNy1okKEQNID23RnM586IStjZnFZHyDuVB/s1600/1.png&quot; width=&quot;662&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Getting Field Information&lt;/h3&gt;
Now let&#39;s write come code to Display the Taxonomy Fields for a given ListItem:
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; DisplayFields(&lt;span class=&quot;netclass&quot;&gt;SPListItem&lt;/span&gt; listItem)
{
    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;SPField&lt;/span&gt; field &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; listItem.Fields)
    {
        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;TaxonomyFieldType&quot;&lt;/span&gt; || field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;TaxonomyFieldTypeMulti&quot;&lt;/span&gt;)
        {
            &lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt; taxanomyField = (&lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt;)field;
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (taxanomyField.AllowMultipleValues)
            {
                &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValueCollection&lt;/span&gt; values = listItem[taxanomyField.Id] &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValueCollection&lt;/span&gt;;
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (values.Count == 0)
                {
                    WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;TaxField Id : {0}, Type: {1}, Title: {2}, InternalName: {3}, &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;
                    TaxonomyFieldValue is null&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName));
                }
                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                {
                    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValue&lt;/span&gt; value &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; values)
                    {
                        DisplayField(field, value);
                    }
                }
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValue&lt;/span&gt; value = listItem[taxanomyField.Id] &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; TaxonomyFieldValue;
                DisplayField(field, value);
            }
        }
        &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;LookupMulti&quot;&lt;/span&gt;)
        {
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (field.InternalName == &lt;span class=&quot;str&quot;&gt;&quot;TaxCatchAll&quot;&lt;/span&gt; || field.InternalName == &lt;span class=&quot;str&quot;&gt;&quot;TaxCatchAllLabel&quot;&lt;/span&gt;)
            {
                &lt;span class=&quot;netclass&quot;&gt;SPFieldLookupValueCollection&lt;/span&gt; lookupValues =(&lt;span class=&quot;netclass&quot;&gt;SPFieldLookupValueCollection&lt;/span&gt;)listItem[field.Id];
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (lookupValues.Count == 0)
                {
                    WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;TaxField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},
                    LookupValue: {4}, LookupId: {5}&quot;&lt;/span&gt;, field.Id, field.TypeAsString, 
                    field.Title, field.InternalName, &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;empty&amp;gt;&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;empty&amp;gt;&quot;&lt;/span&gt;));
                }
                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                {
                    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;SPFieldLookupValue&lt;/span&gt; lookupValue &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; lookupValues)
                    {
                        WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;TaxField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},
                        LookupValue: {4}, LookupId: {5}&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName, 
                        lookupValue.LookupValue, lookupValue.LookupId));
                    }
                }
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                &lt;span class=&quot;rem&quot;&gt;//Other multi&lt;/span&gt;
                &lt;span class=&quot;netclass&quot;&gt;SPFieldLookupValueCollection&lt;/span&gt; lookupValues =(&lt;span class=&quot;netclass&quot;&gt;SPFieldLookupValueCollection&lt;/span&gt;)listItem[field.Id];
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (lookupValues.Count == 0)
                {
                    WriteVerboseMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;OtherField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},
                    LookupValue: {4}, LookupId: {5}&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName, &lt;span class=&quot;str&quot;&gt;
                    &quot;&amp;lt;none&amp;gt;&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;none&amp;gt;&quot;&lt;/span&gt;));
                }
                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                {
                    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;SPFieldLookupValue&lt;/span&gt; lookupValue &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; lookupValues)
                    {
                        WriteVerboseMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;OtherField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},
                        LookupValue: {4}, LookupId: {5}&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName, 
                        lookupValue.LookupValue, lookupValue.LookupId));
                    }
                }
            }
        }
        &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;Note&quot;&lt;/span&gt;)
        {
            &lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt; taxField = GetTaxonomyTextField(listItem, field);
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (taxField != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
            {
                WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;TaxField Id : {0}, Type: {1}, Title: {2}, InternalName: {3}, Value: {4},
                RelatedTaxFieldInternalName: {5}&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName, 
                listItem[field.Id], taxField.InternalName));
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                WriteVerboseMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;OtherField Id : {0}, Type: {1}, Title: {2}, InternalName: {3}, Value: {4}&quot;&lt;/span&gt;, 
                field.Id, field.TypeAsString, field.Title, field.InternalName, listItem[field.Id]));
            }

        }
        &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
        {
            WriteVerboseMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;OtherField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},Value: {4}&quot;&lt;/span&gt;, 
            field.Id, field.TypeAsString, field.Title, field.InternalName, listItem[field.Id]));
        }
    }
}

&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt; GetTaxonomyTextField(&lt;span class=&quot;netclass&quot;&gt;SPListItem&lt;/span&gt; listItem, &lt;span class=&quot;netclass&quot;&gt;SPField&lt;/span&gt; noteField)
{
    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;SPField&lt;/span&gt; field &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; listItem.Fields)
    {
        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;TaxonomyFieldType&quot;&lt;/span&gt; || field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;TaxonomyFieldTypeMulti&quot;&lt;/span&gt;)
        {
            &lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt; taxanomyField = (&lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt;)field;
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (taxanomyField.TextField == noteField.Id)
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; taxanomyField;
            }
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;
}

&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; DisplayField(&lt;span class=&quot;netclass&quot;&gt;SPField&lt;/span&gt; field, &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValue&lt;/span&gt; fieldValue)
{
    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (fieldValue == &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
    {
        WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;TaxField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},
        TaxonomyFieldValue is null&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName));
    }
    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
    {
        WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;TaxField Id : {0}, Type: {1}, Title: {2}, InternalName: {3},
        TermLabel: {4}, TermId: {5}, WssId: {6}&quot;&lt;/span&gt;, field.Id, field.TypeAsString, field.Title, field.InternalName, 
        fieldValue.Label, fieldValue.TermGuid, fieldValue.WssId));
    }
}&lt;/pre&gt;
&lt;br /&gt;
Now let&#39;s view the fields on our listitem:

&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;Get-ListTaxanomyFieldReport command started.
List Id: f7ed8478-bd9a-463e-9637-bc43e02777ff, Name: Document Archive
File: DocumentArchive/TestDocument.docx, Id: f1bdb360-f269-4de8-a73a-baaf657c09bf, Title: TestDocument

TaxField Id : 0f4b3ac1-7947-4cbf-a4ad-963e1fb892bd, Type: Note, Title: Organization_0, InternalName: OrganizationTaxHTField0, Value: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;|2293196a-2af6-4521-9aa0-1230099a9b61, RelatedTaxFieldInternalName: Organization

TaxField Id : 3b2705e1-8f4b-47e6-bb0f-cffb1958f7c7, Type: TaxonomyFieldType, Title: Organization, InternalName: Organization, TermLabel: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;, TermId: 2293196a-2af6-4521-9aa0-1230099a9b61, WssId: 11

TaxField Id : f3b0adf9-c1a2-4b02-920d-943fba4b3611, Type: LookupMulti, Title: Taxonomy Catch All Column, InternalName: TaxCatchAll, LookupValue: /jjIJ5eNSk2OsJp9BdEzVw==|LARTuP6U9kuzdmFGr+H5LA==|ahmTIvYqIUWaoBIwCZqbYQ==, LookupId: 11

TaxField Id : 1390a86a-23da-45f0-8efe-ef36edadfb39, Type: Note, Title: TaxKeywordTaxHTField, InternalName: TaxKeywordTaxHTField, Value: , RelatedTaxFieldInternalName: TaxKeyword

TaxField Id : 8f6b6dd8-9357-4019-8172-966fcd502ed2, Type: LookupMulti, Title: Taxonomy Catch All Column1, InternalName: TaxCatchAllLabel, LookupValue: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;#?|, LookupId: 11

TaxField Id : 23f27201-bee3-471e-b2e7-b64fd8b7ca38, Type: TaxonomyFieldTypeMulti, Title: Enterprise Keywords, InternalName: TaxKeyword, TaxonomyFieldValue is empty
Get-ListTaxanomyFieldReport command ended.
&lt;/pre&gt;
So far so good, Organization, OrganizationTaxHTField0, TaxCatchAllLabel all says Logistics.
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Renaming the Term&lt;/h3&gt;
Now go into the Taxanomy Term Store in Central Admin and rename Logistics to Logistics1 and hit save.
&lt;br /&gt;
View the  fields again:
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;Get-ListTaxanomyFieldReport command started.
List Id: f7ed8478-bd9a-463e-9637-bc43e02777ff, Name: Document Archive
File: DocumentArchive/TestDocument.docx, Id: f1bdb360-f269-4de8-a73a-baaf657c09bf, Title: TestDocument

TaxField Id : 0f4b3ac1-7947-4cbf-a4ad-963e1fb892bd, Type: Note, Title: Organization_0, InternalName: OrganizationTaxHTField0, Value: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;|2293196a-2af6-4521-9aa0-1230099a9b61, RelatedTaxFieldInternalName: Organization

TaxField Id : 3b2705e1-8f4b-47e6-bb0f-cffb1958f7c7, Type: TaxonomyFieldType, Title: Organization, InternalName: Organization, TermLabel: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;, TermId: 2293196a-2af6-4521-9aa0-1230099a9b61, WssId: 11

TaxField Id : f3b0adf9-c1a2-4b02-920d-943fba4b3611, Type: LookupMulti, Title: Taxonomy Catch All Column, InternalName: TaxCatchAll, LookupValue: /jjIJ5eNSk2OsJp9BdEzVw==|LARTuP6U9kuzdmFGr+H5LA==|ahmTIvYqIUWaoBIwCZqbYQ==, LookupId: 11

TaxField Id : 1390a86a-23da-45f0-8efe-ef36edadfb39, Type: Note, Title: TaxKeywordTaxHTField, InternalName: TaxKeywordTaxHTField, Value: , RelatedTaxFieldInternalName: TaxKeyword

TaxField Id : 8f6b6dd8-9357-4019-8172-966fcd502ed2, Type: LookupMulti, Title: Taxonomy Catch All Column1, InternalName: TaxCatchAllLabel, LookupValue: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;#?|, LookupId: 11

TaxField Id : 23f27201-bee3-471e-b2e7-b64fd8b7ca38, Type: TaxonomyFieldTypeMulti, Title: Enterprise Keywords, InternalName: TaxKeyword, TaxonomyFieldValue is empty
Get-ListTaxanomyFieldReport command ended.
&lt;/pre&gt;
No change of course because the list&#39;s are not updated immediatly, but through a job named Taxanomy Update Scheduler.
&lt;br /&gt;
&lt;br /&gt;
Go into Central Administration, Monitoring, Review Job Definitions, Find the Taxanomy Update Scheduler job, there will be one for each site collection.
So be sure to pick the right one.
&lt;br /&gt;
Now run the job. (The Job is scheduled to run every hour).
&lt;br/&gt;
Make sure it has executed properly by looking at the Timer Job Status, it should appear in the History.
&lt;br /&gt;
Ok let&#39;s look at our fields again:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;Get-ListTaxanomyFieldReport command started.
List Id: f7ed8478-bd9a-463e-9637-bc43e02777ff, Name: Document Archive
File: DocumentArchive/TestDocument.docx, Id: f1bdb360-f269-4de8-a73a-baaf657c09bf, Title: TestDocument

TaxField Id : 0f4b3ac1-7947-4cbf-a4ad-963e1fb892bd, Type: Note, Title: Organization_0, InternalName: OrganizationTaxHTField0, Value: &lt;span class=&quot;markred&quot;&gt;Logistics&lt;/span&gt;|2293196a-2af6-4521-9aa0-1230099a9b61, RelatedTaxFieldInternalName: Organization

TaxField Id : 3b2705e1-8f4b-47e6-bb0f-cffb1958f7c7, Type: TaxonomyFieldType, Title: Organization, InternalName: Organization, TermLabel: &lt;span class=&quot;markred&quot;&gt;Logistics1&lt;/span&gt;, TermId: 2293196a-2af6-4521-9aa0-1230099a9b61, WssId: 11

TaxField Id : f3b0adf9-c1a2-4b02-920d-943fba4b3611, Type: LookupMulti, Title: Taxonomy Catch All Column, InternalName: TaxCatchAll, LookupValue: /jjIJ5eNSk2OsJp9BdEzVw==|LARTuP6U9kuzdmFGr+H5LA==|ahmTIvYqIUWaoBIwCZqbYQ==, LookupId: 11

TaxField Id : 1390a86a-23da-45f0-8efe-ef36edadfb39, Type: Note, Title: TaxKeywordTaxHTField, InternalName: TaxKeywordTaxHTField, Value: , RelatedTaxFieldInternalName: TaxKeyword

TaxField Id : 8f6b6dd8-9357-4019-8172-966fcd502ed2, Type: LookupMulti, Title: Taxonomy Catch All Column1, InternalName: TaxCatchAllLabel, LookupValue: &lt;span class=&quot;markred&quot;&gt;Logistics1&lt;/span&gt;#?|, LookupId: 11

TaxField Id : 23f27201-bee3-471e-b2e7-b64fd8b7ca38, Type: TaxonomyFieldTypeMulti, Title: Enterprise Keywords, InternalName: TaxKeyword, TaxonomyFieldValue is empty
Get-ListTaxanomyFieldReport command ended.
&lt;/pre&gt;
The Note field, OrganizationTaxHTField0 is not updated properly.
&lt;br /&gt;
&lt;br /&gt;
But if we look at the list:
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTAQ9EFS2xWqU1cS5eaZk3vWgzoJux0QDDTbV2KCY89sczJIbnADNoea_6HaRnaj-eK-dOzBen5ONn5AiZhteB3Jdsb1Du4_K2zFLLMT3tPS1zWow1roRBBwKgSsBghgPsAMIn2TDA-kAi/s1600/2.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;129&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTAQ9EFS2xWqU1cS5eaZk3vWgzoJux0QDDTbV2KCY89sczJIbnADNoea_6HaRnaj-eK-dOzBen5ONn5AiZhteB3Jdsb1Du4_K2zFLLMT3tPS1zWow1roRBBwKgSsBghgPsAMIn2TDA-kAi/s1600/2.png&quot; width=&quot;660&quot; /&gt;&lt;/a&gt;



&lt;br /&gt;
&lt;br /&gt;
Seems like it&#39;s updated, viewing and editing the properties of this field also displays Logistics1.
If you edit the properties, then hit save, then the Note field is properly updated to Logistics1.
&lt;br/ &gt;
&lt;br /&gt;
&lt;h3&gt;Fixing the Problem&lt;/h3&gt;
Anyway, i don&#39;t like things that are not 100%, so let&#39;s see how we can refresh the Note Field from code.
&lt;br /&gt;
I tried a lot of things, but found one solution that works, here is the code:

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; RefreshTaxanomyFieldsOnListItem(&lt;span class=&quot;netclass&quot;&gt;SPListItem&lt;/span&gt; listItem, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; taxFieldInternalName, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; taxFieldNewLabel)
{
    &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; changed = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
    &lt;span class=&quot;kwrd&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; listItem.Fields.Count; ++i) &lt;span class=&quot;rem&quot;&gt;//Dont use foreach&lt;/span&gt;
    {
        &lt;span class=&quot;netclass&quot;&gt;SPField&lt;/span&gt; field = listItem.Fields[i];
        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;TaxonomyFieldType&quot;&lt;/span&gt; || field.TypeAsString == &lt;span class=&quot;str&quot;&gt;&quot;TaxonomyFieldTypeMulti&quot;&lt;/span&gt;)
        {
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(taxFieldInternalName) || field.InternalName == taxFieldInternalName)
            {
                &lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt; taxanomyField = (&lt;span class=&quot;netclass&quot;&gt;TaxonomyField&lt;/span&gt;)field;
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (taxanomyField.AllowMultipleValues)
                {
                    &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValueCollection&lt;/span&gt; values = listItem[taxanomyField.Id] &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValueCollection&lt;/span&gt;;
                    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (values != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
                    {
                        &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValue&lt;/span&gt; value &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; values)
                        {
                            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(taxFieldNewLabel) || value.Label == taxFieldNewLabel)
                            {
                                WriteVerboseMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;Refreshing Taxanomy Multi Field: {0}&quot;&lt;/span&gt;, 
                                taxanomyField.InternalName));
                                taxanomyField.SetFieldValue(listItem, values);
                                changed = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
                                &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
                            }
                        }
                    }
                }
                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                {
                    &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValue&lt;/span&gt; value = listItem[taxanomyField.Id] &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;netclass&quot;&gt;TaxonomyFieldValue&lt;/span&gt;;
                    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (value != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
                    {
                        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(taxFieldNewLabel) || value.Label == taxFieldNewLabel)
                        {
                            WriteVerboseMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;Refreshing Taxanomy Single Field: {0}&quot;&lt;/span&gt;,
                            taxanomyField.InternalName));
                            taxanomyField.SetFieldValue(listItem, value);
                            changed = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
                        }
                    }
                }
            }
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (changed)
    {
        WriteInformationMessage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;Updated File: {0}, Id: {1}, Title: {2}&quot;&lt;/span&gt;, listItem.Url,
        listItem.UniqueId.ToString(), listItem.Title));
        listItem.SystemUpdate(&lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;br /&gt;
So let&#39;s run this code on our list, then look at our fields again:

&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;Get-ListTaxanomyFieldReport command started.
List Id: f7ed8478-bd9a-463e-9637-bc43e02777ff, Name: Document Archive
File: DocumentArchive/TestDocument.docx, Id: f1bdb360-f269-4de8-a73a-baaf657c09bf, Title: TestDocument

TaxField Id : 0f4b3ac1-7947-4cbf-a4ad-963e1fb892bd, Type: Note, Title: Organization_0, InternalName: OrganizationTaxHTField0, Value: &lt;span class=&quot;markred&quot;&gt;Logistics1&lt;/span&gt;|2293196a-2af6-4521-9aa0-1230099a9b61, RelatedTaxFieldInternalName: Organization

TaxField Id : 3b2705e1-8f4b-47e6-bb0f-cffb1958f7c7, Type: TaxonomyFieldType, Title: Organization, InternalName: Organization, TermLabel: &lt;span class=&quot;markred&quot;&gt;Logistics1&lt;/span&gt;, TermId: 2293196a-2af6-4521-9aa0-1230099a9b61, WssId: 11

TaxField Id : f3b0adf9-c1a2-4b02-920d-943fba4b3611, Type: LookupMulti, Title: Taxonomy Catch All Column, InternalName: TaxCatchAll, LookupValue: /jjIJ5eNSk2OsJp9BdEzVw==|LARTuP6U9kuzdmFGr+H5LA==|ahmTIvYqIUWaoBIwCZqbYQ==, LookupId: 11

TaxField Id : 1390a86a-23da-45f0-8efe-ef36edadfb39, Type: Note, Title: TaxKeywordTaxHTField, InternalName: TaxKeywordTaxHTField, Value: , RelatedTaxFieldInternalName: TaxKeyword

TaxField Id : 8f6b6dd8-9357-4019-8172-966fcd502ed2, Type: LookupMulti, Title: Taxonomy Catch All Column1, InternalName: TaxCatchAllLabel, LookupValue: &lt;span class=&quot;markred&quot;&gt;Logistics1&lt;/span&gt;#?|, LookupId: 11

TaxField Id : 23f27201-bee3-471e-b2e7-b64fd8b7ca38, Type: TaxonomyFieldTypeMulti, Title: Enterprise Keywords, InternalName: TaxKeyword, TaxonomyFieldValue is empty
Get-ListTaxanomyFieldReport command ended.
&lt;/pre&gt;
&lt;br /&gt;
Finally everything is correct.

&lt;br /&gt;
&lt;br /&gt;
I wrote a Commandlet that did this refresh, but i didn&#39;t want to execute the Taxanomy Update Scheduler job manually every time
so i found this:
TaxonomySession.SyncHiddenList(site);
&lt;br /&gt;
I thought that this was the command that the Taxanomy Update Scheduler job was executing, but thats not the case.
&lt;br /&gt;
If i ran this command, no changes where made to the list, if i ran this command after running the Taxanomy Update Scheduler job
then the list item was reverted back to the old name in all fields ??
&lt;br /&gt;
If anyone can tell me where i can find the source for the Taxanomy Update Scheduler job i would be really happy, didn&#39;t have time
to investigate this any further.


&lt;br /&gt;
&lt;br /&gt;
Anyway i decided to run the job before i executed the RefreshTaxanomyFieldsOnListItem like this:

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; RefreshHiddenList(&lt;span class=&quot;netclass&quot;&gt;SPSite&lt;/span&gt; site, &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; timeoutSeconds)
{
    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;netclass&quot;&gt;SPJobDefinition&lt;/span&gt; job &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; site.WebApplication.JobDefinitions)
    {
        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (job.Name.Equals(&lt;span class=&quot;str&quot;&gt;&quot;UpdateHiddenListJobDefinition&quot;&lt;/span&gt;) &amp;amp;&amp;amp; job.Status == &lt;span class=&quot;netclass&quot;&gt;SPObjectStatus&lt;/span&gt;.Online)
        {
            &lt;span class=&quot;netclass&quot;&gt;DateTime&lt;/span&gt; dateStart = &lt;span class=&quot;netclass&quot;&gt;DateTime&lt;/span&gt;.Now;
            job.RunNow();

            &lt;span class=&quot;kwrd&quot;&gt;while&lt;/span&gt; (job.LastRunTime &amp;lt; dateStart)
            {
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (DateTime.Now &amp;gt; dateStart.AddSeconds(timeoutSeconds))
                {
                    Console.WriteLine(&lt;span class=&quot;str&quot;&gt;&quot;Taxanomy Update Scheduler did not finish executing due to a timeout !&quot;&lt;/span&gt;);
                    &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
                }

                &lt;span class=&quot;netclass&quot;&gt;Thread&lt;/span&gt;.Sleep(1000);
            }

            &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
So the correct sequence are: 
&lt;br /&gt;
1. Rename the Term.
&lt;br /&gt;
2. Run RefreshHiddenList() or run the Taxaonomy Update Scheduler.
&lt;br /&gt;
3. Run RefreshTaxanomyFieldsOnListItem().
&lt;br /&gt;
&lt;br /&gt;
I&#39;m not sure what the consequences are when the Note field isn&#39;t updated
as it should.
But if you are using the Note field in your custom code, webparts etc.
you should be aware of that it could be wrong.




</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/2535106639923497471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/09/renaming-term-in-sharepoint-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/2535106639923497471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/2535106639923497471'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/09/renaming-term-in-sharepoint-2010.html' title='Renaming a Term in SharePoint 2010 Glitch'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEionLxtG2M7jL8EtWeuSeb1_ehRHoXsijcRsvptaHKbXrWSwTNN1zshU4YPR1sHc7D2heOnfj_WA8r3AkWbFD4Nb_3mt065DECsgD32PUx1RWDQA9ELixELqy0M6-k3b7NUlnSfi-1L9jPn/s72-c/3.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-4580307052026339233</id><published>2012-03-22T14:18:00.000+01:00</published><updated>2012-04-27T16:11:32.048+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MSSQL"/><category scheme="http://www.blogger.com/atom/ns#" term="PowerPivot"/><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>VMware image with Sharepoint 2010, MSSQL 2012, SSRS, Performance Point and PowerPivot</title><content type='html'>This is how you can install a VMware Image with Windows 2008 r2, SharePoint 2010 and Microsoft SQL Server 2012 Denali. &lt;br /&gt;
&lt;div&gt;
I will also show you how you can configure SSRS, Performance Point and PowerPivot.&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
At first i tried to install this without a domain, and got everything working except PowerPivot.&lt;/div&gt;
&lt;div&gt;
At present time there is no workarounds for getting PowerPivot to run in a non domain environment.&lt;/div&gt;
&lt;div&gt;
Bummer, so i had to scrap it and start over with a domain.&lt;/div&gt;
&lt;div&gt;
Anyway installing a domain is pretty easy, so just live it and use a domain in your SharePoint playground.&lt;/div&gt;
&lt;div&gt;
It just makes your life so much easyer.&lt;/div&gt;
&lt;br /&gt;
Sorry no screenshots, if there are parts you don&#39;t understand please contact me.&lt;br /&gt;
&lt;br /&gt;
I spent a couple of days doing this, so maybe someone will find this useful.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;





Install windows&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Install &lt;a href=&quot;http://www.vmware.com/products/workstation/overview.html&quot; target=&quot;_blank&quot;&gt;VMware Workstation&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Install Windows 2008 R2 With SP1 with username dev. &lt;/li&gt;
&lt;li&gt;Change computername to DevServer.&lt;/li&gt;
&lt;li&gt;Turn off the Firewall.&lt;/li&gt;
&lt;li&gt;Turn off UAC.&lt;/li&gt;
&lt;li&gt;Turn off IE ESC (Server manager down on the right).&lt;/li&gt;
&lt;li&gt;Add server roles: Web Server (IIS) and Application Server. &lt;/li&gt;
&lt;li&gt;Run windows update over and over again, until the green checkmark of delight appears. (Microsoft PLEASE, 2012 and this is still not automated in any way) .&lt;/li&gt;
&lt;li&gt;Power off the VM, and take a snapshot. VMware can only clone snapshots taken during power off (just a little tip if you need to clone it in a later life).&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h3&gt;





Install the domain controller&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Click Start, then run.&lt;/li&gt;
&lt;li&gt;Type in dcpromo and hit enter.&lt;/li&gt;
&lt;li&gt;Don&#39;t check use advanced mode installation.&lt;/li&gt;
&lt;li&gt;Select create a new domain in a new forest.&lt;/li&gt;
&lt;li&gt;FQDN of the forest root domain: xtrm.local or whatever.&lt;/li&gt;
&lt;li&gt;Forest functional level, just select windows 2008 r2.&lt;/li&gt;
&lt;li&gt;Select additional options for this domain controller, make sure DNS server is selected.&lt;/li&gt;
&lt;li&gt;Change to static IP in the IPV4 settings of your network card. &lt;/li&gt;
&lt;li&gt;For example IP: 10.10.10.1, Subnet mask 255.255.255.240.&lt;/li&gt;
&lt;li&gt;Continue the wizard: Select no, i will assign static IP addresses to all physical network adapters.&lt;/li&gt;
&lt;li&gt;A delegation for this DNS server could not be created. Click Yes.&lt;/li&gt;
&lt;li&gt;Location for Database, Log Files ans SYSVOL, just leave the defaults.&lt;/li&gt;
&lt;li&gt;Directory services restore mode administrator password: Use a strong password.&lt;/li&gt;
&lt;li&gt;Summary, click next, click Finish, and reboot.&lt;/li&gt;
&lt;li&gt;Switch back to dhcp, obtain ip address and dns automatically because of internet access through the VM.&lt;/li&gt;
&lt;li&gt;Now start Active Directory Users and Computers.&lt;/li&gt;
&lt;li&gt;Create 3 new users: sqladmin, spadmin, spfarm. Use same password, user cannot change password, password never expires.&lt;/li&gt;
&lt;li&gt;Add spadmin to the Domain Admins group.&lt;/li&gt;
&lt;li&gt;Reboot, and we are done with setting up the domain.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h3&gt;





Install Microsoft Sql Server 2012&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;When installing MSSQL 2012 Denali, make sure you install these options: Reporting Services - Native, Reporting Services - SharePoint, Reporting Services Add-in for SharePoint Products.&lt;/li&gt;
&lt;li&gt;In other words, select all features except the replay controller / client.&lt;/li&gt;
&lt;li&gt;Install a sql instance named SharePoint.&lt;/li&gt;
&lt;li&gt;Run all services with the xtrm\sqladmin user.&lt;/li&gt;
&lt;li&gt;Add dev, sqladmin, spadmin and spfarm user to the sql server / analysis services administrator group.&lt;/li&gt;
&lt;li&gt;Install and Reboot.&lt;/li&gt;
&lt;li&gt;Microsoft SQL Server 2012 is now up and running.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h3&gt;





Install SharePoint 2010&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Login as spadmin, IMPORTANT !.&lt;/li&gt;
&lt;li&gt;Install SharePoint 2010 Prerequisites.&lt;/li&gt;
&lt;li&gt;Start the SharePoint 2010 server install.&lt;/li&gt;
&lt;li&gt;Wait until done.&lt;/li&gt;
&lt;li&gt;Run the SharePoint Products Configuration Wizard (Started automatically).&lt;/li&gt;
&lt;li&gt;Select Create a new server farm.&lt;/li&gt;
&lt;li&gt;Database server: DevServer\SharePoint&lt;/li&gt;
&lt;li&gt;Database name: SharePoint_Config&lt;/li&gt;
&lt;li&gt;Database Access account: xtrm\spfarm&lt;/li&gt;
&lt;li&gt;Passphrase: Enter a strong password.&lt;/li&gt;
&lt;li&gt;Force port number for SharePoint Central Administration. &lt;/li&gt;
&lt;li&gt;Select NTLM. &lt;/li&gt;
&lt;li&gt;Finish the wizard. &lt;/li&gt;
&lt;li&gt;Start SharePoint Central Administration,, configure your SharePoint farm (If not automatically started). &lt;/li&gt;
&lt;li&gt;Service account: Use existing xtrm\spfarm.&lt;/li&gt;
&lt;li&gt;Create a top level site, Team Site or whatever.&lt;/li&gt;
&lt;li&gt;SharePoint 2010 is now up and running in a farm on Microsoft SQL Server 2012. &lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h3&gt;





Configure Reporting Services in SharePoint 2010&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Start SharePoint Central Administration.&lt;/li&gt;
&lt;li&gt;Click on General Application Settings.&lt;/li&gt;
&lt;li&gt;Under SQL Server Reporting Services, click on Reporting services integration.&lt;/li&gt;
&lt;li&gt;DON&#39;T bother, because this is for SQL Server 2008 /2008 R2 only.&lt;/li&gt;
&lt;li&gt;This is how you integrate against SQL Server 2012:&lt;/li&gt;
&lt;li&gt;Start SharePoint 2010 Management Shell, right click and do a run as administrator. IMPORTANT !&lt;/li&gt;
&lt;li&gt;Type in: Install-SPRSService &lt;/li&gt;
&lt;li&gt;Type in: Install-SPRSServiceProxy&lt;/li&gt;
&lt;li&gt;Type in: get-spserviceinstance -all |where {$_.TypeName -like &quot;SQL Server Reporting*&quot;} | Start-SPServiceInstance&lt;/li&gt;
&lt;li&gt;Now go back to SharePoint Central Administration.&lt;/li&gt;
&lt;li&gt;Click on System Settings, Manage services on server.&lt;/li&gt;
&lt;li&gt;Then you will see a service named: SQL Server Reporting Services Service with status Started.&lt;/li&gt;
&lt;li&gt;Goto Application management, Service Applications, Manage Service Applications.&lt;/li&gt;
&lt;li&gt;Select New then SQL Server Reporting Services Service Application.&lt;/li&gt;
&lt;li&gt;Name: SSRSApp, New app pool: SSRSAppPool, App pool account: xtrm\spfarm.&lt;/li&gt;
&lt;li&gt;Select windows authentication, select web application association: SharePoint 80.&lt;/li&gt;
&lt;li&gt;And we are done with SSRS integration against SharePoint 2010.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h3&gt;





Configure Performance Point in SharePoint 2012&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Just make sure PerformancePoint Service is started in System Settings, Manage Services on Server.&lt;/li&gt;
&lt;li&gt;And that the Performance Point Service application has been created under Application Management, Manage Service Applications.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h3&gt;





Configure PowerPivot in SharePoint 2010&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Login as spadmin.&lt;/li&gt;
&lt;li&gt;PowerPivot is a separate install, so first we need to install it.&lt;/li&gt;
&lt;li&gt;Run Microsoft Sql Server Setup.&lt;/li&gt;
&lt;li&gt;Add features to an existing installation.&lt;/li&gt;
&lt;li&gt;Next screen, you need to select Perform a New installation of Sql Server 2012.&lt;/li&gt;
&lt;li&gt;Then select Sql Server PowerPivot for SharePoint, do not select add database instance.&lt;/li&gt;
&lt;li&gt;It will default to named instance PowerPivot.&lt;/li&gt;
&lt;li&gt;Run the Sql Server Analysis Services as the xtrm\sqladmin account.&lt;/li&gt;
&lt;li&gt;Add dev, spadmin, spfarm and sqladmin as administrators.&lt;/li&gt;
&lt;li&gt;Finish the wizard and it will be installed.&lt;/li&gt;
&lt;li&gt;Start the PowerPivot Configuration Tool.&lt;/li&gt;
&lt;li&gt;Select Configure or Repair PowerPivot For SharePoint.&lt;/li&gt;
&lt;li&gt;Default Account: xtrm\spfarm&lt;/li&gt;
&lt;li&gt;Database Server: devserver\SharePoint&lt;/li&gt;
&lt;li&gt;Enter SharePoint passphrase.&lt;/li&gt;
&lt;li&gt;Click on Register Sql Server Analysis Services (PowerPivot) on local server and enter password for sqladmin user.&lt;/li&gt;
&lt;li&gt;Click Validate, then Run.&lt;/li&gt;
&lt;li&gt;Click yes on the confirm messagebox.&lt;/li&gt;
&lt;li&gt;And&amp;nbsp;wait until it&amp;nbsp;succeeds.&lt;/li&gt;
&lt;li&gt;Start SharePoint Central Administration&lt;/li&gt;
&lt;li&gt;If you look at System, Services On Server, you now have a new service named: SQL Server PowerPivot System Service.&lt;/li&gt;
&lt;li&gt;Goto Application Management, Manage Service Applications.&lt;/li&gt;
&lt;li&gt;You will have a new Service Application named: Default PowerPivot Service Application.&lt;/li&gt;
&lt;li&gt;Now there are 2 farm solutions that has been deployed in the farm.&lt;/li&gt;
&lt;li&gt;To view them goto System Settings, Manage farm solutions.&lt;/li&gt;
&lt;li&gt;PowerPivotfarm.wsp is globally deployed.&lt;/li&gt;
&lt;li&gt;PowerPivotWebApp.wsp is deployed to each web app.&lt;/li&gt;
&lt;li&gt;So if you create a new webapp, then you need to deploy this solution to the new webapp.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Great, finally everything is installed and configured.&lt;br /&gt;
Later i will write a post about how you actually use what you have installed:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;SSRS both Native and SharePoint.&lt;/li&gt;
&lt;li&gt;Performance Point.&lt;/li&gt;
&lt;li&gt;PowerPivot.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;
A final tip:&amp;nbsp;ALWAYS run IE and SharePoint Management Console as administrator.&lt;/div&gt;
&lt;div&gt;
(Right click and run as administrator). If you don&#39;t do this there will be a lot of menu options in&lt;/div&gt;
&lt;div&gt;
SharePoint Central Administration that will be missing.&lt;/div&gt;
&lt;div&gt;
And the scripts will fail with some cryptic errors.&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
If you find any errors above, unnecessary steps or other ways to improve the 
sequence, &lt;br /&gt;
&lt;div&gt;
please let me know.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/4580307052026339233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/03/vmware-image-with-sharepoint-2010-mssql.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/4580307052026339233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/4580307052026339233'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/03/vmware-image-with-sharepoint-2010-mssql.html' title='VMware image with Sharepoint 2010, MSSQL 2012, SSRS, Performance Point and PowerPivot'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-2180193488323524622</id><published>2012-02-13T10:28:00.000+01:00</published><updated>2012-03-10T00:32:47.886+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MSSQL"/><title type='text'>How to calculate median in MSSQL</title><content type='html'>Definition of median:&lt;br /&gt;
Median is described as the numerical value separating the higher half from the lower half of a&lt;br /&gt;
sample, a population or a probability distribution.&lt;br /&gt;
&lt;br /&gt;
The median value of a list of numbers can be found by arranging all the observations from lowest value to the&amp;nbsp;highest value and picking the middle one. &lt;br /&gt;
If there is an uneven number of observations, then median will be the middle value.&lt;br /&gt;
If there is an even number of observations, the median is then usually defined to be the mean of the two middle values.&lt;br /&gt;
&lt;br /&gt;
So lets say we have this sample data:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; color: black; width: 630px;&quot;&gt;

 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 1792; mso-width-source: userset; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1316; mso-width-source: userset; width: 27pt;&quot; width=&quot;36&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1243; mso-width-source: userset; width: 26pt;&quot; width=&quot;34&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 11410; mso-width-source: userset; width: 234pt;&quot; width=&quot;312&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;15&quot; style=&quot;background-color: #bfbfbf; border: 0.5pt solid windowtext; height: 11.25pt; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Lot&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 27pt;&quot; width=&quot;36&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Wafer&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;ResultName&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 26pt;&quot; width=&quot;34&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Value&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 234pt;&quot; width=&quot;312&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Comment&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;50&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;40&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;30&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;&amp;lt;- Median 1 /
  Median 2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(Median1 + Median 2) / 2 =
  Median = 30&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;20&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;60&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;50&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;40&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;&amp;lt;- Median 1&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;30&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;&amp;lt;- Median 2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(Median1 + Median 2) / 2 = Median = 35&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;20&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
First we need to sort and number the resultvalues ascending.&lt;br /&gt;
Then we need to get the result count for each wafer.&lt;br /&gt;
To do this, we can use the row_number() function / count(*) function together with over / partition by.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;(&lt;span class=&quot;kwrd&quot;&gt;select&lt;/span&gt; l.lot, 
          w.waferno, 
          dr.resultvalue,
          row_number() &lt;span class=&quot;kwrd&quot;&gt;over&lt;/span&gt;(partition &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; l.lot, w.waferno &lt;span class=&quot;kwrd&quot;&gt;order&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; dr.resultvalue) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; rownum,
          &lt;span class=&quot;kwrd&quot;&gt;count&lt;/span&gt;(*) &lt;span class=&quot;kwrd&quot;&gt;over&lt;/span&gt;(partition &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; l.lot, w.waferno) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; resultcount
  &lt;span class=&quot;kwrd&quot;&gt;from&lt;/span&gt; lot l &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt;
  wafer w &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; l.lot = w.lot &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt;
  results r &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; w.waferid = r.waferid &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt; 
  resulttype rt &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; r.resulttypeid = rt.resulttypeid
&lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; l.lot = 8485474 
&lt;span class=&quot;kwrd&quot;&gt;and&lt;/span&gt; rt.resultname = &lt;span class=&quot;str&quot;&gt;&#39;someresult&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; medianvalues&lt;/pre&gt;
&lt;br /&gt;
The above query will give us this resultset:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; color: black; width: 298px;&quot;&gt;

 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 1792; mso-width-source: userset; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1316; mso-width-source: userset; width: 27pt;&quot; width=&quot;36&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1243; mso-width-source: userset; width: 26pt;&quot; width=&quot;34&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1792; mso-width-source: userset; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;15&quot; style=&quot;background-color: #bfbfbf; border: 0.5pt solid windowtext; height: 11.25pt; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Lot&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 27pt;&quot; width=&quot;36&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Wafer&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;ResultName&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 26pt;&quot; width=&quot;34&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Value&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;RowNum&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;ResultCount&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;20&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;30&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;40&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;50&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;20&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;30&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;40&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;50&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;someresult&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;60&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Now we can filter out the middle rows with the follwing formula:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;(resultcount + 1) / 2 and (resultcount + 2) / 2)&lt;/pre&gt;
So for wafer 1:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;(5 + 1) / 2 = 3
(5 + 2) / 2 = 3  (3.5 will be 3 when converted to int)&lt;/pre&gt;
And for wafer 2:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;(6 + 1) / 2 = 3 (3.5 will be 3 when converted to int)
(6 + 2) / 2 = 4 &lt;/pre&gt;
So now that we have the two middle rows, we can just do an average of the two rows:&lt;br /&gt;
So for wafer 1:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;30 + 30 / 2 = 30&amp;nbsp; (Row 3 + Row 3) / 2&lt;/pre&gt;
And for wafer 2:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;30 + 40 / 2 = 35&amp;nbsp; (Row 3 + Row 4) / 2&lt;/pre&gt;
&lt;br /&gt;
Now let&#39;s put it all together:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;select&lt;/span&gt; lot, 
       waferno, 
       resultcount, 
       &lt;span class=&quot;kwrd&quot;&gt;avg&lt;/span&gt;(resultvalue) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; median, 
       (resultcount + 1) / 2 &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; middlerow1, 
       (resultcount + 2) / 2 &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; middlerow2
&lt;span class=&quot;kwrd&quot;&gt;from&lt;/span&gt;
  (&lt;span class=&quot;kwrd&quot;&gt;select&lt;/span&gt; l.lot, 
          w.waferno, 
          dr.resultvalue,
          row_number() &lt;span class=&quot;kwrd&quot;&gt;over&lt;/span&gt;(partition &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; l.lot, w.waferno &lt;span class=&quot;kwrd&quot;&gt;order&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; dr.resultvalue) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; rownum,
          &lt;span class=&quot;kwrd&quot;&gt;count&lt;/span&gt;(*) &lt;span class=&quot;kwrd&quot;&gt;over&lt;/span&gt;(partition &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; l.lot, w.waferno) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; resultcount
  &lt;span class=&quot;kwrd&quot;&gt;from&lt;/span&gt; lot l &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt;
  wafer w &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; l.lot = w.lot &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt;
  results r &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; w.waferid = r.waferid &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt; resulttype rt &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; r.resulttypeid = rt.resulttypeid
&lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; l.lot = 8485474 
&lt;span class=&quot;kwrd&quot;&gt;and&lt;/span&gt; rt.resultname = &lt;span class=&quot;str&quot;&gt;&#39;someresult&#39;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; medianvalues
&lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; rownum &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt;((resultcount + 1) / 2, (resultcount + 2) / 2)
&lt;span class=&quot;kwrd&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; lot,waferno, resultcount
&lt;span class=&quot;kwrd&quot;&gt;order&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; lot,waferno&lt;/pre&gt;
Or if you prefer the new with statement:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;with&lt;/span&gt; medianvalues &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt;
(
&lt;span class=&quot;kwrd&quot;&gt;select&lt;/span&gt; l.lot, 
          w.waferno, 
          dr.resultvalue,
          row_number() &lt;span class=&quot;kwrd&quot;&gt;over&lt;/span&gt;(partition &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; l.lot, w.waferno &lt;span class=&quot;kwrd&quot;&gt;order&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; dr.resultvalue) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; rownum,
          &lt;span class=&quot;kwrd&quot;&gt;count&lt;/span&gt;(*) &lt;span class=&quot;kwrd&quot;&gt;over&lt;/span&gt;(partition &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; l.lot, w.waferno) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; resultcount
  &lt;span class=&quot;kwrd&quot;&gt;from&lt;/span&gt; lot l &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt;
  wafer w &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; l.lot = w.lot &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt;
  results r &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; w.waferid = r.waferid &lt;span class=&quot;kwrd&quot;&gt;inner&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;join&lt;/span&gt; resulttype rt &lt;span class=&quot;kwrd&quot;&gt;on&lt;/span&gt; r.resulttypeid = rt.resulttypeid
&lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; l.lot = 8485474 
&lt;span class=&quot;kwrd&quot;&gt;and&lt;/span&gt; rt.resultname = &lt;span class=&quot;str&quot;&gt;&#39;someresult&#39;&lt;/span&gt;
)
&lt;span class=&quot;kwrd&quot;&gt;select&lt;/span&gt; lot, 
       waferno, 
       resultcount, 
       &lt;span class=&quot;kwrd&quot;&gt;avg&lt;/span&gt;(resultvalue) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; median, 
       (resultcount + 1) / 2 &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; middlerow1, 
       (resultcount + 2) / 2 &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; middlerow2
&lt;span class=&quot;kwrd&quot;&gt;from&lt;/span&gt; medianvalues
&lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; rownum &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt;((resultcount + 1) / 2, (resultcount + 2) / 2)
&lt;span class=&quot;kwrd&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; lot,waferno, resultcount
&lt;span class=&quot;kwrd&quot;&gt;order&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;by&lt;/span&gt; lot,waferno&lt;/pre&gt;
&lt;br /&gt;
The above query will give us this resultset:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; color: black; width: 325px;&quot;&gt;

 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 1792; mso-width-source: userset; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1316; mso-width-source: userset; width: 27pt;&quot; width=&quot;36&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2377; mso-width-source: userset; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 1572; mso-width-source: userset; width: 32pt;&quot; width=&quot;43&quot;&gt;&lt;/col&gt;
 &lt;col span=&quot;2&quot; style=&quot;mso-width-alt: 2413; mso-width-source: userset; width: 50pt;&quot; width=&quot;66&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;15&quot; style=&quot;background-color: #bfbfbf; border: 0.5pt solid windowtext; height: 11.25pt; width: 37pt;&quot; width=&quot;49&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Lot&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 27pt;&quot; width=&quot;36&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Wafer&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 49pt;&quot; width=&quot;65&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;ResultCount&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 32pt;&quot; width=&quot;43&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Median&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 50pt;&quot; width=&quot;66&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;MiddleRow1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #bfbfbf; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 50pt;&quot; width=&quot;66&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;MiddleRow2&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;15&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;30&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #fde9d9; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;15&quot; style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;15&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 11.25pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;8485474&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;35&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/2180193488323524622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/02/how-to-calculate-median-in-mssql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/2180193488323524622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/2180193488323524622'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/02/how-to-calculate-median-in-mssql.html' title='How to calculate median in MSSQL'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-4862628654152760401</id><published>2012-02-09T16:19:00.000+01:00</published><updated>2012-02-09T16:21:48.945+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MSSQL"/><title type='text'>Formatted TimeDiff UDF for MSSQL</title><content type='html'>I just created a UDF function for displaying&amp;nbsp;a formatted time diff&amp;nbsp;value in MSSQL.&lt;br /&gt;
Why ? I googled this and found a lot of solutions that did not work :(&lt;br /&gt;
So i just had to&amp;nbsp;look into it.&lt;br /&gt;
&lt;br /&gt;
I wanted the time difference to be displayed in the following format:&lt;br /&gt;
HHH:MM:SS (@type = 0)&lt;br /&gt;
Where HHH = Total number of hours,&amp;nbsp; so if the difference is one week,&lt;br /&gt;
then this value will be 168. (168:00:00).&lt;br /&gt;
&lt;br /&gt;
I also created another variant:&lt;br /&gt;
D MM:HH:SS (@type = 1)&lt;br /&gt;
Where D = Total number of days, so if the difference is one week,&lt;br /&gt;
then this value will be 7. (7 00:00:00).&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; [dbo].[TimeDiff](@date1 datetime, @date2 datetime, @type &lt;span class=&quot;kwrd&quot;&gt;smallint&lt;/span&gt;)
&lt;span class=&quot;kwrd&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(50)
&lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;begin&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;declare&lt;/span&gt; @days &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;declare&lt;/span&gt; @totalhours &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;declare&lt;/span&gt; @hours &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;declare&lt;/span&gt; @minutes &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;declare&lt;/span&gt; @seconds &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;declare&lt;/span&gt; @ret &lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(50)
&lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @seconds = datediff(ss, @date1,@date2) 
&lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @totalhours = @seconds / 3600 
&lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @days = @totalhours / 24 
&lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @hours = @totalhours - (@days * 24)
&lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @minutes = ((@seconds - (3600 * @totalhours)) / 60)
&lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @seconds = ((@seconds - (3600 * @totalhours) - (60 * @minutes)))
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(@type = 0)
&lt;span class=&quot;kwrd&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;rem&quot;&gt;--HHH:MM:SS &lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @ret = &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;when&lt;/span&gt; @totalhours &amp;lt; 10 &lt;span class=&quot;kwrd&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;0&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @totalhours) &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @totalhours) &lt;span class=&quot;kwrd&quot;&gt;end&lt;/span&gt; + &lt;span class=&quot;str&quot;&gt;&#39;:&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;right&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;0&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @minutes), 2) + &lt;span class=&quot;str&quot;&gt;&#39;:&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;right&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;0&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @seconds), 2)
&lt;span class=&quot;kwrd&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;rem&quot;&gt;--D HH:MM:SS&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; @ret = &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @days) + &lt;span class=&quot;str&quot;&gt;&#39; &#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;right&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;0&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @hours), 2) + &lt;span class=&quot;str&quot;&gt;&#39;:&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;right&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;0&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @minutes), 2) + &lt;span class=&quot;str&quot;&gt;&#39;:&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;right&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;0&#39;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;convert&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;varchar&lt;/span&gt;(20), @seconds), 2)
&lt;span class=&quot;kwrd&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; @ret
&lt;span class=&quot;kwrd&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/4862628654152760401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/02/formatted-timediff-udf-for-mssql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/4862628654152760401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/4862628654152760401'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/02/formatted-timediff-udf-for-mssql.html' title='Formatted TimeDiff UDF for MSSQL'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-219100947049442367</id><published>2012-02-07T13:13:00.000+01:00</published><updated>2012-02-07T14:13:47.523+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AS2008"/><title type='text'>Custom multiply aggregation function in AS2008</title><content type='html'>In a recent project of mine i needed a custom aggregation function that needed to multiply som yield numbers of a
specific measure in a given dimension.

&lt;br /&gt;
&lt;br /&gt;
My yield numbers are actually stored as a number between 0 and 100.
And not between 0 and 1 which i guess are more common when expressed as percentage.
&lt;br /&gt;
The  reason for this is some limitations in our 3rd party reporting charts.

&lt;br /&gt;
Any way this is how i made the custom aggregation function that will work with both variants:

&lt;br /&gt;
&lt;br /&gt;
Create a c# class library.
&lt;br /&gt;
Add a reference to this dll (ADOMD.Net interfaces):
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;C:\Program Files\Microsoft Analysis Services\AS OLEDB\10\msmgdsrv.dll&lt;/span&gt;&lt;/pre&gt;
Add a class named ASUtils with the following content:

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; ASUtils
{
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;
    &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.AnalysisServices.AdomdServer;

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Multiplication
    {
        [SafeToPrepare(&lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;)]
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; Nullable&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;&amp;gt; Multiply(Set inputSet, Expression inputExpression, &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; divider, &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; excludeZeroValues)
        {            
            Nullable&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;&amp;gt; num = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;
            &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; first = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
            &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (Tuple tuple &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; inputSet.Tuples)
            {
                MDXValue mdxValue = inputExpression.Calculate(tuple);
                &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; isEmpty = (mdxValue.ToChar() == 0x00);
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!isEmpty)
                {
                    &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; value = mdxValue.ToDouble();
                    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (value != 0 || (value == 0 &amp;amp;&amp;amp; excludeZeroValues == &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;))
                    {
                        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (first == &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;)
                        {
                            num = value / divider;
                            first = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
                        }
                        &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
                        {
                            num *= value / divider;
                        }
                    }
                }
            }

            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; num * divider;
        }
    }
}
&lt;/pre&gt;
I did not find any built in functions that could check if a value was empty or not, but this seems to work:
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; isEmpty = (mdxValue.ToChar() == 0x00);&lt;/pre&gt;
Any other solutions out there ?

&lt;br /&gt;
&lt;br /&gt;
Build the project, then in your AS2008 cube project, add a reference to the new class library.
&lt;br /&gt;
In your cube, under calculations.
Add a new calculated member named YieldM with this code:
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;ASUtils.Multiply([Process].[ProcessNoGroup].Children,[Measures].[Yield], 100.0, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;)&lt;/pre&gt;
[Process] = Dimension
&lt;br /&gt;
[ProcessNoGroup] = Hierarchy
&lt;br /&gt;
[Measures].[Yield] = Measure containg numbers between 0 and 100.
&lt;br /&gt;
&lt;br /&gt;
If the measure contains numbers beteen 0 and 1, then you can change the multiplyer to 1 like:
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;ASUtils.Multiply([Process].[ProcessNoGroup].Children,[Measures].[Yield], 1.0, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;)&lt;/pre&gt;
Empty values are always eliminated from the multiply.
&lt;br /&gt;
You can also exclude 0 (zero) values by changing the last parameter to true.
&lt;br /&gt;
&lt;br /&gt;
So if we now look at the yield measure over time and process, we have this test data:
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border: 1pt solid windowtext; height: 14pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; mso-ansi-language: EN-US; mso-themecolor: text1;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Time Dimension&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border-color: windowtext windowtext windowtext rgb(0, 0, 0); border-style: solid solid solid none; border-width: 1pt 1pt 1pt 0px; height: 14pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; mso-ansi-language: EN-US; mso-themecolor: text1;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process Dimension&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border-color: windowtext windowtext windowtext rgb(0, 0, 0); border-style: solid solid solid none; border-width: 1pt 1pt 1pt 0px; height: 14pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; mso-ansi-language: EN-US; mso-themecolor: text1;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Yield&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-irow: 1;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W01&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;94.88&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-irow: 2;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W01&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;96.42&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 13.25pt; mso-yfti-irow: 3;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 13.25pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W01&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 13.25pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 13.25pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;95.03&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-irow: 4;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W02&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;98.86&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 13.25pt; mso-yfti-irow: 5;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 13.25pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W02&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 13.25pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 13.25pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;96.42&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 14.75pt; mso-yfti-irow: 6; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 14.75pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W02&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14.75pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Process3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14.75pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;94.03&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
When we aggregate this by week and look at our calculated YieldM measure:&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border: 1pt solid windowtext; height: 14pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; mso-ansi-language: EN-US; mso-themecolor: text1;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Time Dimension&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border-color: windowtext windowtext windowtext rgb(0, 0, 0); border-style: solid solid solid none; border-width: 1pt 1pt 1pt 0px; height: 14pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; mso-ansi-language: EN-US; mso-themecolor: text1;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;YieldM&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: rgb(217, 217, 217); border-color: windowtext windowtext windowtext rgb(0, 0, 0); border-style: solid solid solid none; border-width: 1pt 1pt 1pt 0px; height: 14pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 103.7pt;&quot; valign=&quot;top&quot; width=&quot;138&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; mso-ansi-language: EN-US; mso-themecolor: text1;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Formula&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-irow: 1;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W01&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;86.93&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 103.7pt;&quot; valign=&quot;top&quot; width=&quot;138&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;(94.88*96.42*95.03)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 14pt; mso-yfti-irow: 2; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext; border-style: none solid solid; border-width: 0px 1pt 1pt; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.3pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;W01&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 73.35pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;89.63&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background-color: transparent; border-color: rgb(0, 0, 0) windowtext windowtext rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; height: 14pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 103.7pt;&quot; valign=&quot;top&quot; width=&quot;138&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;(98.86*96.42*94.03)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
And voila, our custom aggregation is working as it should.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/219100947049442367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/02/custom-multiply-aggregation-function-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/219100947049442367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/219100947049442367'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2012/02/custom-multiply-aggregation-function-in.html' title='Custom multiply aggregation function in AS2008'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-518180566681591665</id><published>2011-12-16T10:57:00.001+01:00</published><updated>2011-12-16T17:49:32.146+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eazfuscator"/><category scheme="http://www.blogger.com/atom/ns#" term="ILMerge"/><title type='text'>Using ILMerge and Eazfuscator.NET</title><content type='html'>I ran into some new requirements on my last project.&lt;br /&gt;
I&#39;ve made an autoupdate system  which will be used for an upcoming project, and i wanted to merge all the dll&#39;s into the autoupdate executable. &lt;br /&gt;
Just to minimize trouble and communication when downloading the autoupdater.&lt;br /&gt;
I also wanted to obfuscate my executable.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Merge Assemblies:&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Now first i stumbled upon ILMerge, which is used to merge assemblies.&lt;br /&gt;
This is a tool release by Microsoft so it should be safe to use, you can read more about it here:&lt;br /&gt;
&lt;a href=&quot;http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx
&quot;&gt;http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
It&#39;s pretty simple to use:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
ILMerge.exe /out:MyMergedExe.exe MyOriginalExe.exe Myfirst.dll MySecond.dll
&lt;/span&gt;&lt;/pre&gt;First, all my projects use framework version 4, so we need to add some parameters so that ILMerge will be able&lt;br /&gt;
to merge a framework version 4.0 project.&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
ILMerge.exe /targetplatform:v4,&quot;C:\Windows\Microsoft.NET\Framework\v4.0.30319&quot; /out:MyMergedExe.exe MyOriginalExe.exe Myfirst.dll MySecond.dll
&lt;/span&gt;&lt;/pre&gt;In the ILMerge folder (C:\Program Files (x86)\Microsoft\ILMerge\), create a file named ILMerge.exe.config: &lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;?&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;configuration&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;startup&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;useLegacyV2RuntimeActivationPolicy&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;requiredRuntime&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;safemode&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;imageVersion&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;v4.0.30319&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;v4.0.30319&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;startup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;configuration&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;Great, now everything runs and works with .NET Framework v4.0. &lt;br /&gt;
&lt;br /&gt;
Then i wanted a more dynamic way to include the DLL&#39;s without editing the ILMerge command line every time.&lt;br /&gt;
Luckily there is a parameter named /wildcards&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
ILMerge.exe /wildcards /targetplatform:v4,&quot;C:\Windows\Microsoft.NET\Framework\v4.0.30319&quot; /out:MyMergedExe.exe MyOriginalExe.exe *.dll
&lt;/span&gt;&lt;/pre&gt;And to get some more information about the merge process, add the /log parameter.&lt;br /&gt;
&lt;br /&gt;
That&#39;s basically everything you need to know about merging assemblies into a single executable.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Obfuscate Executable:&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
So let&#39;s see how we can obfuscate the executable.&lt;br /&gt;
There is a lot of obfuscators out there.&lt;br /&gt;
I tried 3-4 variants, and found a lot of buggy obfuscators out there. Some crashed, some did not work, some costs a lot of $.&lt;br /&gt;
Anyway i ended up with the free EazFuscator.NET. It works, and has a nice commandline interface.&lt;br /&gt;
You can read more about it here:&lt;br /&gt;
&lt;a href=&quot;http://www.eazfuscator.net&quot;&gt;http://www.eazfuscator.net&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
Eazfuscator.NET.exe -s -o MyObfuscatedExe.exe MyMergedExe.exe
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
I also added -s to get some statistics about the merge process.&lt;br /&gt;
You dont need to use the GUI application that comes with Eazfuscator.NET.&lt;br /&gt;
We will use the commandline interface only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Automate, using PostBuild event:&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#39;s automate all this information into a complete build:&lt;br /&gt;
&lt;br /&gt;
In your project, add this to the postbuild event:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
if $(ConfigurationName) == Release $(ProjectDir)\Build\PostBuild.cmd &quot;$(TargetDir)&quot;, &quot;$(TargetName)&quot;
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
Create a folder in your project and name it Build.&lt;br /&gt;
Inside the build folder, create a file named Postbuild.cmd with this content:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
REM Add this to the project Postbuild event: 
REM if $(ConfigurationName) == Release $(ProjectDir)\Build\PostBuild.cmd &quot;$(TargetDir)&quot;, &quot;$(TargetName)&quot;
ECHO --------------------------------------------------------------------------------------------------------------------------
ECHO Executing PostBuild.cmd with parameters: TargetDir=%1, TargetName=%2
CD %1
ECHO Merging Assemblies Into Executable: %2
IF NOT EXIST %1MergedRelease mkdir %1MergedRelease
&quot;C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe&quot; /wildcards /log /targetplatform:v4,&quot;C:\Windows\Microsoft.NET\Framework\v4.0.30319&quot; /out:MergedRelease/%2.exe %2.exe *.dll
ECHO Obfuscating Executable: %2
IF NOT EXIST %1MergedRelease\ObfuscatedRelease mkdir %1MergedRelease\ObfuscatedRelease
&quot;C:\Program Files (x86)\Eazfuscator.NET\Eazfuscator.NET.exe&quot; -s -o MergedRelease/ObfuscatedRelease/%2.exe MergedRelease/%2.exe
ECHO --------------------------------------------------------------------------------------------------------------------------
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Now when building a release build:&lt;br /&gt;
The normal exe with separate dll&#39;s will be created under &lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
$(ProjectDir)\Bin\Release\
&lt;/span&gt;&lt;/pre&gt;Under this folder there will be a subfolder named MergedRelease:  &lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
$(ProjectDir)\Bin\Release\MergedRelease\
&lt;/span&gt;&lt;/pre&gt;In this folder our merged exe with the pdb file will be created.&lt;br /&gt;
&lt;br /&gt;
Under this folder there will be a subfolder named ObfuscatedRelease: &lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;
$(ProjectDir)\Bin\Release\MergedRelease\ObfuscatedRelease\
&lt;/span&gt;&lt;/pre&gt;In this folder our merged and obfuscated exe will be created.&lt;br /&gt;
&lt;br /&gt;
Now thats all, a merged and obfuscated exe everytime you do a release build.</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/518180566681591665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/12/using-ilmerge-and-eazfuscatornet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/518180566681591665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/518180566681591665'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/12/using-ilmerge-and-eazfuscatornet.html' title='Using ILMerge and Eazfuscator.NET'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-9146507170119966014</id><published>2011-03-07T10:43:00.001+01:00</published><updated>2011-03-07T10:48:18.224+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint"/><title type='text'>More readable exception messages in Sharepoint 2010</title><content type='html'>I have the same trouble everytime i upgrade to a newer sharepoint version,&lt;br /&gt;
exception messages that doesn&#39;t tell me anything.&lt;br /&gt;
And everytime i search the net i find a lot of answers that is not working.&lt;br /&gt;
&lt;br /&gt;
So after investigating this, i found the correct way to turn off custom error &lt;br /&gt;
message in sharepoint (This means enabling the display of the actual error message).&lt;br /&gt;
&lt;br /&gt;
This picture shows default error meassages in sharepoint, not&lt;br /&gt;
very helpful when developing webparts:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi30CDrKTuQ6HD0kGI7orqX1cHmZCUppb9Xm8QceogSnJDjAfLPxxItj_I0sN4D3fMMYRbKeolT7BS_L5qI4L9WtRUIhpxqzgfYUmJFnemHG7UFrdwxdxL6slPbBd8uPjqtkSV-7SwsbisS/s1600/Error3.gif&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;137&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi30CDrKTuQ6HD0kGI7orqX1cHmZCUppb9Xm8QceogSnJDjAfLPxxItj_I0sN4D3fMMYRbKeolT7BS_L5qI4L9WtRUIhpxqzgfYUmJFnemHG7UFrdwxdxL6slPbBd8uPjqtkSV-7SwsbisS/s400/Error3.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now to enable more useful error messages, which means turning OFF custom error messages:&lt;br /&gt;
&lt;br /&gt;
Navigate and edit the web.config file located here:&lt;br /&gt;
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config&lt;br /&gt;
&lt;br /&gt;
Change this line:&lt;br /&gt;
From:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;customErrors&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;On&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;To:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;customErrors&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Off&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;Now when an exception occurs in any sharepoint site, it will look like this:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTrPSflSNrLKtxSujDPyb58RGP_S4ZA603wo1zJVFVKJIKgi36NeQh8Is44UvcylwE30errvUdDZmsfDIBxGm6IiVieLpQ0AOiysu0wkO26hlra-FbI7P_qTRM169abEkYjm6jx_8F_1VC/s1600/Error1.gif&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTrPSflSNrLKtxSujDPyb58RGP_S4ZA603wo1zJVFVKJIKgi36NeQh8Is44UvcylwE30errvUdDZmsfDIBxGm6IiVieLpQ0AOiysu0wkO26hlra-FbI7P_qTRM169abEkYjm6jx_8F_1VC/s400/Error1.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Much better, but if you are developing web parts you might want to turn on the call stack too.&lt;br /&gt;
To do this, navigate to the web.config file located under your web site, like:&lt;br /&gt;
C:\inetpub\wwwroot\wss\VirtualDirectories\MyTestSite80\web.config&lt;br /&gt;
&lt;br /&gt;
Change callstack in this line:&lt;br /&gt;
From:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SafeMode&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;MaxControls&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;CallStack&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;DirectFileDependencies&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TotalFileDependencies&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;50&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;AllowPageLevelTrace&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;To:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SafeMode&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;MaxControls&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;CallStack&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;DirectFileDependencies&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TotalFileDependencies&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;50&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;AllowPageLevelTrace&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
Now when an exception occurs in any sharepoint site, it will look like this:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpQDIghQlc2oXu8WpauLde-muLjy8e8K1Vk6au9WiAe-9qQY7Zz-5Xh4nJczLtGTwZI8a5IjDMxJyf51P_cxjdRNlJ3tywz36KLJZ7RxekRosILD3m2uN7e67FxYDrBCMK-KyulYD7CHll/s1600/Error2.gif&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;203&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpQDIghQlc2oXu8WpauLde-muLjy8e8K1Vk6au9WiAe-9qQY7Zz-5Xh4nJczLtGTwZI8a5IjDMxJyf51P_cxjdRNlJ3tywz36KLJZ7RxekRosILD3m2uN7e67FxYDrBCMK-KyulYD7CHll/s400/Error2.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
So just to clarify:&lt;br /&gt;
There is NO need to enable debug in any web.config files (debug=true).&lt;br /&gt;
There is NO need to change customerrors mode inside the web.config under the site, this can be left On.&lt;br /&gt;
There is NO need to change this file: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\web.config.</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/9146507170119966014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/03/more-readable-exception-messages-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/9146507170119966014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/9146507170119966014'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/03/more-readable-exception-messages-in.html' title='More readable exception messages in Sharepoint 2010'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi30CDrKTuQ6HD0kGI7orqX1cHmZCUppb9Xm8QceogSnJDjAfLPxxItj_I0sN4D3fMMYRbKeolT7BS_L5qI4L9WtRUIhpxqzgfYUmJFnemHG7UFrdwxdxL6slPbBd8uPjqtkSV-7SwsbisS/s72-c/Error3.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-574044697652802479</id><published>2011-03-04T10:11:00.013+01:00</published><updated>2011-03-04T10:17:49.217+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint"/><title type='text'>Custom web part pages with navigation,  Sharepoint 2010</title><content type='html'>So even in sharepoint 2010, microsoft has still not added an option to add custom web part pages, just unbelievable :)&lt;br /&gt;
So we are still stuck with editing system files manually to get the look that we want.&lt;br /&gt;
Another thing that really annoys me is that a web part page has no navigation on the left side , i really can&#39;t see &lt;br /&gt;
any use of a sharepoint page without navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;Anyway let&#39;s see how we can make this work a little better.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;When creating a web part page in sharepoint there are 8 available types which can be selected:&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; color: black; width: 536px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 12434; mso-width-source: userset; width: 255pt;&quot; width=&quot;340&quot;&gt;&lt;col style=&quot;mso-width-alt: 1536; mso-width-source: userset; width: 32pt;&quot; width=&quot;42&quot;&gt;&lt;col style=&quot;mso-width-alt: 3181; mso-width-source: userset; width: 65pt;&quot; width=&quot;87&quot;&gt;&lt;col style=&quot;mso-width-alt: 2450; mso-width-source: userset; width: 50pt;&quot; width=&quot;67&quot;&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;background-color: grey; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; height: 15pt; width: 255pt;&quot; width=&quot;340&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Web Part Page&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;xl65&quot; id=&quot;_invisibleIfEmpty&quot; style=&quot;background-color: grey; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; width: 32pt;&quot; width=&quot;42&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Index&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;xl65&quot; style=&quot;background-color: grey; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; width: 65pt;&quot; width=&quot;87&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;ContentPage&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;xl65&quot; style=&quot;background-color: grey; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext 0.5pt solid; width: 50pt;&quot; width=&quot;67&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Image&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Header, Footer, 3 Columns&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd2.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd2.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Full Page, Vertical&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd1.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd1.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Header, Left Column, Body&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd3.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd3.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Header, Right Column, Body&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd4.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd4.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Header, Footer, 2 Columns, 4 Rows&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd5.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd5.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Header, Footer, 4 Columns, Top Row&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;6&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd6.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd6.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Left Column, Header, Footer, Top Row, 3 Columns&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;7&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd7.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd7.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;&lt;td class=&quot;xl67&quot; height=&quot;20&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid; border-top: windowtext; height: 15pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Right Column, Header, Footer, Top Row, 3 Columns&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;8&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd8.aspx&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;xl66&quot; style=&quot;background-color: #d9d9d9; border-bottom: windowtext 0.5pt solid; border-left: windowtext; border-right: windowtext 0.5pt solid; border-top: windowtext;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;spstd8.gif&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;The system content pages can be found here:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\STS\DOCTEMP\SMARTPGS\spstd?.aspx
&lt;/span&gt;&lt;/pre&gt;Graphical view of the types can be found here:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\IMAGES\spstd?.gif
&lt;/span&gt;&lt;/pre&gt;This file links to spcf.aspx&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\STS\DOCTEMP\SMARTPGS\_webpartpage.htm
&lt;/span&gt;&lt;/pre&gt;This is the actual web part page creation form, which will list the 8 different options.&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\spcf.aspx
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
Which contains:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;onetidWebPartPageTemplate&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;WebPartPageTemplate&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;8&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;onchange&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DoTemplateOptionChange()&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;selected&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option2%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option1%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option3%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;4&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option4%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option5%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;6&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option6%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;7&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option7%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;8&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SharePoint:EncodedLiteral&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;&amp;lt;%$Resources:wss,webpagecreation_layout_option8%&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;EncodeMethod&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&#39;HtmlEncode&#39;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; 
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;   
&lt;/pre&gt;For some reason the different types are listed not in sequence, 1 and 2 are switched, sloppy &amp;nbsp;:)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Soulution 1:&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
If you want to include the left navigation bar in web part pages, then remove these lines from all of the spstd?.aspx files&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;...
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
body #s4-leftpanel {
display:none;
}
.s4-ca {
margin-left:0px;
}
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
...
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Content&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ContentPlaceHolderId&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;PlaceHolderLeftNavBar&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
...
&lt;/pre&gt;This will enable navigation, removing the style element is something new in sharepoint 2010.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;If you want to customize a web part page like adding more web part zones etc you need to edit one of the spstd?.aspx pages.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;The part which you need to change is this (located at the bottom in the file):&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;cellpadding&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;4&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;cellspacing&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;colspan&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;3&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;valign&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;top&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;webpartpages:webpartzone&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;loc:Header&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Header&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;frametype&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;TitleBarOnly&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;valign&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;top&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;webpartpages:webpartzone&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;loc:LeftColumn&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;LeftColumn&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;frametype&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;TitleBarOnly&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;valign&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;top&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;webpartpages:webpartzone&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;loc:MiddleColumn&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;MiddleColumn&quot;&lt;/span&gt;
                    &lt;span class=&quot;attr&quot;&gt;frametype&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;TitleBarOnly&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;valign&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;top&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;webpartpages:webpartzone&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;loc:RightColumn&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RightColumn&quot;&lt;/span&gt;
                    &lt;span class=&quot;attr&quot;&gt;frametype&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;TitleBarOnly&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_invisibleIfEmpty&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;colspan&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;3&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;valign&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;top&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;webpartpages:webpartzone&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;loc:Footer&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Footer&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;frametype&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;TitleBarOnly&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt; (MSOLayout_MakeInvisibleIfEmpty) == &lt;span class=&quot;str&quot;&gt;&quot;function&quot;&lt;/span&gt;) { MSOLayout_MakeInvisibleIfEmpty(); }&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;This is the default layout for spstd2.aspx. &lt;br /&gt;
Now you can change the table, adding more webpart zones etc. Just remember to name the zones properly.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;If you change the layout it&#39;s a good idea to change the spstd?.gif image too so that it will reflect the layout.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;When you change the content page and save it, it will immediatly change in sharepoint for all of the pages that are based on the modified page.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Soulution 2:&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
There is also another option which kinda works but will require sharepoint designer everytime you create a new page.&lt;br /&gt;
It&#39;s not as smooth and integrated as editing the system files.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;In sharepoint desinger 2010:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Open the site.&lt;/li&gt;
&lt;li&gt;Select site pages, select file then new page from master.&lt;/li&gt;
&lt;li&gt;Inside PlaceHolderMain, add a table, inside the cells add web part zones.&lt;/li&gt;
&lt;li&gt;Save it as MyTemplate.aspx&lt;/li&gt;
&lt;li&gt;Close sharepoint designer.&lt;/li&gt;
&lt;li&gt;Open the site, then site actions, site settings.&lt;/li&gt;
&lt;li&gt;Under galleries, site content types, Create.&lt;/li&gt;
&lt;li&gt;Name: SpecialWebPartPage.&lt;/li&gt;
&lt;li&gt;Select Parent content type from: Document Content Types&lt;/li&gt;
&lt;li&gt;Parent Content Type: Web Part Page&lt;/li&gt;
&lt;li&gt;Then press ok to save.&lt;/li&gt;
&lt;li&gt;Select the SpecialWebPartPage.&lt;/li&gt;
&lt;li&gt;Advanced settings.&lt;/li&gt;
&lt;li&gt;Change document Template to: /Sites/YourSite/SitePages/MyTemplate.aspx&lt;/li&gt;
&lt;li&gt;Save.&lt;/li&gt;
&lt;li&gt;Create a document library with document template: Web Part Page&lt;/li&gt;
&lt;li&gt;Go into library settings for the document library.&lt;/li&gt;
&lt;li&gt;Advanced settings.&lt;/li&gt;
&lt;li&gt;Enable allow management of content types.&lt;/li&gt;
&lt;li&gt;Save.&lt;/li&gt;
&lt;li&gt;Select Add from existing site content types.&lt;/li&gt;
&lt;li&gt;Select the SpecialWebPartPage.&lt;/li&gt;
&lt;li&gt;Save.&lt;/li&gt;
&lt;li&gt;Select&amp;nbsp; new button order and default content type.&lt;/li&gt;
&lt;li&gt;Select the new content type to visible position from top = 1 (which makes it default).&lt;/li&gt;
&lt;li&gt;Select the old document type to visible = false.&lt;/li&gt;
&lt;li&gt;Now view the document library, select documents, click new document.&lt;/li&gt;
&lt;li&gt;Sharepoint designer will be started.&lt;/li&gt;
&lt;li&gt;Now save the file in the appropriate folder in the document library.&lt;/li&gt;
&lt;li&gt;View the page in the document library, select edit page, now you will see the web part zones as defined in your template.&lt;/li&gt;
&lt;/ul&gt;And this page has the left navigation menu intact.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;Works well except that you need sharepoint designer to save the new page.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;It&#39;s probably possible to make it smoother if the template is located inside the TEMPLATE\LAYOUTS folder like the basic page template bpcf.aspx.&lt;br /&gt;
I did a couple of tests, and it certainly treats this template in the same way as basic page template, &lt;br /&gt;
but ran into several problems with the masterpage and includes which required a lot of modifications of the template.&lt;br /&gt;
Seems like there is a lot of logic in the basic page template that needs to be adopted.&lt;br /&gt;
But i haven&#39;t investigated this any further.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;If anyone has a better solution for this let me know :)</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/574044697652802479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/03/custom-web-part-pages-with-navigation.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/574044697652802479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/574044697652802479'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/03/custom-web-part-pages-with-navigation.html' title='Custom web part pages with navigation,  Sharepoint 2010'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-6599502982131938953</id><published>2011-01-26T10:24:00.003+01:00</published><updated>2011-01-28T14:18:03.572+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FXCop"/><title type='text'>Static code analysis and CA2000 warning</title><content type='html'>After upgrading to visual studio 2010, i started to get a lot of CA2000 warnings when running static code analysis.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s look at this example function:&lt;br /&gt;
&lt;div class=&quot;sh_result&quot;&gt;&lt;pre&gt;&lt;span class=&quot;net_key&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;net_key&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;net_key&quot;&gt;void&lt;/span&gt; PopulateMyTable1(&lt;span class=&quot;net_class&quot;&gt;HtmlTable&lt;/span&gt; table)
{
    table.Rows.Clear();
    &lt;span class=&quot;net_class&quot;&gt;HtmlTableRow&lt;/span&gt; row = &lt;span class=&quot;net_key&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;net_class&quot;&gt;HtmlTableRow&lt;/span&gt;();
    row.ID = &lt;span class=&quot;net_string&quot;&gt;&quot;MyRow&quot;&lt;/span&gt;;
    row.Visible = &lt;span class=&quot;net_key&quot;&gt;false&lt;/span&gt;;
    &lt;span class=&quot;net_class&quot;&gt;HtmlTableCell&lt;/span&gt; cell = &lt;span class=&quot;net_key&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;net_class&quot;&gt;HtmlTableCell&lt;/span&gt;();
    cell.Attributes.Add(&lt;span class=&quot;net_string&quot;&gt;&quot;class&quot;&lt;/span&gt;, &lt;span class=&quot;net_string&quot;&gt;&quot;MyClass&quot;&lt;/span&gt;);
    cell.Height = &lt;span class=&quot;net_string&quot;&gt;&quot;20px&quot;&lt;/span&gt;;
    row.Cells.Add(cell);
    table.Rows.Add(row);
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Generates these warnings:&lt;br /&gt;
&lt;div class=&#39;sh_result&#39;&gt;&lt;span class=&#39;net_string&#39;&gt;CA2000 : Microsoft.Reliability : In method &#39;TestClass.PopulateMyTable1(HtmlTable)&#39;, object &#39;cell&#39; is not disposed along all exception paths. &lt;br /&gt;
Call System.IDisposable.Dispose on object &#39;cell&#39; before all references to it are out of scope.&lt;br /&gt;
CA2000 : Microsoft.Reliability : In method &#39;TestClass.PopulateMyTable1(HtmlTable)&#39;, object &#39;row&#39; is not disposed along all exception paths. &lt;br /&gt;
Call System.IDisposable.Dispose on object &#39;row&#39; before all references to it are out of scope.&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The warnings are generated because we are calling properties that can cause an exception, which will cause the object not beeing disposed properly.&lt;br /&gt;
So how can we fix this ?&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;sh_result&quot;&gt;&lt;pre&gt;&lt;span class=&quot;net_key&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;net_key&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;net_key&quot;&gt;void&lt;/span&gt; PopulateMyTable2(&lt;span class=&quot;net_class&quot;&gt;HtmlTable&lt;/span&gt; table)
{
    table.Rows.Clear();
    &lt;span class=&quot;net_class&quot;&gt;HtmlTableRow&lt;/span&gt; row = &lt;span class=&quot;net_key&quot;&gt;null&lt;/span&gt;;
    &lt;span class=&quot;net_key&quot;&gt;try&lt;/span&gt;
    {
        row = &lt;span class=&quot;net_key&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;net_class&quot;&gt;HtmlTableRow&lt;/span&gt;();
        row.ID = &lt;span class=&quot;net_string&quot;&gt;&quot;MyRow&quot;&lt;/span&gt;;
        row.Visible = &lt;span class=&quot;net_key&quot;&gt;false&lt;/span&gt;;
    }
    &lt;span class=&quot;net_key&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;net_class&quot;&gt;Exception&lt;/span&gt;)
    {
        row.Dispose();
        &lt;span class=&quot;net_key&quot;&gt;throw&lt;/span&gt;;
    }
 
    table.Rows.Add(row);
 
    &lt;span class=&quot;net_class&quot;&gt;HtmlTableCell&lt;/span&gt; cell = &lt;span class=&quot;net_key&quot;&gt;null&lt;/span&gt;;
    &lt;span class=&quot;net_key&quot;&gt;try&lt;/span&gt;
    {
        cell = &lt;span class=&quot;net_key&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;net_class&quot;&gt;HtmlTableCell&lt;/span&gt;();
        cell.Attributes.Add(&lt;span class=&quot;net_string&quot;&gt;&quot;class&quot;&lt;/span&gt;, &lt;span class=&quot;net_string&quot;&gt;&quot;MyClass&quot;&lt;/span&gt;);
        cell.Height = &lt;span class=&quot;net_string&quot;&gt;&quot;20px&quot;&lt;/span&gt;;
    }
    &lt;span class=&quot;net_key&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;net_class&quot;&gt;Exception&lt;/span&gt;)
    {
        cell.Dispose();
        &lt;span class=&quot;net_key&quot;&gt;throw&lt;/span&gt;;
    }
 
    row.Cells.Add(cell);            
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
This generates no CA2000 warnings, but talk about code cluttering.&lt;br /&gt;
Let&#39;s try something else:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;sh_result&quot;&gt;&lt;pre&gt;&lt;span class=&quot;net_key&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;net_key&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;net_key&quot;&gt;void&lt;/span&gt; PopulateMyTable3(&lt;span class=&quot;net_class&quot;&gt;HtmlTable&lt;/span&gt; table)
{
    table.Rows.Clear();
    &lt;span class=&quot;net_class&quot;&gt;HtmlTableRow&lt;/span&gt; row = &lt;span class=&quot;net_key&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;net_class&quot;&gt;HtmlTableRow&lt;/span&gt;();
    table.Rows.Add(row);
    row.ID = &lt;span class=&quot;net_string&quot;&gt;&quot;MyRow&quot;&lt;/span&gt;;
    row.Visible = &lt;span class=&quot;net_key&quot;&gt;false&lt;/span&gt;;
    &lt;span class=&quot;net_class&quot;&gt;HtmlTableCell&lt;/span&gt; cell = &lt;span class=&quot;net_key&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;net_class&quot;&gt;HtmlTableCell&lt;/span&gt;();
    row.Cells.Add(cell);
    cell.Attributes.Add(&lt;span class=&quot;net_string&quot;&gt;&quot;class&quot;&lt;/span&gt;, &lt;span class=&quot;net_string&quot;&gt;&quot;MyClass&quot;&lt;/span&gt;);
    cell.Height = &lt;span class=&quot;net_string&quot;&gt;&quot;20px&quot;&lt;/span&gt;;
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Since we always add the new objects to the collection before calling any properties/methods then there will be no CA2000 warnings.&lt;br /&gt;
&lt;br /&gt;
A much safer approach, because if an exception is thrown by calling a property then it will be taken care of when disposing the collection.</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/6599502982131938953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/01/static-code-analysis-and-ca2000-warning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/6599502982131938953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/6599502982131938953'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/01/static-code-analysis-and-ca2000-warning.html' title='Static code analysis and CA2000 warning'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3573440240682040988.post-8381664433534116491</id><published>2011-01-24T17:49:00.000+01:00</published><updated>2011-01-25T14:03:05.914+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FXCop"/><title type='text'>Annoying static code analysis errors in visual studio 2010</title><content type='html'>I have just upgraded to VisualStudio 2010, and ran into these annoying warnings.&lt;br /&gt;
&lt;br /&gt;
CA0503 : The CodeAnalysisRules property is deprecated. Use the CodeAnalysisRuleSet property instead.&lt;br /&gt;
CA0505 : The CodeAnalysisRules property will be ignored because the CodeAnalysisRuleSet property is defined.&lt;br /&gt;
&lt;br /&gt;
In visual studio 2008 the only way of using a centralized rules file was to add the following line to the end of&lt;br /&gt;
our project file:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&#39;color:#000000;background:#eeeeee;font-size:0.8em;&#39;&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;Import&lt;/span&gt; Project=&lt;span style=&#39;color:#2a00ff; &#39;&gt;&quot;&lt;/span&gt;&lt;span style=&#39;color:#2a00ff; &#39;&gt;C:\Projects\Applications\Common\Rules\MyCompany.CodeAnalysis.Rules.targets&lt;/span&gt;&lt;span style=&#39;color:#2a00ff; &#39;&gt;&quot;&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;/&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
In 2010 you can browse for an existing rules file from within the project options.&lt;br /&gt;
And it will store the rules file like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&#39;color:#000000;background:#eeeeee;font-size:0.8em;&#39;&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;CodeAnalysisRuleSet&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;&gt;&lt;/span&gt;&lt;span style=&#39;color:#2a00ff; &#39;&gt;..\..\Common\Rules\MyCompany.CodeAnalysis.ruleset&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;CodeAnalysisRuleSet&lt;/span&gt;&lt;span style=&#39;color:#7f0055; &#39;&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
If you have defined both, then you will get the CA503 and CA505 errors.&lt;br /&gt;
So in visual studio 2010, just remove the old style import tag.</content><link rel='replies' type='application/atom+xml' href='http://xtrmdevtips.blogspot.com/feeds/8381664433534116491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/01/annoying-static-code-analysis-errors-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/8381664433534116491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3573440240682040988/posts/default/8381664433534116491'/><link rel='alternate' type='text/html' href='http://xtrmdevtips.blogspot.com/2011/01/annoying-static-code-analysis-errors-in.html' title='Annoying static code analysis errors in visual studio 2010'/><author><name>Bjørn Larsen</name><uri>http://www.blogger.com/profile/16818641433609146792</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfkUnyPdj8-0de3AI0hMI2OxJsKI1boXsktsL1PUomdhfmfCSBeDLgU574zbFSKd22WmjA6sYVWjKJEUehq83QQR9R8wVAv8rinCEfH51aS1Qxt7xVaTsrEIEvLXIPPcw/s220/bjorn.jpg'/></author><thr:total>0</thr:total></entry></feed>