<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_Exploration - Hunting...</title><subtitle type="text">技术，在于创新。但贵在活学活用。</subtitle><id>http://feed.cnblogs.com/blog/u/34331/rss</id><updated>2010-09-13T06:23:25Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/34331/rss"/><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/09/13/1824975.html</id><title type="text">Analysis Services中的命名集(Named Sets)</title><summary type="text">命名集是SSAS中非常有用的一个元素，和Calculated Members（计算成员）一样能够简化我们的很多工作并且之间还有些许的联系。那么什么是Named Sets呢，简单的说就是分配了名字的成员和元组集。我们通过定义Named Sets来使得用户更方便的构建自己的查询，并帮助开发人员编写具有高可读性的代码。 </summary><published>2010-09-13T06:23:00Z</published><updated>2010-09-13T06:23:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/09/13/1824975.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/09/13/1824975.html"/><content type="html">&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;命名集是SSAS中非常有用的一个元素，和Calculated Members（计算成员）一样能够简化我们的很多工作并且之间还有些许的联系。那么什么是Named Sets呢，简单的说就是分配了名字的成员和元组集。我们通过定义Named Sets来使得用户更方便的构建自己的查询，并帮助开发人员编写具有高可读性的代码。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;Regular Named Sets &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;让我们通过例子来看看如何使用Named Sets。我么的用户想要建立一个Excel报表用来显示当前月、前一月的销售额以及最近三年的销售总额。如果不使用Named set，用户需要在每个月月初来更新报表中选定的日期以便显示最近月份的数据。为了避免这么做，我们可以定义一个包含用户想在报表中看到的日期范围的Named Set，用户也不需要再次手动更新。以下介绍了如何做到这些： &lt;/p&gt;&#xD;
&lt;p&gt;首先，我们需要确定哪些月份是有销售数据的，因为在日期维度中包含的将来日期肯定不包含任何销售数据。这个可以通过NonEmpty函数计算： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color: blue;"&gt;HIDDEN&lt;/span&gt; &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;CurrentCube&lt;/span&gt;.[ExistingSalePeriods] &lt;span style="color: blue;"&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: maroon;"&gt;NonEmpty&lt;/span&gt; ( &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;[Date].[Calendar].[Month].&lt;span style="color: blue;"&gt;Members&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Measures.[Sales Amount] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;);&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;我们将这个命名集设置为对用户隐藏，因为它只会在中间步骤被使用而无需呈现给用户。 &lt;/p&gt;&#xD;
&lt;p&gt;接下来，我们将创建一个前一月的日期命名集。因为我们仍然对前一月的销售数据感兴趣，而且我们已经定义了截至目前为止的所有有销售数据的日期集，所以我们可以很容易的得到前一月的定义： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;CurrentCube&lt;/span&gt;.[LastSaleMonth] &lt;span style="color: blue;"&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: maroon;"&gt;Tail&lt;/span&gt; (ExistingSalePeriods, 1);&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;有了前一月的定义，我们离目标又近了一步。当然，它对于用户来说也是有用的，所以我们设置为对用户可见。最后一个命名集定义是包含年这一层次的成员集合。下边我们创建一个包含最近一年销售数据的命名集： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;CurrentCube&lt;/span&gt;.[LastSaleYear] &lt;span style="color: blue;"&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: maroon;"&gt;Ancestor&lt;/span&gt; ( &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;LastSaleMonth.&lt;span style="color: blue;"&gt;Item&lt;/span&gt; (0), &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;[Date].[Calendar].[Calendar Year] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;);&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;最后一步是创建我们最终的命名集： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;CURRENTCUBE&lt;/span&gt;.LastSaleAnalysisPeriod &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; { &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;LastSaleYear.&lt;span style="color: blue;"&gt;Item&lt;/span&gt; (0).&lt;span style="color: blue;"&gt;Lag&lt;/span&gt;(2) : &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;LastSaleYear.&lt;span style="color: blue;"&gt;Item&lt;/span&gt; (0), &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;LastSaleMonth.&lt;span style="color: blue;"&gt;Item&lt;/span&gt; (0).&lt;span style="color: maroon;"&gt;PrevMember&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;LastSaleMonth.&lt;span style="color: blue;"&gt;Item&lt;/span&gt; (0) &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;} ;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;现在，命名集已经成功创建，用户可以很容易地通过客户端工具在报表中使用： &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091310_0621_AnalysisSer1.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;命名集在每次对Cube的处理时进行创建和计算，这样，每个新的月份的销售数据显示，命名集都会反应今年以及报表显示所需要的时间并刷新报表数据。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;动态命名集(Dynamic Named Set) &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;创建命名集的时候允许你选择是静态(Static)还是动态(Dynamic)命名集，对于静态命名集(Static)，数据将被保留一直到对Cube执行下一次的处理。只某些情况下静态的是有用的，比如你想提高查询性能，但有时却相当令人沮丧，比如我们要定义一个集合包含10个最畅销的产品： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;CURRENTCUBE&lt;/span&gt;.Best10Products &lt;span style="color: blue;"&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: maroon;"&gt;TopCount&lt;/span&gt; ( &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Product.Product.Product.&lt;span style="color: blue;"&gt;Members&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;10, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Measures.[Sales Amount] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;);&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;由于静态命名集只计算一次，Best10Products 命名集将包含所有可以在所有时间中最畅销的产品。换句话说，当命名集被计算时，它不知道在哪个查询中会被使用到。然而，这个命名集不会在报表中被用到太多，因为在报表中很可能是对每个国家每一月销售量的前十位进行统计，这样静态命名集就没法实现。例如，以下两个查询将一直返回相同的产品列表即便它们选定的年份不同： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt; Measures.[Sales Amount] &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;COLUMNS&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Best10Products &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;ROWS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt; [Adventure Works] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;WHERE&lt;/span&gt; ([Date].[Calendar].[Calendar Year].&amp;amp;[2001]) &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt; Measures.[Sales Amount] &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;COLUMNS&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Best10Products &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;ROWS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt; [Adventure Works] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;WHERE&lt;/span&gt; ([Date].[Calendar].[Calendar Year].&amp;amp;[2004])&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;Analysis Services 2008引入了动态命名集(Dynamic)来解决这个问题。动态命名集会在Where子句的上下文中总是被重新计算，也就是说动态命名集在每个查询中都被重新计算一次。 &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color: blue;"&gt;DYNAMIC&lt;/span&gt; &lt;span style="color: blue;"&gt;SET&lt;/span&gt; &lt;span style="color: blue;"&gt;CURRENTCUBE&lt;/span&gt;.[Best10ProductsDynamic] &lt;span style="color: blue;"&gt;AS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: maroon;"&gt;TopCount&lt;/span&gt; ( &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Product.Product.Product.&lt;span style="color: blue;"&gt;Members&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;10, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Measures.[Sales Amount] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;);&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;现在我们再次运行以下两个查询： &lt;/p&gt;&#xD;
&lt;div style="margin-left: 26pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse; background: #d9d9d9;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 555px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt; Measures.[Sales Amount] &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;COLUMNS&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Best10ProductsDynamic &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;ROWS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt; [Adventure Works] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;WHERE&lt;/span&gt; ([Date].[Calendar].[Calendar Year].&amp;amp;[2001]) &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt; Measures.[Sales Amount] &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;COLUMNS&lt;/span&gt;, &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Best10ProductsDynamic &lt;span style="color: blue;"&gt;ON&lt;/span&gt; &lt;span style="color: blue;"&gt;ROWS &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt; [Adventure Works] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="color: blue;"&gt;WHERE&lt;/span&gt; ([Date].[Calendar].[Calendar Year].&amp;amp;[2004])&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;现在我们得到了正确的每一年中最畅销的10个产品列表。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1824975.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/09/13/1824975.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/09/10/1823450.html</id><title type="text">Performance Point – 如何设置KPI的计分方式和指示器</title><summary type="text">在Performance Point Server中，KPI是最为频繁被使用的工具之一，我们通过KPI来显示一个目标值和实际值并以简单的图形来直观的表示其是否达到目标。在Performance Point Server 2007中，分别提供了三种计分方式（Scoring Pattern）和三种不同的区间划分方法 (Banding Method) 。本文将一一介绍如何使用计分方式和区间划分方法来达到您的业务需求。 </summary><published>2010-09-10T08:45:00Z</published><updated>2010-09-10T08:45:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/09/10/1823450.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/09/10/1823450.html"/><content type="html">&lt;p&gt;在Performance Point Server中，KPI是最为频繁被使用的工具之一，我们通过KPI来显示一个目标值和实际值并以简单的图形来直观的表示其是否达到目标。在Performance Point Server 2007中，分别提供了三种计分方式（Scoring Pattern）和三种不同的区间划分方法 (Banding Method) 。本文将一一介绍如何使用计分方式和区间划分方法来达到您的业务需求。 &lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;计分方式Scoring Pattern &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Scoring Pattern定义了这个KPI的实际值想的走向趋势。通俗的说就是值越高（大）越好，还是越低（小）越好，或者是越趋近于某个值越好。对于一个KPI来说不外乎这三种趋势。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;Increasing Is Better &lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;此种方式表示KPI的Actual值越大越好。换句话说，如果这个值的区间范围可以在0-50之间，那么30肯定是比10要好的。反应在Indicator上或许30显示的就是绿色，而10显示的就是红色或者黄色&amp;mdash;当然这取决于你的区间设置和Indicator中灯的设置。比如在展示销售数据的时候一般情况下肯定会选择Increasing Is Better，表示销售值越高企业效益越好。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;Decreasing Is Better &lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;此种方式表示KPI的Actual值越小越好。举个例子，如果某个值的区间范围在0-50之间，那么0肯定比30要好。同样的，反映到Indicator上0就应该是绿色，而30很可能就是黄色或者红色。常见的例子是一个企业的事故发生情况，如果事故不发生或少发生当然是好的，说明安全生产。如果事故发生比较多，那企业肯定是有生存危机的，这个指标就不合格 。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;Closer Is Better &lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;上边两种方式都是一个升序或者降序的方式来反映KPI的趋势，决定了其在什么情况下以哪个值更好。但还有一种情况，就是从两边趋向于某个值，越接近这个值表示效益越好。这就是Closer Is Better。比如我们设定某个值0.5作为最佳值，越接近0.5表示这个KPI指标越好，离的越远表示指标越差. &lt;/p&gt;&#xD;
&lt;p&gt;在Closer Is Better下，对于区间的设置是有限制的: 需要有5个阀值来定义5个区间。而且其必须遵循下边的方式，由两边向中间趋近： &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance1.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;/ol&gt;&lt;/li&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;span style="font-size: 14pt;"&gt;&lt;strong&gt;区间划分方法(Banding Method) &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Banding Method定义了如何来计算Actual在哪个区间中，并驱动显示哪个颜色/形状的指示器。Performance Point Server 2007提供了3中Banding Method。 &lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;Band by normalized value of Actual/Target使用实际值/目标值的规范化数据 &lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;使用实际值/目标值的规范化数据允许你通过比较Actual和Target值以及整个区间的情况的来决定其位于哪个区间。计算公式更能明确的表达这个意图： &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance2.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 1: Band by normalized value of Actual/Target &amp;ndash; Decreasing Is Better &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance3.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 2： Band by normalized value of Actual/Target &amp;ndash; Increasing Is Better &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;区间值 = 1- (实际值到最差值的距离 / 目标值到最差值的距离) &amp;ndash; Decreasing Is Better &lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;区间值= (实际值到最差值的距离 / 目标值到最差值的距离) -- Increasing Is Better &lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;举个例子，我们设定某个KPI的目标值为50，最差值为0，实际值为45.对照上边的图我们可以得到以下值： &lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;/ol&gt;&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;ul style="margin-left: 72pt;"&gt;&#xD;
&lt;li&gt;目标值：50 &lt;/li&gt;&#xD;
&lt;li&gt;实际值：45 &lt;/li&gt;&#xD;
&lt;li&gt;最差值： 0 &lt;/li&gt;&#xD;
&lt;li&gt;实际值到最差值的距离：45 &lt;/li&gt;&#xD;
&lt;li&gt;目标值到最差值的距离：50 &lt;/li&gt;&#xD;
&lt;/ul&gt;&#xD;
&lt;p&gt;按上边的公式计算得到，最终在区间中的值为90%。如果我们设置下边的阀值区间，那么这个KPI将会显示黄色指示灯。因为它位于黄色的区间80%-100%： &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance4.png" /&gt; &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;Figure 3: 设置Indicator &lt;/p&gt;&#xD;
&lt;p style="margin-left: 18pt;"&gt;上图定义了三个区间： &lt;/p&gt;&#xD;
&lt;ul style="margin-left: 57pt;"&gt;&#xD;
&lt;li&gt;绿色：Actual &amp;gt;100% &lt;/li&gt;&#xD;
&lt;li&gt;黄色：80% &amp;lt;= Actual &amp;lt;= 100% &lt;/li&gt;&#xD;
&lt;li&gt;红色：Actual &amp;lt; 80% &lt;/li&gt;&#xD;
&lt;/ul&gt;&#xD;
&lt;p&gt;同样的情况下，如果实际值是30，那么将位于红色区间内。 &lt;/p&gt;&#xD;
&lt;p style="margin-left: 39pt;"&gt;&lt;/p&gt;&#xD;
&lt;ol style="margin-left: 39pt;"&gt;&#xD;
&lt;li&gt;&lt;strong&gt;Band by numeric value of Actual使用实际值的数值 &lt;/strong&gt;&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;使用实际值的数值来区分的方法只是将但的将实际值与实现在Thresholds中设置的值来做对比以决定其位于哪个区间： &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance5.png" /&gt; &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;Figure 4: Band by numeric value of Actual &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;&lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;当选择Band by numeric value of Actual时，对于Threshold的区间设置将不再是百分比方式的，而是和计量值相同的单位。比如如果Actual是整数，那threshold的值也将以整数方式来设置。 &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;&lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance6.png" /&gt; &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;Figure 5：按Actual的值来划分区间时Threshold的设置 &lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;&lt;/p&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;如果按上图来设置一个Threshold　区间，其表明： &lt;/p&gt;&#xD;
&lt;ul style="margin-left: 72pt;"&gt;&#xD;
&lt;li&gt;绿色：Actual &amp;lt;= 333.33 &lt;/li&gt;&#xD;
&lt;li&gt;黄色：333.33 &amp;lt; Actual &amp;lt;= 666.67 &lt;/li&gt;&#xD;
&lt;li&gt;红色：Actual &amp;gt; 666.67 &lt;/li&gt;&#xD;
&lt;/ul&gt;&#xD;
&lt;p&gt;此时，如果我们的实际值为500，则显示黄色指示灯，如果为300则一定显示绿色指示灯。这种纯粹的依靠Actual和某个具体值做比较来确定的方式非常简单，也非常直观。 &lt;/p&gt;&#xD;
&lt;p style="margin-left: 39pt;"&gt;&lt;/p&gt;&#xD;
&lt;ol style="margin-left: 39pt;"&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;Band by stated score (advanced)使用特定的分数（高级） &lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;选择Band by stated score往往是因为你将Performance Point和SQL Server Analysis Service连在了一起，你想通过自己在Cube中的计算列或者度量值来告诉Performance Point该显示哪个颜色。对于返回的值，通常来说属于-1到1之间的值，这个区间其实原则上设定了三个颜色所对应的点：-1， 0和1. &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance7.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 6：Band by stated score的定义。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;选择了这种方式后，你需要关联Analysis Service的度量值/计算列，来告诉Performance Point到哪儿去取值来决定显示哪个指示灯： &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/091010_0843_Performance8.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 7：Dimensional Data Source Mapping &lt;/p&gt;&#xD;
&lt;p&gt;而其他的指示灯设置则和另外两种方式相同，选择不同的区间范围来限定Dimensional Data Source返回的值应该处于哪个指示区间内。 &lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1823450.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/09/10/1823450.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/08/24/1807304.html</id><title type="text">TIP:Connect to remote SQL Server on different port number</title><summary type="text">It's quite simple but only for those who don't know this;)When you want to connect to a remote SQL Server on a different port number(not 1433) in SQL Server management studio, you need toadd a comma a...</summary><published>2010-08-24T07:32:00Z</published><updated>2010-08-24T07:32:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/08/24/1807304.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/08/24/1807304.html"/><content type="html">&lt;p&gt;It's quite simple but only for those who don't know this;)&lt;/p&gt;&#xD;
&lt;p&gt;When you want to connect to a remote SQL Server on a different port number(not 1433) in SQL Server management studio, you need to&amp;nbsp;add a comma and the port number&amp;nbsp;to&amp;nbsp;the end of&amp;nbsp;the server name. &lt;/p&gt;&#xD;
&lt;p&gt;So if you want to connect to&amp;nbsp;MySqlServer.MyDomain.com on port 3821, you type... &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;MySqlServer.MyDomain.com,3821&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Quite simple, but it's useful. Don't forget to configure the remote server to&amp;nbsp;allow remote connections. &lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1807304.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/08/24/1807304.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/08/14/1799567.html</id><title type="text">SQL Server Analysis Service - 在维度中使用分组 (Discretization)</title><summary type="text">成员组是系统生成的连续维度成员的集合。 在 Microsoft SQL Server Analysis Services 中，可以通过名为离散化的进程将属性成员分成若干成员组。层次结构中的级别或者包含成员组，或者包含成员，但是不能同时包含二者。 业务用户浏览包含成员组的级别时，将看见成员组的名称和单元值。 由 Analysis Services 为了支持成员组而生成的成员称为分组成员，看上去与普通成员相同。</summary><published>2010-08-14T05:22:00Z</published><updated>2010-08-14T05:22:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/08/14/1799567.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/08/14/1799567.html"/><content type="html">&lt;p&gt;在SQL Server Analysis Service中，维度(Dimension)是一个非常重要的概念，通常情况下一个包含多个属性，每个属性为某个对象（例如Customer， Product等）的一个字段表现。这样，对于每个维度的特定属性，唯一列举了所有可能出现的值。在某些情况下，这些属性具有数百万个值而且不具有任何层次结构，这对于业务人员来说要想找到某个特定的值就会非常困难，如果能够将他们分组-例如Year-Quater-Month-Date这样的结构类似，但不采用Hierarchy--这样寻找起来就会非常简单。这就引入了分组的概念。举个简单的例子对于年收入，在一个拥有数百万员工的单位，每个人的工资收入在很大范围内是不同的，这样Yearly Income这个属性就会有很多的值。而在现实中我们可能更喜欢根据一个区间去限制这些统计值。分组的概念就是将这些属性值按区间进行归类。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;成员组是系统生成的连续维度成员的集合。 在 Microsoft SQL Server Analysis Services 中，可以通过名为离散化的进程将属性成员分成若干成员组。层次结构中的级别或者包含成员组，或者包含成员，但是不能同时包含二者。 业务用户浏览包含成员组的级别时，将看见成员组的名称和单元值。 由 Analysis Services 为了支持成员组而生成的成员称为分组成员，看上去与普通成员相同。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;通过使用DiscretizationMethod和DiscretizationBucketCount属性，Analysis Service可以自动为您创建组.使用&lt;strong&gt;DiscretizationMethod&lt;/strong&gt; 属性控制成员的分组方式:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;table width="716" cellpadding="2" cellspacing="0" border="0"&gt;&#xD;
&lt;tbody&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td width="200" valign="top"&gt;&lt;strong&gt;DiscretizationMethod&lt;/strong&gt; 设置&lt;/td&gt;&#xD;
&lt;td width="514" valign="top"&gt;&amp;nbsp;&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td width="200" valign="top"&gt;&#xD;
&lt;p&gt;&lt;strong&gt;None&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td width="514" valign="top"&gt;显示成员，不分组。&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td width="200" valign="top"&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Automatic&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td width="514" valign="top"&gt;&#xD;
&lt;p&gt;选择最佳数据表示法： &lt;strong&gt;EqualAreas&lt;/strong&gt; 方法或 &lt;strong&gt;Clusters&lt;/strong&gt; 方法。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td width="200" valign="top"&gt;&#xD;
&lt;p&gt;&lt;strong&gt;EqualAreas&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td width="514" valign="top"&gt;&#xD;
&lt;p&gt;尝试将属性中的成员分成若干包含相同数量成员的组。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td width="200" valign="top"&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Clusters&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td width="514" valign="top"&gt;&#xD;
&lt;p&gt;尝试通过抽样定型数据、初始化为大量随机点和运行几次期望最大化 (EM) 聚类分析算法的迭代来将属性中的成员分成若干组。 &lt;/p&gt;&#xD;
&lt;p&gt;本方法的好处是适用于任何分布曲线，但就处理时间而言开销较大。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;p&gt;例如，对于Adventure Works DW2008，我将Yearly Income的DiscretizationMethod属性设置为Automatic后会有如下分组：&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/SSAS2008Discretization_BBEA/image_2.png"&gt;&lt;img height="114" width="295" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/SSAS2008Discretization_BBEA/image_thumb.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;但很显然，这让你无法可以随心所欲的控制区间及显示名称（即使你可以使用Name Template）。某些情况下如果你愿意，你也可以通过在数据库表中增加一个计算列来控制，这会让你更容易去决定他们的区间和名称。&lt;/p&gt;&#xD;
&lt;p&gt;﻿﻿﻿﻿CASE WHEN Weight IS NULL OR Weight&amp;lt;0 THEN 'N/A'&lt;/p&gt;&#xD;
&lt;p&gt;WHEN Weight&amp;lt;10 THEN '0-10Kg'&lt;/p&gt;&#xD;
&lt;p&gt;WHEN Weight&amp;lt;20 THEN '10-20Kg'&lt;/p&gt;&#xD;
&lt;p&gt;ELSE '20Kg or More'&lt;/p&gt;&#xD;
&lt;p&gt;END&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;命名模板&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;hr /&gt;&#xD;
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p&gt;当创建成员组时，会自动生成成员组的名称。 除非您指定了一个命名模板，否则使用默认的命名模板。 通过在某个特性的 &lt;strong&gt;NameColumn&lt;/strong&gt; 属性的 &lt;strong&gt;Format&lt;/strong&gt; 选项中指定命名模板，可以更改此命名方法。 可以针对列绑定（用于特性的 &lt;strong&gt;NameColumn&lt;/strong&gt; 属性）的 &lt;strong&gt;Translations&lt;/strong&gt; 集合中指定的每种语言重新定义不同的命名模板。默认的命名模板为 &lt;code&gt;"%{First bucket member} - %{Last bucket member}"&lt;/code&gt;。 &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;table cellpadding="0" cellspacing="0" border="1"&gt;&#xD;
&lt;tbody&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;&lt;strong&gt;变量&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;&lt;strong&gt;说明&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{First bucket member}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;包含在当前成员组中的第一个成员的名称。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Last bucket member}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;包含在当前成员组中的最后一个成员的名称。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Previous bucket last member}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;分配到上一个成员组的最后一个成员的名称。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Next bucket first member}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;分配到下一个成员组的第一个成员的名称。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Bucket Min}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;要分配到当前成员组的最小成员数。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Bucket Max}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;要分配到当前成员组的最大成员数。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Previous Bucket Max}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;要分配到上一个成员组的最大成员数。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;%{Next Bucket Min}&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&#xD;
&lt;p&gt;要分配到下一个成员组的最小成员数。&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;p&gt;例如我们将YearlyIncome的NameColumn属性的Format选项设置为&amp;rdquo;Less than %{Next Bucket Min};Between %{First bucket member} and %{Last bucket member};Greater than %{Previous Bucket Max}&amp;rdquo;，分组的名称会有所改变。我们可以通过Name Template来改变各个分组的名称：&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/SSAS2008Discretization_BBEA/image_4.png"&gt;&lt;img height="141" width="481" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/SSAS2008Discretization_BBEA/image_thumb_1.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/SSAS2008Discretization_BBEA/image_6.png"&gt;&lt;img height="136" width="387" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/SSAS2008Discretization_BBEA/image_thumb_2.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;使用离散化属性更新维度&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;hr /&gt;&#xD;
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p&gt;处理维度时，离散化属性只在&lt;strong&gt;完全更新&lt;/strong&gt; (ProcessFull) 中进行重新离散化。 若要对属性进行重新离散化，必须对维度执行完全更新。 如果离散化属性的维度表已更新，并且您使用增量式更新 (ProcessAdd) 处理该维度，则离散化属性不会进行重新离散化。 新存储的名称和子级将保持不变。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1799567.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/08/14/1799567.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799370.html</id><title type="text">使用Time Intelligence Formula</title><summary type="text">Time Intelligence in Performance Point Service. Time Intelligence Formula (TI Formula) allows time periods, sets of time periods and ranges to be specified using a simple, easy to understand syntax.</summary><published>2010-08-13T15:55:00Z</published><updated>2010-08-13T15:55:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799370.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799370.html"/><content type="html">&lt;p&gt;Time Intelligence&lt;span style="font-family: 宋体;"&gt;允许你在&lt;/span&gt;Dashboard&lt;span style="font-family: 宋体;"&gt;上指定一个公式当作过滤器。这个公式就是&lt;/span&gt;Time Intelligence Post Formula&lt;span style="font-family: 宋体;"&gt;用来定义一个关于时间的过滤器，它允许你使用单独的一个&lt;/span&gt;Time Intelligence Formula&lt;span style="font-family: 宋体;"&gt;去计算不同的时间范围，比如说，过去&lt;/span&gt;N&lt;span style="font-family: 宋体;"&gt;年，过去&lt;/span&gt;2&lt;span style="font-family: 宋体;"&gt;个季度，未来&lt;/span&gt;4&lt;span style="font-family: 宋体;"&gt;个季度，过去&lt;/span&gt;12&lt;span style="font-family: 宋体;"&gt;个月等等都在相同的仪表板上。这个过滤器提供一个在公式中使用的参考日期。默认情况下，这个参考日期是当前日期，但是你可以通过常见的日历选择器控制来把它设置为任何日期。&lt;/span&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Time Intelligence Formula的格式： &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 16pt;"&gt;&lt;strong&gt;Formula Structure&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="background-color: #efefef;"&gt;&amp;nbsp;&lt;span style="color: #0080c0; font-family: Consolas;"&gt;[&lt;strong&gt;(&lt;/strong&gt;]&lt;strong&gt;&amp;lt;Period&amp;gt;&lt;/strong&gt;[&lt;strong&gt;&amp;lt;Offset&amp;gt;&lt;/strong&gt;[&lt;strong&gt;)&lt;/strong&gt;][&lt;strong&gt;.&amp;lt;Function&amp;gt;&lt;/strong&gt;[&lt;strong&gt;&amp;lt;Offset&amp;gt;&lt;/strong&gt;]]]&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 16pt;"&gt;&lt;strong&gt;Examples of Time Intelligence expressions&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: #666666; font-family: Segoe UI;"&gt;The following table shows some Time Intelligence expressions along with some examples. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 140px;"&gt;&lt;/col&gt;&lt;col style="width: 132px;"&gt;&lt;/col&gt;&lt;col style="width: 315px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;To Get&amp;hellip;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;Formula&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Yesterday&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;day-1&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;The previous day relative to the current date.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Tomorrow&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;day+1&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;The next day relative to the current date.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;The current quarter and today&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;quarter, day&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;A set of time periods consisting of the current day and current quarter&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Last 10 days&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;day:day-9&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;A 10 day range including today.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Last 10 days (not including today)&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;day-1:day-10&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;A 10 day range NOT including today.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Same day last year &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(year-1).day&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Parallel period: days by year.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Same quarter last year&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(year-1).month&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Parallel period: Quarter by year.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Same range of months last year &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(year-1).(month-5): &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(year-1).(month)&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Set of parallel periods last year to the last six months.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Same range of months to date for last year&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(year-1).firstmonth: &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(year-1).month&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;From the first month of last year to the month parallel to the current month this year.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Year to date&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;yeartodate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;A single time period representing the aggregation of values from the beginning of the year to the last completed period.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;em&gt;The period corresponds to the most granular time period defined for the data source.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Year to date (by month)&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;yeartodate.fullmonth&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;A single time period representing the aggregation of values from the beginning of the year to the last completed month.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Year to date (by day)&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;yeartodate.fullday&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;A single time period representing the aggregation of values from the beginning of the year to the last completed day.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Parallel year to date&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;yearToDate-1&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;The aggregation of the same set of default time periods completed in the current year except for the prior year.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Parallel year to date (by month)&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="color: #0080c0; font-size: 10pt;"&gt;(yearToDate-1).fullMonth&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;The aggregation of the same set of months completed in the current year except for the prior year.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;常用的操作符&lt;/strong&gt;&lt;span style="font-size: 12pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 78px;"&gt;&lt;/col&gt;&lt;col style="width: 466px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-family: 宋体; font-size: 8pt;"&gt;&lt;strong&gt;操作符&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-family: 宋体; font-size: 8pt;"&gt;&lt;strong&gt;用法&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;"." &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: 宋体;"&gt;点操作符，获取父对象的成员。&lt;/span&gt; &lt;span style="font-family: 宋体;"&gt;例如&lt;/span&gt;&lt;em&gt;&lt;strong&gt;:&amp;nbsp; &lt;/strong&gt;year&lt;strong&gt;.&lt;/strong&gt;firstMonth&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;"+" or "-" &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: 宋体;"&gt;使用加减号来进行基于当前日期偏移量的算术运算。&lt;/span&gt; &lt;span style="font-family: 宋体;"&gt;例如：&lt;/span&gt;&lt;em&gt;&lt;strong&gt;:&amp;nbsp; &lt;/strong&gt;day&lt;strong&gt;-&lt;/strong&gt;1&lt;/em&gt; /&lt;span style="font-family: 宋体;"&gt; day+1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;"()"&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: 宋体;"&gt;将对于某个日期的偏移量作为整体，相当于函数。&lt;/span&gt; &lt;span style="font-family: 宋体;"&gt;例如&lt;/span&gt;&lt;em&gt;&lt;strong&gt;:&lt;/strong&gt;&amp;nbsp; &lt;strong&gt;(&lt;/strong&gt;year-1&lt;strong&gt;).&lt;/strong&gt;firstMonth:&lt;strong&gt;(&lt;/strong&gt;year-1&lt;strong&gt;).&lt;/strong&gt;month&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;","&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: 宋体;"&gt;分隔符&lt;/span&gt; &lt;span style="font-family: 宋体;"&gt;例如&lt;/span&gt;: &lt;em&gt;&amp;nbsp; year&lt;strong&gt;, &lt;/strong&gt;Quarter&lt;strong&gt;, &lt;/strong&gt;Month&lt;strong&gt;, &lt;/strong&gt;day&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;":"&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: 宋体;"&gt;分号用来确定一个时间段&lt;/span&gt;. &lt;span style="font-family: 宋体;"&gt;例如：&lt;/span&gt;&lt;em&gt; day&lt;strong&gt;:&lt;/strong&gt;day-4&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;标准的时间段：&lt;/strong&gt;&lt;span style="font-size: 12pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;在&lt;/span&gt;Performance Point Service/Server&lt;span style="font-family: 宋体;"&gt;中包含以下标准的时间段属性成员：&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 64px;"&gt;&lt;/col&gt;&lt;col style="width: 168px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Period&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Year&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;Year-1, year+2&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Quarter&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;quarter, Quarter-4 &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Month&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;Month-2&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Week&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;Week-51&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Day&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;Day-9, day+2&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Hour&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;Hour-12&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Minute&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;minute-30&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Second&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;second+5&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;标准时间段成员：&lt;/strong&gt;&lt;span style="font-size: 12pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;如下函数均可以在标准时间段之后以点的形式做为成员输出相应的值，类似于函数&lt;/span&gt;:&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 108px;"&gt;&lt;/col&gt;&lt;col style="width: 289px;"&gt;&lt;/col&gt;&lt;col style="width: 189px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt; background-color: #f3f3f3;"&gt;&lt;strong&gt;MemberFunction&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt; background-color: #f3f3f3;"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt; background-color: #f3f3f3;"&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Parent &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;The parent level of time aggregation from the data source &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Day.Parent&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstChild&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;The first child aggregation level from the data source&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Month.FirstChild &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastChild&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;The last child aggregation level from the data source &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Month.LastChild &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstSemester&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first semester of the parent time period. The parent member for this function must be Year. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.FirstSemester&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastSemester &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last semester of the parent time period. The parent member for this function must be Year. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.LastSemester&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstQuarter&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first quarter of the parent time period. The parent member for this function must be one of semester or year. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.FirstQuarter Semester.FirstQuarter &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastQuarter&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last quarter of the parent time period. The parent member for this function must be one of semester or year. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.LastQuarter (Semester-1).LastQuarter&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstMonth&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first month of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.FirstMonth (Year-1).FirstMonth&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastMonth&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last month of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.LastMonth (Quarter+1).LastMonth &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstWeek&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first full week of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.FirstWeek (Semester-1).FirstWeek&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastWeek&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last full week of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Year.LastWeek (Semester+1).LastWeek&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstDay&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first day of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Month.FirstDay (Month-1).FirstDay&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastDay&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last day of the parent period.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Month.LastDay (Month+1).LastDay&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstHour &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first hour of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Day.FirstHour (Day-1).FirstHour&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastHour&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last hour of the parent period.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Day.LastHour (Day+1).LastHour &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstMinute&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first minute of the parent period.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Day.FirstMinute (Hour-2).FirstMinute&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastMinute&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last minute of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Day.LastMinute (Hour+2).LastMinute&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;FirstSecond&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the first second of the parent period.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Hour.FirstSecond (Minute-10).FirstSecond&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;LastSecond&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Returns the last second of the parent period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #454545; font-size: 9pt;"&gt;Hour.LastSecond (Minute+9).LastSecond&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Periods-To-Date&lt;/strong&gt;&lt;span style="font-size: 12pt;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: #595959; font-size: 9pt;"&gt;&lt;span style="font-family: 宋体;"&gt;在&lt;/span&gt;Performance Point Service 2010&lt;span style="font-family: 宋体;"&gt;中还新增了&lt;/span&gt;Periods-To-Date&lt;span style="font-family: 宋体;"&gt;类型，其实是描述了一个时间区间。&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 85px;"&gt;&lt;/col&gt;&lt;col style="width: 349px;"&gt;&lt;/col&gt;&lt;col style="width: 153px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Period&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Use&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Works with&amp;hellip;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;YearToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the year to the current period.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullQuarter functions or lower.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;QuarterToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the quarter to the current period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullMonth functions or lower.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;MonthToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the month to the current period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullWeek functions or lower.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;WeekToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the week to the current period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullDay functions or lower.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;DayToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the day to the current period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullHour functions or lower.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;HourToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the hour to the current period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullMinute functions or lower.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;MinuteToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies a time period from the beginning of the minute to the current period. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullSecond function.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: #595959; font-family: 宋体; font-size: 9pt;"&gt;与之可以使用的函数： &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 66px;"&gt;&lt;/col&gt;&lt;col style="width: 244px;"&gt;&lt;/col&gt;&lt;col style="width: 277px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Use&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: solid #a3a3a3 1.0pt; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;strong&gt;Works with&amp;hellip;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullQuarter&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full quarter.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;YearToDate&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullMonth&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full month.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;QuarterToDate periods of higher.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullWeek&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full week.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;MonthToDate periods of higher.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullDay&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full day.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;WeekToDate periods of higher.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullHour&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full hour.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;DayToDate periods of higher.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullMinute&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full minute.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;HourToDate periods of higher.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="border-top: none; border-left: solid #a3a3a3 1.0pt; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;FullSecond&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;Specifies that the period to date should include up to the last full second.&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;td style="border-top: none; border-left: none; border-bottom: solid #a3a3a3 1.0pt; border-right: solid #a3a3a3 1.0pt; padding: 5px;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;MinuteToDate periods of higher.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;em&gt;Note this is included for consistency, though technically this period is not needed.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1799370.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799370.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799001.html</id><title type="text">Silverlight跨域访问Https下的Self-hosted WCF服务</title><summary type="text">跨域访问(Cross Domain)在Silverlight中是个非常讨厌的话题，常常在不经意间就会发现出现跨域访问的问题。在某些特殊的情况下，你的网站以及服务可能部署在HTTPS的安全环境下，例如服务器使用了VMWare或者F5等软件来让所有对于服务的请求都自动变成HTTPS请求，这个时候对于跨域访问的设置以及服务端和客户端的配置都有所不同。本文就着重讲述了这样情况下如何配置跨域访问并如何解决常见的请求异常。</summary><published>2010-08-13T06:36:00Z</published><updated>2010-08-13T06:36:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799001.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799001.html"/><content type="html">&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;跨域访问&lt;/span&gt;(Cross Domain)&lt;span style="font-family: 宋体;"&gt;在&lt;/span&gt;Silverlight&lt;span style="font-family: 宋体;"&gt;中是个非常讨厌的话题，常常在不经意间就会发现出现跨域访问的问题。在某些特殊的情况下，你的网站以及服务可能部署在&lt;/span&gt;HTTPS&lt;span style="font-family: 宋体;"&gt;的安全环境下，例如服务器使用了&lt;/span&gt;VMWare&lt;span style="font-family: 宋体;"&gt;或者&lt;/span&gt;F5&lt;span style="font-family: 宋体;"&gt;等软件来让所有对于服务的请求都自动变成&lt;/span&gt;HTTPS&lt;span style="font-family: 宋体;"&gt;请求，这个时候对于跨域访问的设置以及服务端和客户端的配置都有所不同。本文就着重讲述了这样情况下如何配置跨域访问并如何解决常见的请求异常。&lt;/span&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;环境&lt;/strong&gt;：&lt;/span&gt;Windows Server 2008 R2 + VMWare Tools(Https) + .NET Framework 3.5 + Silverlight 4. &lt;span style="font-family: 宋体;"&gt;因为使用了&lt;/span&gt;VMWare&lt;span style="font-family: 宋体;"&gt;的软件使得所有外部对本服务器的&lt;/span&gt;Web&lt;span style="font-family: 宋体;"&gt;请求均自动变为&lt;/span&gt;Https&lt;span style="font-family: 宋体;"&gt;请求。在但&lt;/span&gt;IIS&lt;span style="font-family: 宋体;"&gt;仍然可以区分在外部请求时是使用&lt;/span&gt;Https&lt;span style="font-family: 宋体;"&gt;还是&lt;/span&gt;Http&lt;span style="font-family: 宋体;"&gt;。&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;问题：&lt;/strong&gt;&lt;/span&gt; An error occurred while trying to make a request to URI '&lt;a href="http://cn.mydomain.com/Allan/Services/ModelService.svc/main"&gt;http://cn.mydomain.com/Allan/Services/ModelService.svc/main&lt;/a&gt;'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;客户端配置： &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;basicHttpBinding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;binding name="BasicHttpBinding_IModelService" maxBufferSize="2147483647" &lt;/p&gt;&#xD;
&lt;p&gt;maxReceivedMessageSize="2147483647"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/binding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/basicHttpBinding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;client&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;endpoint address="http://cn.mydomain.com/Allan/Services/ModelService.svc/main" &lt;/p&gt;&#xD;
&lt;p&gt;binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IModelService" &lt;/p&gt;&#xD;
&lt;p&gt;contract="ModelServices.IModelService" name="BasicHttpBinding_IModelService" /&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/client&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;此时我们将服务地址设为&lt;/span&gt;http&lt;span style="font-family: 宋体;"&gt;，但得到的结果却是可能&lt;/span&gt;Security Error&lt;span style="font-family: 宋体;"&gt;，也可能是跨域访问的问题。启动&lt;/span&gt;Fiddler&lt;span style="font-family: 宋体;"&gt;看看到底发生了什么：&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/081310_0636_Silverlight1.png" /&gt;&lt;span style="font-size: 12pt;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;很明显，&lt;/span&gt;ClientAccessPolicy.xml&lt;span style="font-family: 宋体;"&gt;（以及&lt;/span&gt;CrossDomain.xml&lt;span style="font-family: 宋体;"&gt;）无法被访问，而请求结果是&lt;/span&gt;301&lt;span style="font-family: 宋体;"&gt;错误：&lt;/span&gt;Moved Permanently&lt;span style="font-family: 宋体;"&gt;。因为在&lt;/span&gt;Silverlight&lt;span style="font-family: 宋体;"&gt;中设置的地址是&lt;/span&gt;http://cn.mydomain.com/...&lt;span style="font-family: 宋体;"&gt;则对应的两个跨域访问的&lt;/span&gt;xml&lt;span style="font-family: 宋体;"&gt;文件也应该是&lt;/span&gt;http&lt;span style="font-family: 宋体;"&gt;，所以这个请求应该是&lt;/span&gt;&lt;strong&gt;http:&lt;/strong&gt;//cn.mydomain.com/clientaccesspolicy.xml&lt;span style="font-family: 宋体;"&gt;，但提示我们已经被永久转向到&lt;/span&gt;&lt;strong&gt;https&lt;/strong&gt;://cn.mydomain.com/clientaccesspolicy.xml&lt;span style="font-family: 宋体;"&gt;，那说明我们应该将服务请求地址设置为&lt;/span&gt;https&lt;span style="font-family: 宋体;"&gt;访问就可以了。怎么解决呢？&lt;/span&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;basicHttpBinding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;binding name="BasicHttpBinding_IModelService" maxBufferSize="2147483647" &lt;/p&gt;&#xD;
&lt;p&gt;maxReceivedMessageSize="2147483647"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;security mode="Transport" /&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/binding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/basicHttpBinding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;client&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;endpoint address="&lt;strong&gt;https://cn.mydomain.com/Allan/Services/ModelService.svc/main&lt;/strong&gt;" &lt;/p&gt;&#xD;
&lt;p&gt;binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IModelService" &lt;/p&gt;&#xD;
&lt;p&gt;contract="ModelServices.IModelService" name="BasicHttpBinding_IModelService" /&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/client&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;但是很奇怪的是你的请求没有被顺利的传输到服务端，而且在&lt;/span&gt;Fiddler&lt;span style="font-family: 宋体;"&gt;中观察的结果也是&lt;/span&gt;500&lt;span style="font-family: 宋体;"&gt;错误，无法被请求。有时你也会得到这样的错误：&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http]. &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;那么，问题在哪儿呢？ &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;&lt;span style="font-family: 宋体;"&gt;首先，默认情况下&lt;/span&gt;https&lt;span style="font-family: 宋体;"&gt;的请求是不被跨域访问策略所接受的，需要特殊设置。 &lt;/span&gt;&lt;/li&gt;&#xD;
&lt;li&gt;&lt;span style="font-family: 宋体;"&gt;需要确保客户端的&lt;/span&gt;security mode&lt;span style="font-family: 宋体;"&gt;设置为&lt;/span&gt;Transport&lt;span style="font-family: 宋体;"&gt;。（某些环境下&lt;/span&gt;server&lt;span style="font-family: 宋体;"&gt;端的&lt;/span&gt;security&lt;span style="font-family: 宋体;"&gt;需要设置为&lt;/span&gt;None&lt;span style="font-family: 宋体;"&gt;） &lt;/span&gt;&lt;/li&gt;&#xD;
&lt;li&gt;&lt;span style="font-family: 宋体;"&gt;在服务端设置&lt;/span&gt;BaseAddress&lt;span style="font-family: 宋体;"&gt;。 &lt;/span&gt;&lt;/li&gt;&#xD;
&lt;li&gt;&lt;span style="font-family: 宋体;"&gt;完整的&lt;/span&gt;ClientAccessPolicy.xml&lt;span style="font-family: 宋体;"&gt;和&lt;/span&gt;CrossDomain.xml&lt;span style="font-family: 宋体;"&gt;，正确的路径（位于网站根目录下） &lt;/span&gt;&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;ClientAccessPolicy.xml&lt;span style="font-family: 宋体;"&gt;文件：&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;access-policy&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;cross-domain-access&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;policy&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;allow-from http-request-headers="*"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;domain uri="http://*"/&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;domain uri="https://*" /&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/allow-from&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;grant-to&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;resource path="/" &lt;strong&gt;include-subpaths="true"&lt;/strong&gt;/&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/grant-to&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/policy&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/cross-domain-access&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/access-policy&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;CrossDomain.xml&lt;span style="font-family: 宋体;"&gt;文件：&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;?xml version="1.0"?&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;!DOCTYPE cross-domain-policy SYSTEM "&lt;a href="http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&lt;/a&gt;"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;cross-domain-policy&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;allow-access-from domain=""*"" /&amp;gt; &lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;allow-http-request-headers-from domain=""*""&lt;strong&gt; headers=""*""&lt;/strong&gt; /&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/cross-domain-policy&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;客户端配置文件：&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;system.serviceModel&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;binding name="BasicHttpBinding_IModelService" maxBufferSize="2147483647" &lt;/p&gt;&#xD;
&lt;p&gt;maxReceivedMessageSize="2147483647"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;security mode="Transport" /&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/binding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/basicHttpBinding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;client&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;endpoint address="&lt;strong&gt;https://cn.mydomain.com/Allan/Services/ModelService.svc/main&lt;/strong&gt;" &lt;/p&gt;&#xD;
&lt;p&gt;binding="&lt;strong&gt;basicHttpBinding&lt;/strong&gt;" bindingConfiguration="BasicHttpBinding_IModelService" &lt;/p&gt;&#xD;
&lt;p&gt;contract="ModelServices.IModelService" name="BasicHttpBinding_IModelService" /&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/client&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/system.serviceModel&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;&lt;strong&gt;服务端配置文件：&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;system.serviceModel&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"/&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;behaviors&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;serviceBehaviors&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;behavior name="defaultBehavior"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;serviceMetadata httpGetEnabled="true"/&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;serviceDebug includeExceptionDetailInFaults="true"/&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/behavior&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/serviceBehaviors&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/behaviors&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;&lt;strong&gt;basicHttpBinding&lt;/strong&gt;&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;binding name="HyattSite.Services.ModelService.customBinding0"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;security mode="None"&amp;gt;&amp;lt;/security&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/binding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/basicHttpBinding&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/bindings&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;services&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;service behaviorConfiguration="defaultBehavior" name="HyattSite.Services.ModelService"&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;endpoint address="main" binding="basicHttpBinding" bindingConfiguration="HyattSite.Services.ModelService.customBinding0" &lt;/p&gt;&#xD;
&lt;p&gt;contract="HyattSite.Services.IModelService" /&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;br /&gt;&amp;lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;host&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;baseAddresses&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&amp;lt;add baseAddress="https://cn.mydomain.com" /&amp;gt;&lt;/strong&gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/baseAddresses&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/host&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/service&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/services&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&amp;lt;/system.serviceModel&amp;gt; &lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;OK, &lt;span style="font-family: 宋体;"&gt;大功告成，&lt;/span&gt;Silverlight&lt;span style="font-family: 宋体;"&gt;可以正确的得到返回结果：&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/081310_0636_Silverlight2.png" /&gt;&lt;span style="font-size: 12pt;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;但是对于每个服务器的环境可能是不一样的，如果你在服务器内部的访问请求需要带上权限的话，那就更为麻烦一些。&lt;a href="http://blog.hackedbrain.com/SubText-2.1.0.5/archive/2006/09/26/5281.aspx"&gt;&lt;/a&gt;&lt;/span&gt;&lt;strong&gt;How To: SSL Passthrough with WCF --or-- TransportWithMessageCredential over plain HTTP&lt;/strong&gt; &lt;span style="font-family: 宋体;"&gt;这篇文章可以带给你更多的思路。&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 宋体;"&gt;有关&lt;/span&gt;Cross Domain&lt;span style="font-family: 宋体;"&gt;配置文件的更多信息参阅：&lt;a href="http://www.senocular.com/pub/adobe/crossdomain/policyfiles.html"&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="color: #666666; background-color: #d6d6d6;"&gt;Cross-domain Policy File Specification&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1799001.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/08/13/1799001.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/06/29/1767908.html</id><title type="text">TIP: Configure SQL Server Reporting Service 2008</title><summary type="text">Key words: SSRS 2008, Reporting Service, Report Manager Blank, rsAccessDenied Most of you who work on Microsoft .NET platform may use SQL Server, as well as one of its components Reporting Service. Some of you may suffer for SSRS configuration as sometimes it's really tricky to make it server for everyone</summary><published>2010-06-29T14:02:00Z</published><updated>2010-06-29T14:02:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/06/29/1767908.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/06/29/1767908.html"/><content type="html">&lt;p&gt;&lt;strong&gt;Key words&lt;/strong&gt;: SSRS 2008, Reporting Service, Report Manager Blank, rsAccessDenied &lt;/p&gt;&#xD;
&lt;p&gt;Most of you who work on Microsoft .NET platform may use SQL Server, as well as one of its components Reporting Service. Some of you may suffer for SSRS configuration as sometimes it's really tricky to make it server for everyone. It's lucky that I experienced this issue again today and really struggle against the configuration for a well. &lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; I have to install a new SQL Server 2008 on a Windows Server 2008 R2 machine, and SSRS is included in the installation. After the installation process completed successfully, I found that I can't get any content from &lt;a href="http://localhost/Reports"&gt;http://localhost/Reports&lt;/a&gt; or &lt;a href="http://localhost/ReportServer"&gt;http://localhost/ReportServer&lt;/a&gt;. Report Manager gives me nothing except a standard header of report manager site, no Site Settings link at all. Report Server gives me an error that access denied for the current user. &lt;/p&gt;&#xD;
&lt;p&gt;1). Report Manager site works well but no content displayed. That means the current user doesn't have permission to access Reporting Service. The problem is when I install SQL Server, Administrators was added as a Role for Reporting Service, but the current user Allan is a member of Administrators. You are still able to browse Report Manger site but no content, that's security issue. But how can I change the security settings without Site Settings menu? &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/062910_1401_TIPConfigur1.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;2). Report Server throws me an access denied(rsAccessDenied) error, that's still security issue, how can I assign permissions to the current user? &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Problem: &lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;User Allan is a member of Administrators group and was used to install SQL Server. Even Allan was assigned access to both SQL Server engine and Reporting Service, but it is still not allowed to access Reporting Service, we need to find a way to assign the permission to the current user. &lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Solution: &lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;When you install SQL Server Reporting Service and initialize SSRS, it will automatically generate encryption key pair used to protect &lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;sensitive data. Normally it generates the encryption key associated with Administrator user, when you don't use Administrator as the login name, then the encryption key should be recreated in order to allow the current user access Reporting Service without any other permission settings. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;Let's have a look on the definition of &lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Encryption Key&lt;/strong&gt;&lt;/span&gt;: &lt;/span&gt;An important part of &lt;strong&gt;report&lt;/strong&gt; server configuration is creating a backup copy of the symmetric &lt;strong&gt;key&lt;/strong&gt; used for &lt;strong&gt;encrypting&lt;/strong&gt; sensitive information. A backup copy of the &lt;strong&gt;key&lt;/strong&gt; is required for many routine operations, and enables you to reuse an existing &lt;strong&gt;report&lt;/strong&gt; server database in a new installation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reporting&lt;/strong&gt; &lt;strong&gt;Services&lt;/strong&gt; uses &lt;strong&gt;encryption&lt;/strong&gt; &lt;strong&gt;keys&lt;/strong&gt; to secure credentials and connection information that is stored in a &lt;strong&gt;report&lt;/strong&gt; server database. In &lt;strong&gt;Reporting&lt;/strong&gt; &lt;strong&gt;Services&lt;/strong&gt;, &lt;strong&gt;encryption&lt;/strong&gt; &lt;strong&gt;keys&lt;/strong&gt; include a combination of public, private, and symmetric &lt;strong&gt;keys&lt;/strong&gt; that are used to protect sensitive data. The symmetric &lt;strong&gt;key&lt;/strong&gt; is created during &lt;strong&gt;report&lt;/strong&gt; server initialization when you install or configure the &lt;strong&gt;report&lt;/strong&gt; server, and it is used by the &lt;strong&gt;report&lt;/strong&gt; server to &lt;strong&gt;encrypt&lt;/strong&gt; sensitive data that is stored in the &lt;strong&gt;report&lt;/strong&gt; server. Public and private &lt;strong&gt;keys&lt;/strong&gt; are created by the operating system, and they are used to protect the symmetric &lt;strong&gt;key&lt;/strong&gt;. A public and private &lt;strong&gt;key&lt;/strong&gt; pair is created for each &lt;strong&gt;report&lt;/strong&gt; server instance that stores sensitive data in a &lt;strong&gt;report&lt;/strong&gt; server database.&lt;br /&gt;&lt;br /&gt;These &lt;strong&gt;key&lt;/strong&gt; file .snk. will have to be used during your disaster recovery, any config. changes in your domain level and for any other changes that RS depends on its environmental factors. &lt;/p&gt;&#xD;
&lt;p&gt;Then how do we fix it? We understand the concepts then the fix is extremely easy: &lt;/p&gt;&#xD;
&lt;p&gt;1). Delete Encryption Content. &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/062910_1401_TIPConfigur2.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;2) Start Internet Explorer and Run as Administrator, type &lt;a href="http://localhost/Reports"&gt;http://localhost/Reports&lt;/a&gt;. Then you are able to see Site Settings at the top right of the page. &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/062910_1401_TIPConfigur3.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;3) Click Site Settings -&amp;gt; Security. And click New Role Assignment to add the account/group to system level access list. &lt;/p&gt;&#xD;
&lt;p&gt;4) Or click Home -&amp;gt; Properties -&amp;gt; Security to add the users/groups to site level access list with different roles. &lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/062910_1401_TIPConfigur4.png" /&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Hope this helps&lt;span style="font-family: Wingdings;"&gt;J&lt;/span&gt; &lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1767908.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/06/29/1767908.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/06/28/1767004.html</id><title type="text">How do you save Web Part customer properties within Code?</title><summary type="text">The main method you might need to override when you create a basic Web Part is CreateChildControls, the problem is all the controls and its state will be retracted and recreated during each calling of the Web Part. There are lots situations that you want to keep the state after a customer click event on the front-end, and after the value changed you still want to save the value to Personalized Storage in order to loading the settings automatically next time. The customer properties can be used t</summary><published>2010-06-28T13:10:00Z</published><updated>2010-06-28T13:10:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/06/28/1767004.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/06/28/1767004.html"/><content type="html">&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;The main method you might need to override when you create a basic Web Part is &lt;em&gt;CreateChildControls&lt;/em&gt;, the problem is all the controls and its state will be retracted and recreated during each calling of the Web Part. There are lots situations that you want to keep the state after a customer click event on the front-end, and after the value changed you still want to save the value to Personalized Storage in order to loading the settings automatically next time. The customer properties can be used to store the personalized values, most of the times you want to change the customized values are edit the web part and change its Customer Properties in the Web Part Edit Panel, but how do you change it when you want to save any changes within the web part code? &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;The answer is &lt;strong&gt;SaveProperties&lt;/strong&gt; property of the Web Part. In this case, your web part must be inherited from &lt;strong&gt;Microsoft.SharePoint.WebPartPages.WebPart&lt;/strong&gt;. When the value changes, and you want to persistence into the user personalized storage, set SaveProperties to be true, this indicates that the web part manager should persistence the web part settings (Properties). Refer to the following code snippet: &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;div&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 590px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; _factor = 1; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;[WebBrowsable(&lt;span style="color: blue;"&gt;false&lt;/span&gt;), &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Personalizable(PersonalizationScope.User), &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;DefaultValue(0), &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Category(&lt;span style="color: #a31515;"&gt;"CRM Factory"&lt;/span&gt;), &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;WebPartStorage(Storage.Personal)] &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; Factor &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;{ &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;get&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;{ &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; _factor; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;{ &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;_factor = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt; seeMoreButton_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e) &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;{ &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Factor = Factor - 1; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (Factor &amp;lt; 1) &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;{ &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Factor = 1; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;SPSecurity.RunWithElevatedPrivileges(&lt;span style="color: blue;"&gt;delegate&lt;/span&gt;() &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;{ &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;SaveProperties = &lt;span style="color: blue;"&gt;true&lt;/span&gt;; &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;}); &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;GenerateTagCloud(); &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;You can still use ViewState to store the Web Part state during the web part lifecycle, but it won't be able to hold the values until next login. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;em&gt;Reference:&lt;/em&gt;&lt;/span&gt; &lt;strong&gt;Microsoft.SharePoint.WebPartPages.WebPart.SaveProperties&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;The SaveProperties property is initially set to false at the beginning of page rendering. This property is useful only during page rendering. For example, this property has no effect when a Web Part is accessed through the object model. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;The SaveProperties property can be used for Web Parts when their properties change after being rendered in a Web Part Page. After a property is changed, a WebPart class can set the SaveProperties property to true to specify that any changed properties will be saved. The value of the SaveProperties property is read by the Web Part infrastructure after the System.Web.UI.Control.UnLoad event of the Web Part occurs, at which point all property values are queried and stored in the SharePoint database. If this property is not set, the properties revert to their original values the next time the Web Part is instantiated. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;The value of the SaveProperties property is ignored unless a Web Part is actively being rendered. For example, instantiating a new Web Part, changing a property value, and then setting SaveProperties to true has no effect. The SaveProperties property should be used by a Web Part that needs to save a property that has changed after being rendered. If a property is set externally, it is the responsibility of the external agent to either save the Web Part explicitly, or during a render cycle to set the SaveProperties property on behalf of the Web Part. &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;If the SaveProperties property is set on a static Web Part (a Web Part that is not located in a zone), or for a Web Part where the user does not have sufficient permissions to save changes (such as for an anonymous user), an exception is thrown when an attempt is made to save that Web Part. A Web Part should check the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.permissions.aspx"&gt;&lt;span style="color: #1364c4;"&gt;Permissions&lt;/span&gt;&lt;/a&gt; property before displaying a user interface for saving property values and setting SaveProperties to true. &lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1767004.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/06/28/1767004.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/06/12/1757001.html</id><title type="text">Using Developer Dashboard in SharePoint 2010</title><summary type="text">Developer Dashboard是SharePoint2010提供的一个新功能，它可以在当前页面生成时（rendering）提供额外的性能信息和一些跟踪信息，帮助开发人员调试页面组件，监控页面上各组件代码的性能，帮助寻找页面可能的效率瓶颈根源.</summary><published>2010-06-12T05:59:00Z</published><updated>2010-06-12T05:59:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/06/12/1757001.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/06/12/1757001.html"/><content type="html">&lt;p&gt;&lt;strong&gt;What Is Developer Dashboard&#xD;
&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Developer Dashboard是SharePoint2010提供的一个新功能，它可以在当前页面生成时（rendering）提供额外的性能信息和一些跟踪信息，帮助开发人员调试页面组件，监控页面上各组件代码的性能，帮助寻找页面可能的效率瓶颈根源。这对于有包含客户代码的页面时非常方便和有效。当Developer Dashboard被启用时，你可以在页面的底部得到页面在生成过程中有关控件加载、查询及执行时间的各种数据信息。这些信息包括：&#xD;
&lt;/p&gt;&#xD;
&lt;ul&gt;&#xD;
&lt;li&gt;哪些控件被加载&#xD;
&lt;/li&gt;&#xD;
&lt;li&gt;加载每个控件的时间&#xD;
&lt;/li&gt;&#xD;
&lt;li&gt;数据库查询以及执行时间&#xD;
&lt;/li&gt;&#xD;
&lt;li&gt;加载页面所触发的事件&#xD;
&lt;/li&gt;&#xD;
&lt;li&gt;加载页面各个阶段的时间&#xD;
&lt;/li&gt;&#xD;
&lt;/ul&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/061210_0558_UsingDevelo1.png" /&gt;&#xD;
	&lt;/p&gt;&#xD;
&lt;p&gt;正如上图所示，这些跟踪信息都是基于页面上各个组件被加载的时间线和页面生命周期为时间线来组织的，清楚的描述了各个事件所消耗的时间及针对web服务器和数据库服务器的消耗。并且在Database Queries部分你可以很容易的看到具体执行的数据库查询以及所消耗的时间。这些以时间线为顺序的监控信息可以很容易的帮助您调试或寻找问题。&#xD;
&lt;/p&gt;&#xD;
&lt;p&gt;你可能还注意到了Database Queries部分是可以点击的。当点击进入任何一个被执行的数据查询，你会看到有关该SQL调用的上下文及调用堆栈，以及IO开销等。&#xD;
&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/061210_0558_UsingDevelo2.png" /&gt;&#xD;
	&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;How to enable Developer Dashboard&#xD;
&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;编程实现：&#xD;
&lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;创建一个基于.NET Framework 3.5的控制台程序，并将build设置为Any CPU（因为SharePoint是x64的）。拷贝下列代码：&#xD;
&lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;div style="margin-left: 41pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 631px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="font-size: 10pt;"&gt;SPPerformanceMonitor&lt;span style="color: #333333;"&gt;&amp;nbsp;perfmon =&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPFarm&lt;span style="color: #333333;"&gt;.Local.PerformanceMonitor;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;&#xD;
								&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: #333333;"&gt;&lt;span style="font-size: 10pt;"&gt;perfmon.DeveloperDashboardLevel =&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPPerformanceMonitoringLevel&lt;span style="color: #333333;"&gt;.On;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;&#xD;
								&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt;"&gt;perfmon.Update();&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p style="margin-left: 36pt;"&gt;编译并执行，OK。&#xD;
&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;&#xD;
&lt;div&gt;&lt;strong&gt;命令行实现：&#xD;
&lt;/strong&gt;&lt;/div&gt;&#xD;
&lt;p&gt;在以Administrator身份运行的Command Line中执行下述命令：&#xD;
&lt;/p&gt;&#xD;
&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;div style="margin-left: 36pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 542px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt;"&gt;Stsadm &amp;ndash;o setproperty &amp;ndash;pn developer-dashboard &amp;ndash;pv ondemand (or "on" or "off")&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;当你将它设置为OnDemand时，网站管理员可以选择打开或者关闭。这样网站管理员可以选择打开或关闭特定网站集的监控输出，这将作为故障排除工具之针对特定的人群。&#xD;
&lt;/p&gt;&#xD;
&lt;p&gt;一切似乎很好，所有WebPart和代码只要在页面内运行，都将有输出信息作为排除故障的工具，但很不幸的，你看到上图中的信息量了吗？很多，其实很不方便查找特定的事件和故障。你的代码中对于OnInit和Render方法的重写都会被自动的捕捉到，但是其余地方的代码却不会被发现。SPMonitoredScope可以帮助你track更多的代码并输出到Developer Dashboard中。&#xD;
&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Using SPMonitoredScope to monitor performance of your code&#xD;
&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;使用SPMonitoredScope可以很方便的将某段代码的相关性能信息输出到Developer Dashboard中。使用SPMonitoredScope很简单，首先声明一个SPMonitoredScope的实例并赋予一个可以追踪的名字，将需要Track的代码写入即可。例如，下边的代码演示了插入一个列表项：&#xD;
&lt;/p&gt;&#xD;
&lt;div style="margin-left: 12pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 574px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: blue; font-size: 10pt;"&gt;using&lt;span style="color: black;"&gt; (&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt; monitoredScope = &lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&#xD;
													&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt;(&lt;span style="color: #a31515;"&gt;"My Monitored Scope"&lt;span style="color: black;"&gt;))&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;{&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// put code to monitor performance on here&lt;span style="color: black;"&gt;&#xD;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPList&lt;span style="color: black;"&gt; testList = site.Lists.TryGetList(&lt;span style="color: #a31515;"&gt;"Test List"&lt;span style="color: black;"&gt;);&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;span style="color: black;"&gt; (testList != &lt;span style="color: blue;"&gt;null&lt;span style="color: black;"&gt;)&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPListItem&lt;span style="color: black;"&gt; listItem = testList.Items.Add();&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem[&lt;span style="color: #a31515;"&gt;"Title"&lt;span style="color: black;"&gt;] = &lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;.Format(&lt;span style="color: #a31515;"&gt;"Test Item {0}"&lt;span style="color: black;"&gt;, &lt;span style="color: #2b91af;"&gt;Guid&lt;span style="color: black;"&gt;.NewGuid().ToString());&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem[&lt;span style="color: #a31515;"&gt;"City"&lt;span style="color: black;"&gt;] = &lt;span style="color: #a31515;"&gt;"Somewhere"&lt;span style="color: black;"&gt;;&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem[&lt;span style="color: #a31515;"&gt;"Quantity"&lt;span style="color: black;"&gt;] = 3;&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem.Update();&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;以上代码将会在Developer Dashboard中显示其执行的性能信息：&#xD;
&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/061210_0558_UsingDevelo3.png" /&gt;&#xD;
	&lt;/p&gt;&#xD;
&lt;p&gt;在SPMonitoredScope中你还可以嵌套使用SPMonitoredScope对象以更详细的监控尽可能小的代码段来分析器性能。&#xD;
&lt;/p&gt;&#xD;
&lt;div style="margin-left: 12pt;"&gt;&#xD;
&lt;table border="0" style="border-collapse: collapse;"&gt;&#xD;
&lt;colgroup&gt;&lt;col style="width: 574px;"&gt;&lt;/col&gt;&lt;/colgroup&gt;&#xD;
&lt;tbody valign="top"&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td style="padding-left: 7px; padding-right: 7px; border: solid 0.5pt;"&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: blue; font-size: 10pt;"&gt;using&lt;span style="color: black;"&gt; (&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt; monitoredScope = &lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&#xD;
													&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt;(&lt;span style="color: #a31515;"&gt;"My Monitored Scope"&lt;span style="color: black;"&gt;))&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;{&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SPList&lt;span style="color: black;"&gt; testList;&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt; (&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt; getListMonitor = &lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&#xD;
														&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt;(&lt;span style="color: #a31515;"&gt;"Get List"&lt;span style="color: black;"&gt;))&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testList = site.Lists.TryGetList(&lt;span style="color: #a31515;"&gt;"Test List"&lt;span style="color: black;"&gt;);&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt; (&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt; addListItemMonitor = &lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&#xD;
														&lt;span style="color: #2b91af;"&gt;SPMonitoredScope&lt;span style="color: black;"&gt;(&lt;span style="color: #a31515;"&gt;"Add List Item"&lt;span style="color: black;"&gt;))&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;span style="color: black;"&gt; (testList != &lt;span style="color: blue;"&gt;null&lt;span style="color: black;"&gt;)&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&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 style="color: #2b91af;"&gt;SPListItem&lt;span style="color: black;"&gt; listItem = testList.Items.Add();&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem[&lt;span style="color: #a31515;"&gt;"Title"&lt;span style="color: black;"&gt;] = &lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;.Format(&lt;span style="color: #a31515;"&gt;"Test Item {0}"&lt;span style="color: black;"&gt;, &lt;span style="color: #2b91af;"&gt;Guid&lt;span style="color: black;"&gt;.NewGuid().ToString());&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem[&lt;span style="color: #a31515;"&gt;"City"&lt;span style="color: black;"&gt;] = &lt;span style="color: #a31515;"&gt;"Somewhere"&lt;span style="color: black;"&gt;;&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem[&lt;span style="color: #a31515;"&gt;"Quantity"&lt;span style="color: black;"&gt;] = 3;&#xD;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItem.Update();&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&#xD;
&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="background: white;"&gt;&lt;span style="color: black; font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;/td&gt;&#xD;
&lt;/tr&gt;&#xD;
&lt;/tbody&gt;&#xD;
&lt;/table&gt;&#xD;
&lt;/div&gt;&#xD;
&lt;p&gt;正如期望的，我们在My Monitored Scope中看到了更为详细的监控段Get List和Add List Item。这样就能很清楚的看到每个代码段的性能情况。&#xD;
&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/061210_0558_UsingDevelo4.png" /&gt;&#xD;
	&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://devdashvis.codeplex.com/"&gt;&lt;span style="color: black; font-family: Segoe UI; font-size: 10pt;"&gt;&#xD;
			&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: black;"&gt;SharePoint 2010 Developer Dashboard Visualizer&lt;/span&gt;&#xD;
		&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: black; font-size: 10pt;"&gt;&lt;span style="font-family: Segoe UI;"&gt;SharePoint 2010 Developer Dashboard Visuallizer&lt;/span&gt;&lt;span style="font-family: 宋体;"&gt;是基于&lt;/span&gt;&lt;span style="font-family: Segoe UI;"&gt;jQuery&lt;/span&gt;&lt;span style="font-family: 宋体;"&gt;的扩展&lt;/span&gt;&lt;span style="font-family: Segoe UI;"&gt;Developer Dashboard&lt;/span&gt;&lt;span style="font-family: 宋体;"&gt;的插件，它通过可视化的图形界面让你更清楚的看到代码的性能情况。&lt;/span&gt;&lt;span style="font-family: Segoe UI;"&gt;&#xD;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/zlgcool/061210_0558_UsingDevelo5.png" /&gt;&#xD;
	&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Have Fun&lt;span style="font-family: Wingdings;"&gt;J&lt;/span&gt;&#xD;
	&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1757001.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/06/12/1757001.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/zlgcool/archive/2010/04/09/1708694.html</id><title type="text">Team Build 2010: 运行Unit Test</title><summary type="text">我们都知道之所以用Team Build是为了进行持续集成，并且能够更好的保证整个team不被其它的明显故障所耽误。Team Build在背后是用了MSBuild进行对项目的编译，这和在我们的Visual Studio中进行编译是一样的道理。但我们在Visual Studio中进行编译解决方案的时候，默认情况下是无法对Unit Test进行逐个或者分类运行来达到对代码的单元测试的目的，而在Team ...</summary><published>2010-04-09T15:27:00Z</published><updated>2010-04-09T15:27:00Z</updated><author><name>Allan.</name><uri>http://www.cnblogs.com/zlgcool/</uri></author><link rel="alternate" href="http://www.cnblogs.com/zlgcool/archive/2010/04/09/1708694.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/zlgcool/archive/2010/04/09/1708694.html"/><content type="html">&lt;p&gt;我们都知道之所以用Team Build是为了进行持续集成，并且能够更好的保证整个team不被其它的明显故障所耽误。Team Build在背后是用了MSBuild进行对项目的编译，这和在我们的Visual Studio中进行编译是一样的道理。但我们在Visual Studio中进行编译解决方案的时候，默认情况下是无法对Unit Test进行逐个或者分类运行来达到对代码的单元测试的目的，而在Team Build中我们却可以在Build Definition中定义是否运行Unit Test，更高级的我们还可以定义对哪些符合条件的Unit Test运行来达到对代码的检查并保证签入TFS Source Control的代码质量。Team Build还可以通过对Unit Test的执行结果的分析计算出Code Coverage，这也是对我们项目管理中非常有用的数据。&lt;/p&gt;&#xD;
&lt;p&gt;是否运行Unit Test及对Unit Tests的过滤都是在Build Definition中进行设置的。要修改对这些设置的改变，右键点击这个Build Definition并选择Edit Build Definition,在打开的窗口中选择Process栏目，所有的设置都可以在这里进行更改。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_2.png"&gt;&lt;img height="442" width="591" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 1 - 在Build Definition中对相关的构建设置进行更改&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;运行指定程序集中的单元测试&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;通常情况下，我们都将单元测试作为单独的项目，其中根据不同的测试对象而分成不同的组来进行组织，这也是Visual Studio的默认组织方式--当你点击某个方法自动生成单元测试时会询问是否添加新的测试项目或者附加到已有的测试项目中去。而对于很多企业来说，对于项目的命名方式也有着严格的标准，在这个时候你就会发现有标准命名是多么高兴的一件事情。如果你想让Team Build在编译完项目后同时运行某些Assembilies中的Unit Tests，你可以设置一个含有通配符的过滤条件来达到这个目的。对Test Assembly Filespec参数设置含有通配符的过滤条件便达到指定测试程序集范围的目的。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_4.png"&gt;&lt;img height="165" width="597" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb_1.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 2 - 设置Unit Test程序集的范围&lt;/p&gt;&#xD;
&lt;p&gt;对于那些没有统一命名规范的公司来讲，现在是时候考虑使用统一的命名规范对你的项目和命名空间进行约束了：）&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;按优先级来运行Unit Test&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;除了可以选择要执行的单元测试程序集，你现在还可以进一步通过对Unit Test的优先级别进行过滤来确定执行Test的范围。其实Unit Test的优先级(Test Priority)在.NET2.0的时候就出现了，可是一直没有被Visual Studio和Team Build所采纳。但在Team Build 2010中我们发现Test Priority被支持了。那如何给Unit Test设置优先级别呢？&lt;/p&gt;&#xD;
&lt;pre &gt;[TestCategory("Web Service")]&#xD;
        [TestCategory("ASP.NET")]&#xD;
        [CssProjectStructure("vstfs:///Classification/Node/0eed9522-47f8-4fa1-891d-0b14629d47f0")]&#xD;
        [Owner("Allan Zhou")]&#xD;
        [CssIteration("vstfs:///Classification/Node/65610ebf-7f79-46f4-931f-89ac54bfc15f")]&#xD;
        [AspNetDevelopmentServer("SSW.SqlDeploy.WebServices.Host", "%PathToWebRoot%\\SSW.SqlDeploy.WebServices.Host")]&#xD;
        [DeploymentItem("SSW.SqlDeploy.WebServices.Host.dll")]&#xD;
        [Priority(1)]&#xD;
        [TestMethod]&#xD;
        // [Ignore] //Ignore this test on the build server as the self-hosted web site won't start automatically.&#xD;
        public void UpdateProjectFileTest()&#xD;
        {&#xD;
            ProfileService target = new ProfileServiceClient();&#xD;
            Assert.IsTrue(WcfWebServiceHelper.TryUrlRedirection(target, TestContext, "SSW.SqlDeploy.WebServices.Host"));&#xD;
            target.SaveDefaultProjectFile("testWen");&#xD;
            ProjectFile projectFile = new ProjectFile();&#xD;
            projectFile.ProjectFileName = "testWen";&#xD;
            projectFile.NewDatabase = true;&#xD;
            bool isFalse = target.UpdateProjectFile(projectFile);&#xD;
&#xD;
            Assert.AreEqual(false, isFalse);&#xD;
        }&lt;/pre&gt;&#xD;
&lt;p&gt;注意了，在上边的一长串的标记中我们启用了[Priority(1)]这样的标记，它就是用来设置当前Unit Test的优先级的。注意Priority的参数是整数，这意味着你可以设置任意的数字，但需要记住，最好是有限的几个数字，否则过多的级别设置会让它失去用处。我们建议使用1-5来定义优先级别。&lt;/p&gt;&#xD;
&lt;p&gt;现在，Unit Test本身有了Test Priority，那在Build Definition中怎么限制呢？在下图中我们可以看到两个参数Minimum Test Priority和Maximum Test Priority，它们一起定义了符合运行条件的优先级区间，如果为-1表示没有限制。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_6.png"&gt;&lt;img height="174" width="640" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb_2.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 3 - 设置test Priority区间&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;按类别运行Unit Test&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;出了优先级，每个Unit Test还可以具有一个或多个类别，而这些都是可以被Team Build拿来作为运行Unit Test的过滤条件来使用的。这和Test Priority很像，您给每个Unit Test划分了具有意义的名称类别并将它应用到测试方法本身，而在这里你将可以通过匹配类别来达到限制运行Unit Test的目的。要使用这种方法，必须给Unit Test添加TestCategory标记，并给予有意义的名称类别。注意，一个Unit Test可以设置多个Test Category.&lt;/p&gt;&#xD;
&lt;p&gt;在Category FIlter参数中我们可以设置运行Unit test的过滤条件。注意，在此参数中我们可以使用逻辑操作符如&amp;amp;, !和| 来构筑过滤条件。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_8.png"&gt;&lt;img height="167" width="636" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb_3.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;Figure 4 - 设置Unit Test类别过滤条件&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;启用Code Coverage（代码覆盖率）&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;当您运行单元测试时，通常我们想知道被测试的代码有多少是被真正测试过的，又名代码覆盖率。在Visual Studio 2010的解决方案中，默认都有一个.testsettings文件，之前我们也提到了，这个文件是用来设置对项目进行测试和分析的各种参数的。奇怪的IntelliTrace的问题也是在这里被找到的。也就是说，在Team Build对项目编译之后的所有分析、运行测试用例等等都是在这里进行设置的。双击打开TraceAndTestImpact.testsettings文件我们可以在Data and Diagnostics栏中找到相关信息。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_10.png"&gt;&lt;img height="492" width="665" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb_4.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;选择Code Coverage项我们将会在Team Build的Summary页上看到有关Code Coverage的信息。点击Configure按钮我们还可以对参照对象进行更改（因为所谓代码覆盖率只是相对于某个范围的代码，单元测试所能覆盖到的范围，这是相对的）。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_12.png"&gt;&lt;img height="459" width="674" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb_5.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;&#xD;
&lt;p&gt;默认情况下，代码覆盖率的参照条件是测试方法所测试的真实方法所在的项目。如上图所示，三个被默认选中的项目是具有单元测试的当项目，这些单元测试将对这三个项目中的方法进行调用并进行测试，所以以它们作为基准来作为参照物。&lt;/p&gt;&#xD;
&lt;p&gt;当你的Team Build运行完你可以在Build Summary中得到相关的信息：&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_14.png"&gt;&lt;img height="446" width="514" src="http://images.cnblogs.com/cnblogs_com/zlgcool/WindowsLiveWriter/TeamBuild2010UnitTest_14930/image_thumb_6.png" alt="image" border="0" title="image" style="display: inline; border: 0px;" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/zlgcool/aggbug/1708694.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/zlgcool/archive/2010/04/09/1708694.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
