<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4545163587452304025</id><updated>2012-02-16T13:52:06.707+02:00</updated><category term='PIVOT'/><category term='MVC 2'/><category term='AOP'/><category term='WebService'/><category term='Duplex'/><category term='High Availability'/><category term='SoapExtension'/><category term='DTS'/><category term='Performance'/><category term='SQL'/><category term='Cache'/><category term='SQL Server'/><category term='CodeProject'/><category term='C# 3.5'/><category term='SQL 2005'/><category term='Parallel Programming'/><category term='DataBinding'/><category term='Windows'/><category term='Error Handling'/><category term='N-Tier Applications'/><category term='Visual Studio 2010'/><category term='T SQL'/><category term='Martin&apos;s Principles'/><category term='c#'/><category term='Unit of Work'/><category term='Compare'/><category term='WIA'/><category term='NLB'/><category term='MsBuild'/><category term='Puzzles'/><category term='Web Application'/><category term='Batch'/><category term='.net'/><category term='Disconnected Application'/><category term='SSIS'/><category term='WinForms'/><category term='Design Patterns'/><category term='Data Concurrency'/><category term='Distributed Cache'/><category term='Cogniview'/><category term='DRP'/><category term='appStore'/><category term='Load Balancing'/><category term='MSMQ'/><category term='XML'/><category term='SQLBroker'/><category term='Enterprise library'/><category term='Triggers'/><category term='COM'/><category term='session management'/><category term='assembly binding error'/><category term='Generic Collections'/><category term='IIS'/><category term='Asynchronous triggers'/><category term='ADO.NET'/><category term='C# 3.0'/><category term='Entity Framework 4'/><category term='Distributed Computing'/><category term='Crystal Report'/><category term='vb6'/><category term='Dynamic Proxy'/><category term='iPhone'/><category term='Attributes'/><category term='TWAIN'/><category term='WCF'/><category term='Aspect Orient Programming'/><category term='COM Interop'/><category term='MS-SQL'/><category term='WPF'/><category term='iCarMode'/><category term='C# 4.0'/><category term='Excel'/><title type='text'>Dieg's world</title><subtitle type='html'>.net framework, SQL &amp;amp; other technical stuff blog</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-6540638214104835149</id><published>2011-08-26T01:43:00.002+03:00</published><updated>2011-08-26T01:58:13.874+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='appStore'/><category scheme='http://www.blogger.com/atom/ns#' term='iCarMode'/><title type='text'>iCarMode - available on the appStore !!</title><content type='html'>Today my post is not another .net/sql/programming post.&lt;br /&gt;&lt;br /&gt;Today I am happy to present my new iPhone app 1st release.&lt;br /&gt;&lt;br /&gt;The application is called - iCarMode and it's a joined effort of Mark Mishaev &amp; myself.&lt;br /&gt;&lt;br /&gt;Small quote from the appStore description:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;"iCarMode presents a new user interface speacilly designed to allow safer use of your iPhone while driving. &lt;br /&gt;&lt;br /&gt;The large buttons give you a quick and comfortable access to your favorite contacts, iPod playlists, navigation and other useful features."&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If you ever tried to play music, make a phone call or find your favorite GPS app from your (hopefully) docked iPhone you probably noticed how uncomfortable it is, if not to say - dangerous.&lt;br /&gt;&lt;br /&gt;iCarMode is meant to expose a simpler UI to allow you to perform those actions in a safer mode.&lt;br /&gt;&lt;br /&gt;Here's the main screenshot:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--z9pWYSRvYE/TlbNWm4XddI/AAAAAAAAKM4/4wQozcxGY5k/s1600/showcase_small2.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="293" width="400" src="http://2.bp.blogspot.com/--z9pWYSRvYE/TlbNWm4XddI/AAAAAAAAKM4/4wQozcxGY5k/s400/showcase_small2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;For more details, goto the product's new website: &lt;a href="http://www.iCarMode.com"&gt;http://www.iCarMode.com&lt;br /&gt;&lt;/a&gt; And don't forget to download, rate and spread the word at the appStore.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://itunes.apple.com/il/app/icarmode/id457404275?mt=8" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="65" width="194" src="http://2.bp.blogspot.com/-tdL2Bfps5fY/TlbPo1ciD9I/AAAAAAAAKNA/YV4QBY85Dw0/s400/App_Store_Badge_EN_Transparent1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best Regards,&lt;br /&gt;Diego&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-6540638214104835149?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/6540638214104835149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2011/08/icarmode-available-on-appstore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/6540638214104835149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/6540638214104835149'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2011/08/icarmode-available-on-appstore.html' title='iCarMode - available on the appStore !!'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/--z9pWYSRvYE/TlbNWm4XddI/AAAAAAAAKM4/4wQozcxGY5k/s72-c/showcase_small2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-177476052357220915</id><published>2011-05-31T15:31:00.014+03:00</published><updated>2011-05-31T15:57:20.080+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Application'/><category scheme='http://www.blogger.com/atom/ns#' term='MsBuild'/><title type='text'>Web Application Automatic Deployment using MsBuild with Microsoft SDC Task Library</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Projects commonly have a web application component, be it a front end or in the form of WebServices. This article will demonstrate how the web applications can be automatically deployed and configured under IIS using the Microsoft SDC Task Library extensions for MsBuild.&lt;/div&gt;&lt;div&gt;The SDC Task Library is free and available at &lt;a href="http://codeplex.com/sdctasks"&gt;http://codeplex.com/sdctasks&lt;/a&gt; Over 300 tasks included in this library including tasks for: creating websites, creating application pools, creating ActiveDirectory users, running FxCop, configuring virtual servers, creating zip files, configuring COM+, creating folder shares, installing into the GAC, configuring SQL Server, configuring BizTalk 2004 and BizTalk 2006 etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Step 1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Create project xml file and import SDC tasks&lt;/div&gt;&lt;div&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&amp;gt;&lt;br /&gt; &amp;lt;Import Project="Microsoft.Sdc.Common.tasks"/&amp;gt;&lt;br /&gt; …&lt;br /&gt;&amp;lt;/Project&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Step 2&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Create deployment Work Plan&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;Target Name="Deploy_Webapp"&amp;gt;&lt;br /&gt; &amp;lt;CallTarget Targets="CopyFolders" /&amp;gt;&lt;br /&gt; &amp;lt;CallTarget Targets="SetPermissions" /&amp;gt;&lt;br /&gt; &amp;lt;CallTarget Targets="CleanIIS" /&amp;gt;&lt;br /&gt; &amp;lt;CallTarget Targets="CreateWebSite" /&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Step 3&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Implement every Target in Work Plan, let's focus on CreateWebSite. First of all I will create a WebSite and then I will create a VirtualDirectory.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;Target Name="CreateWebSite" DependsOnTargets="CleanIIS"&amp;gt;&lt;br /&gt; &amp;lt;Web.WebSite.Create&lt;br /&gt;    Description="testWebSite"&lt;br /&gt;    Path="C:\Server"&lt;br /&gt;    MachineName="localhost"/&amp;gt;&lt;br /&gt; &amp;lt;Web.WebSite.CreateVirtualDirectory&lt;br /&gt;    VirtualDirectoryName="testVD"&lt;br /&gt;    Path="C:\Server"&lt;br /&gt;    MachineName="localhost"&lt;br /&gt;    AppPoolID="DefaultAppPool"&lt;br /&gt;    AppCreate="True"&lt;br /&gt;    WebSiteName="testWebSite"&lt;br /&gt;    AuthFlags="NTLM"/&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;CreateVirtualDirectory attributes:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;virtualDirectoryName - name of the virtual driectory to create&lt;/li&gt;&lt;li&gt;path - Path to map the virtual directory to.&lt;/li&gt;&lt;li&gt;machineName - Machine to add the virtual directory on.&lt;/li&gt;&lt;li&gt;appPoolID - Application pool to run the virtual directory under&lt;/li&gt;&lt;li&gt;appCreate - Set to "true" to create an application for this virtual directory.&lt;/li&gt;&lt;li&gt;webSiteName - Web site to attach the virtual directory onto.&lt;/li&gt;&lt;li&gt;authFlags - Authentication flags to apply to the directory.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Step 4&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Create batch file to make all this easier to run&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;pre name="code" class="c#"&gt;@ECHO OFF&lt;br /&gt;&lt;br /&gt;IF EXIST %windir%\Microsoft.NET\Framework64\v2.0.50727\ (&lt;br /&gt; %windir%\Microsoft.NET\Framework64\v2.0.50727\msbuild configServer.xml&lt;br /&gt;) ELSE (&lt;br /&gt; %windir%\Microsoft.NET\Framework\v2.0.50727\msbuild configServer.xml&lt;br /&gt;)&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Finally&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Microsoft SDC Task Library extensions for MsBuild provides us much more options, You can read a manual that comes with it in order to learn more.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;u&gt;Complite Example:&lt;/u&gt; &lt;a href="https://sites.google.com/site/eduardfilefepositore/webAppDeployment.rar"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-177476052357220915?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/177476052357220915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2011/05/web-application-automatic-deployment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/177476052357220915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/177476052357220915'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2011/05/web-application-automatic-deployment.html' title='Web Application Automatic Deployment using MsBuild with Microsoft SDC Task Library'/><author><name>Eduard</name><uri>http://www.blogger.com/profile/10643815548326591497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-1594287465772849685</id><published>2011-05-08T22:19:00.000+03:00</published><updated>2011-05-08T22:19:22.396+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework 4'/><title type='text'>Using DataAnnotations to validate entities</title><content type='html'>In every sample on the internet regarding MVC and Entity Framework 4.0, we can find the use of &lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.aspx"&gt;DataAnnotations&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;DataAnnotations allows us to add to our entities some Meta data including simple rules of validation (as well as hiding column, defining display name etc.).&lt;br /&gt;By simple validation rules I mean we can define:&lt;br /&gt;- Required fields&lt;br /&gt;- String Length&lt;br /&gt;- Range&lt;br /&gt;&lt;br /&gt;Adding DataAnnotations is quite simple, after adding a reference to System.ComponentModel.DataAnnotations, we can add a partial class extending the relevant entity from our Entity Framework edmx and defining a metadatatype class with the rules.&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;    [MetadataType(typeof(TrackMetaData))]&lt;br /&gt;    public partial class Track&lt;br /&gt;    {&lt;br /&gt;        public class TrackMetaData&lt;br /&gt;        {&lt;br /&gt;            [ScaffoldColumn(false)]&lt;br /&gt;            [DisplayName("Track Id")]&lt;br /&gt;            public int Id { get; set; }&lt;br /&gt;&lt;br /&gt;            [StringLength(50)]&lt;br /&gt;            public string Name{ get; set; }&lt;br /&gt;&lt;br /&gt;            [Range(typeof(DateTime), "1/1/1753", "31/12/9999",&lt;br /&gt;               ErrorMessage = "Value for {0} must be between {1} and {2}")]&lt;br /&gt;            [DisplayName("Play Date")]&lt;br /&gt;            public Nullable&lt;System.DateTime&gt; PlayDate { get; set; }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In this example we can see the use of ScaffoldColumn, StringLegth, DisplayName &amp; Range...for those who work on multi language system or just prefer - you can retrieve the error message from a resource file as well.&lt;br /&gt;&lt;br /&gt;Adding this class will work for MVC, MVC's plumbing will use this class to show error messages when relevant...but what if we have another type of client and we want to make sure data is validated before saving it to database?&lt;br /&gt;&lt;br /&gt;Add this simple helper class to your project (or even better to your framework/core/library):&lt;br /&gt;&lt;pre name="code" class="C#"&gt;   public class ValidationHelper&lt;br /&gt;    {&lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// Check if specified object is valid&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        /// &lt;param name="obj"&gt;The object to validate&lt;/param&gt;        /// &lt;returns&gt;&lt;/returns&gt;&lt;br /&gt;        public static bool IsValid(object obj)&lt;br /&gt;        {&lt;br /&gt;            return (!Validate(obj).Any());&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// Validate an object against Data Annotations meta data defined against the object &lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        /// &lt;param name="instance"&gt;The object to validate&lt;/param&gt;        /// &lt;returns&gt;A List of &lt;see cref="ValidationResult"/&gt; &lt;/returns&gt;&lt;br /&gt;        public static List&lt;ValidationResult&gt; Validate(object obj)&lt;br /&gt;        {&lt;br /&gt;            Type instanceType = obj.GetType();&lt;br /&gt;            Type metaData = null;&lt;br /&gt;            MetadataTypeAttribute[] metaAttr = (MetadataTypeAttribute[])instanceType.GetCustomAttributes(typeof(MetadataTypeAttribute), true);&lt;br /&gt;&lt;br /&gt;            if (metaAttr.Count() &gt; 0)&lt;br /&gt;            {&lt;br /&gt;                metaData = metaAttr[0].MetadataClassType;&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                throw new InvalidOperationException("Cannot validate object, no metadata assoicated with the specified type");&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            TypeDescriptor.AddProviderTransparent(&lt;br /&gt;            new AssociatedMetadataTypeTypeDescriptionProvider(instanceType, metaData), instanceType);&lt;br /&gt;&lt;br /&gt;            List&lt;ValidationResult&gt; results = new List&lt;ValidationResult&gt;();&lt;br /&gt;            ValidationContext ctx = new ValidationContext(obj, null, null);&lt;br /&gt;&lt;br /&gt;            bool valid = Validator.TryValidateObject(obj, ctx, results, true);&lt;br /&gt;            return results;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// Get Validation errors as string&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        /// &lt;param name="obj"&gt;The object to validate&lt;/param&gt;        /// &lt;returns&gt;&lt;/returns&gt;&lt;br /&gt;        public static string GetValidationErrors(object obj)&lt;br /&gt;        {&lt;br /&gt;            List&lt;ValidationResult&gt; errors = Validate(obj);&lt;br /&gt;&lt;br /&gt;            var errorText = new StringBuilder();&lt;br /&gt;            foreach (var error in errors)&lt;br /&gt;            {&lt;br /&gt;                errorText.Append(error.ErrorMessage + Environment.NewLine);&lt;br /&gt;            }&lt;br /&gt;            return errorText.ToString();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Than..add a few lines of code to your UnitOfWork (see my previous post for details: &lt;a href="http://diegworld.blogspot.com/2011/04/ef4-self-tracking-entities-repository.html"&gt;EF4 Self Tracking Entities &amp; Repository design pattern&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;    public class UnitOfWork:IUnitOfWork, IDisposable&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        public void ApplyChanges(string entityName, object entity)&lt;br /&gt;        {&lt;br /&gt;            if (entity == null)&lt;br /&gt;                return;&lt;br /&gt;&lt;br /&gt;            if (entity is IObjectWithChangeTracker)&lt;br /&gt;            {&lt;br /&gt;                bool ok = ValidationHelper.IsValid(entity);&lt;br /&gt;&lt;br /&gt;                if (!ok)&lt;br /&gt;                {&lt;br /&gt;                    string message = string.Format("Can not apply changes to the '{0}' entity due to validation errors", entity.ToString());&lt;br /&gt;                    LogUtil.LogInfo(string.Format("{0} ({1})", message, ValidationHelper.GetValidationErrors(entity)));&lt;br /&gt;&lt;br /&gt;                    throw new ValidationException(message);&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                _context.ApplyChanges(entityName, (IObjectWithChangeTracker)entity);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                throw new ArgumentException("entity must implement IObjectWithChangeTracker to use applyChanges");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's it..before the save of every entity (you implemented a MetadataType class for), it will validate the object and refuse to applyChanges or any other policy you decide is suitable to your project.&lt;br /&gt;&lt;br /&gt;Happy validation,&lt;br /&gt;Diego&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-1594287465772849685?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/1594287465772849685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2011/05/using-dataannotations-to-validate.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1594287465772849685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1594287465772849685'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2011/05/using-dataannotations-to-validate.html' title='Using DataAnnotations to validate entities'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-3119899621501239532</id><published>2011-04-07T01:33:00.004+03:00</published><updated>2011-04-08T01:11:38.939+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework 4'/><title type='text'>EF4 Self Tracking Entities &amp; Repository design pattern</title><content type='html'>Today I'm going to talk about a new sample project I was building these days just to get to know Entity Framework 4.0 better.&lt;br /&gt;&lt;br /&gt;After reading Mark Mishaev's post here (&lt;a href="http://diegworld.blogspot.com/2011/01/building-n-tier-applications-with.html"&gt;Building N-Tier Applications with Entity Framework 4&lt;/a&gt;) &amp; a few of his references I decided to explore the self tracking entities.&lt;br /&gt;&lt;br /&gt;As I see it, Self tracking entities is one of the most basic features the previous version of EF was missing.&lt;br /&gt;&lt;br /&gt;Self tracking entities as the name implies is the ability of our entities to contain their state, if you're familiar with datasets &amp; their diffgram capability than you probably used the &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.datarow.rowstate.aspx"&gt;RowState property&lt;/a&gt; to detect which rows are new, which are updated, deleted or unchanged - that is what tracking means.&lt;br /&gt;&lt;br /&gt;With STE (self tracking entities) you can send your entities to your client &amp; when receiving it back, detect easily all the changes your client made and save it to your database (of course after choosing the right concurrency strategy for your application), without it - you'll find yourself comparing the returned entity with your database to decide which changes were made &amp; setting their state one by one before you can actually save. &lt;br /&gt;&lt;br /&gt;So STE is the ultimate solution? Not for sure....one of the big disadvantages of STE is the fact that your client must know the actual entity - meaning:&lt;br /&gt;1. It will work only if you code both the server &amp; client (it's not always the case), proxies passing the entity's datamembers won't do the tracking stuff...&lt;br /&gt;2. Your client must be .net client.&lt;br /&gt;3. Any changes to entity structure/logic will require client publishing (a big minus architecturally speaking).&lt;br /&gt;&lt;br /&gt;If you're absolutely sure you can ignore these disadvantages in your specific application - you will gain a simple &amp; great way to track changes out of the box.&lt;br /&gt;&lt;br /&gt;Searching for the best way to implement the use of EF I encounter many discussions about a few related patterns, the two that repeatedly stood out were Repository &amp; UnitOfWork.&lt;br /&gt;&lt;br /&gt;To make a long reading short..&lt;br /&gt;&lt;br /&gt;Repository will help us separating our business logic layer from knowing anything about entity framework - potentially can allow us to control our dataAccess layer behavior (cache, trace, security etc) better and change the implementation without changing the whole application, it will also allow us to replace the repository with an in-memory repository which can be a great way to unit test our application without a database.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;namespace Dieg.Framework.DataAccess&lt;br /&gt;{&lt;br /&gt;    public interface IRepository&lt;t&gt;&lt;br /&gt;    { &lt;br /&gt;        T GetById(int id);&lt;br /&gt;        IEnumerable&lt;t&gt; GetAll();&lt;br /&gt;        IEnumerable&lt;t&gt; Query(Expression&amp;lt;Func&amp;lt;T, bool&amp;gt;&amp;gt; filter);&lt;br /&gt;        void Add(T entity);&lt;br /&gt;        void Remove(T entity);&lt;br /&gt;&lt;br /&gt;        void ApplyChanges(T entity);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Implementation:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;namespace Dieg.Framework.DataAccess&lt;br /&gt;{&lt;br /&gt;    public abstract class Repository&lt;t&gt; : IRepository&lt;t&gt; where T : class&lt;br /&gt;    {&lt;br /&gt;        protected IObjectSet&lt;t&gt; _objectSet;&lt;br /&gt;        protected IUnitOfWork _uow;&lt;br /&gt;&lt;br /&gt;        public Repository(IUnitOfWork uow) &lt;br /&gt;        {&lt;br /&gt;            _uow = uow;&lt;br /&gt;            _objectSet = _uow.CreateObjectSet&lt;t&gt;();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public abstract T GetById(int id);&lt;br /&gt;&lt;br /&gt;        public IEnumerable&lt;t&gt; GetAll()&lt;br /&gt;        {&lt;br /&gt;            return _objectSet;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public IEnumerable&lt;t&gt; Query(System.Linq.Expressions.Expression&amp;lt;Func&amp;lt;T, bool&amp;gt;&amp;gt; filter)&lt;br /&gt;        {&lt;br /&gt;            return _objectSet.Where(filter);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void Add(T entity)&lt;br /&gt;        {&lt;br /&gt;            _objectSet.AddObject(entity);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void Remove(T entity)&lt;br /&gt;        {&lt;br /&gt;            _objectSet.DeleteObject(entity);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public abstract string Name&lt;br /&gt;        {&lt;br /&gt;            get;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public abstract void ApplyChanges(T entity);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Implementing a specific repository, I prefer implementing a separate repository for each entity this way we can choose a unique behavior for each entity (for example: not all entities allow all CRUD operations, maybe there are different authorization rules for some entities etc).&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;namespace Dieg.MusicLibrary.DataAccess&lt;br /&gt;{&lt;br /&gt;    public class ArtistRepository:Repository&lt;artist&gt;&lt;br /&gt;    {&lt;br /&gt;        public const string ENTITY_NAME = "Artist"; &lt;br /&gt;&lt;br /&gt;        public ArtistRepository(UnitOfWork uow):base(uow)&lt;br /&gt;        { }&lt;br /&gt;&lt;br /&gt;        public override Artist GetById(int id)&lt;br /&gt;        {&lt;br /&gt;            return _objectSet.SingleOrDefault(a =&gt; a.Id == id);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override string Name&lt;br /&gt;        {&lt;br /&gt;            get { return ENTITY_NAME; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public override void ApplyChanges(Artist entity)&lt;br /&gt;        {&lt;br /&gt;            _uow.ApplyChanges(Name, entity);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;UnitOfWork - according to Martin Fowler, the Unit of Work pattern "maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems." (&lt;a href="http://msdn.microsoft.com/en-us/magazine/dd882510.aspx"&gt;The Unit Of Work Pattern And Persistence Ignorance&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;namespace Dieg.Framework.DataAccess&lt;br /&gt;{&lt;br /&gt;    public interface IUnitOfWork&lt;br /&gt;    {&lt;br /&gt;        IObjectSet&lt;t&gt; CreateObjectSet&lt;t&gt;() where T : class;&lt;br /&gt;&lt;br /&gt;        void SaveChanges();&lt;br /&gt;&lt;br /&gt;        void ApplyChanges(string entityName, object entity);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;ApplyChanges method will contain the STE implementation of updating our entities state, since ApplyChanges is per entity, we can control in our BL which entities should be influenced by the specific BL method and avoid saving irrelevant changes.&lt;br /&gt;&lt;br /&gt;Notice the implementation will have to be in the dataAcess layer project &amp; not part of the 'framework/core/lib', since we want it to use the STE specific context extensions.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;namespace Dieg.MusicLibrary.DataAccess&lt;br /&gt;{&lt;br /&gt;    public class UnitOfWork:IUnitOfWork, IDisposable&lt;br /&gt;    {&lt;br /&gt;        private readonly DiegMusicLibraryContainer _context;&lt;br /&gt;&lt;br /&gt;        public UnitOfWork()&lt;br /&gt;        {&lt;br /&gt;            _context = new DiegMusicLibraryContainer();&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public void SaveChanges()&lt;br /&gt;        {&lt;br /&gt;            _context.SaveChanges();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void Dispose()&lt;br /&gt;        {&lt;br /&gt;            _context.Dispose();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public IObjectSet&lt;e&gt; CreateObjectSet&lt;e&gt;() where E : class&lt;br /&gt;        {&lt;br /&gt;            return _context.CreateObjectSet&lt;e&gt;();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void ApplyChanges(string entityName, object entity)&lt;br /&gt;        {&lt;br /&gt;            if (entity is IObjectWithChangeTracker)&lt;br /&gt;            {&lt;br /&gt;                _context.ApplyChanges(entityName, (IObjectWithChangeTracker)entity);&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                throw new ArgumentException("entity must implement IObjectWithChangeTracker to use applyChanges");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As I mentioned earlier, when using STE the client must have a reference to the entities, so we'll have to separate the entities from the EF context &amp; edmx code, this can easily done using T4 templates (see :&lt;a href="http://blogs.microsoft.co.il/blogs/gilf/archive/2010/12/05/how-to-separate-self-tracking-entities-to-their-own-class-library.aspx"&gt;How to Separate Self-Tracking Entities to Their Own Class Library (by Gil Fink)&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Let's code a simple test to see the basic concept:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Artist artist;&lt;br /&gt;            &lt;br /&gt;            using (UnitOfWork uow = new UnitOfWork())&lt;br /&gt;            {&lt;br /&gt;                ArtistRepository Artists = new ArtistRepository(uow);&lt;br /&gt;&lt;br /&gt;                foreach (var Artist in Artists.GetAll())&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine(Artist.Name);&lt;br /&gt;                }&lt;br /&gt;                &lt;br /&gt;                artist = Artists.GetById(1);&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            /*unitOfWork (which holds the objectContext) is disposed here&lt;br /&gt;            this will happen also when sending objects through a&lt;br /&gt;              WCF (or similar) service&lt;br /&gt;            */&lt;br /&gt;&lt;br /&gt;            //change something...&lt;br /&gt;            artist.ChangeTracker.ChangeTrackingEnabled = true;&lt;br /&gt;            artist.Name = string.Concat(artist.Name,"AAA");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            using (UnitOfWork uow2 = new UnitOfWork())&lt;br /&gt;            {&lt;br /&gt;                ArtistRepository Artists = new ArtistRepository(uow2);&lt;br /&gt;&lt;br /&gt;                //calling ApplyChanges will update the state of the artist&lt;br /&gt;                //using behind the scense the STE Changetracker&lt;br /&gt;                //without this the save won't recognize any changes -&lt;br /&gt;                // comment the following line &amp; try it out!!&lt;br /&gt;                Artists.ApplyChanges(artist);&lt;br /&gt;&lt;br /&gt;                uow2.SaveChanges();&lt;br /&gt;&lt;br /&gt;                Artist b = Artists.GetById(1);&lt;br /&gt;                Console.WriteLine(b.Name);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Good luck!&lt;br /&gt;Diego&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-3119899621501239532?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/3119899621501239532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2011/04/ef4-self-tracking-entities-repository.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/3119899621501239532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/3119899621501239532'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2011/04/ef4-self-tracking-entities-repository.html' title='EF4 Self Tracking Entities &amp; Repository design pattern'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-1998438140368229792</id><published>2011-01-29T11:59:00.001+02:00</published><updated>2011-01-29T12:14:34.689+02:00</updated><title type='text'>Grid view in MVC using mvcContrib</title><content type='html'>Last post I showed a simple way to display images in your html using an MVC controller &lt;a href="http://diegworld.blogspot.com/2010/09/display-images-from-database-mvc-style.html"&gt;Displaying images from a database - MVC style&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But then it got me thinking...what if I have a lot of records ? what if I want to allow the users to search for a specific record? &lt;br /&gt;So the answer is of course - adding some sort of page/sort/filter control/s&lt;br /&gt;in ASP.NET we just needed to pick one from millions..what about MVC?&lt;br /&gt;&lt;br /&gt;Googling through this topic I found all sort of HTML helpers some free &amp; some commercial, the 1st one to catch my eye and later on proven to be a good catch was &lt;a href="http://mvccontrib.codeplex.com/"&gt;mvcContrib&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I will show you a small sample I built based on &lt;a href="http://weblogs.asp.net/rajbk/archive/2010/05/08/asp-net-mvc-paging-sorting-filtering-using-the-mvccontrib-grid-and-pager.aspx"&gt;Raj Kaimal blog&lt;/a&gt; using mvcContrib.&lt;br /&gt;&lt;br /&gt;Lets start from a few semi-new concepts when developing in MVC:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. ViewModels:&lt;/b&gt;&lt;br /&gt;The architectural hype these days is definitely ORM tools like &lt;a href="http://msdn.microsoft.com/en-us/data/aa937723"&gt;EntityFramework&lt;/a&gt;, &lt;a href="http://nhforge.org/Default.aspx"&gt;NHibernate&lt;/a&gt; etc - These frameworks and others were invented to decouple the database structure from the logical entities defined in our application and map between them to allow transferring data back and forward.&lt;br /&gt;The thing is that before these tools came we were working with smaller sets of data, retrieving only the data we needed for display and sometimes modeling it for smoother work in a specific view.&lt;br /&gt;For this type of work we will use ViewModel, view-model is a portion of our model built specific for a single view (or more if same that is display in more than one way), it decouple the view from the model, allows us to work with a smaller set of data in a structure adjusted to the view but still keep it strongly typed.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Controllers&lt;/b&gt;&lt;br /&gt;Controllers as their name suggests - control, they are the main MVC concept, Controllers are the gateway of the view to the application &amp; data - building a wall between them - a real wall - not an imaginary one as in webform ASP.NET - this "wall" will allow us to serve the same services for different types of views (web applications, webservices, smart phones etc).&lt;br /&gt;&lt;br /&gt;Let's see an implementation of these concepts.&lt;br /&gt;&lt;br /&gt;In every grid view there are 3 different views:&lt;br /&gt;1. The filter view.&lt;br /&gt;2. The main view.&lt;br /&gt;3. The paging view.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ccc5bYdDZJc/TUPie27fsNI/AAAAAAAAIyk/lj3JIGLX5RA/s1600/views.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="245" width="400" src="http://4.bp.blogspot.com/_ccc5bYdDZJc/TUPie27fsNI/AAAAAAAAIyk/lj3JIGLX5RA/s400/views.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Every view has its own viewModel.&lt;br /&gt;The filter will need a viewModel which describes the filter, a list of items for a combo filter, a datetime for a datepicker etc&lt;br /&gt;The main view will probably need columns from all sorts of entities, some of them could be "translated" using some sort of lookup table, some maybe formatted differently for this view etc.&lt;br /&gt;The paging view will need a viewModel that describes the paging ruler, in the case of mvcContrib - implementation of IPagination.&lt;br /&gt;The main view will also need to implement GridSortOptions to allow sorting.&lt;br /&gt;&lt;br /&gt;Sounds kinda complicated, but actually it couldn't be easier...&lt;br /&gt;&lt;br /&gt;Filter's view model will contain a list that will be represented as a dropdown in the view:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;public class AlbumFilterViewModel&lt;br /&gt;    {&lt;br /&gt;        public AlbumFilterViewModel()&lt;br /&gt;        {&lt;br /&gt;            SelectedArtistId = -1;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public int SelectedArtistId { get; set; }&lt;br /&gt;&lt;br /&gt;        public List&lt;selectlistitem&gt; Artists { get; set; }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The main view view-model, this will contain the columns we want to display in the gridview, notice that we can change the way the columns are displayed using simple attributes, this could be implemented for a specific view or at the entity level exploiting the fact that EF entities are define as partial classes (using DataAnnotations: [MetadataType(typeof(AlbumMetaData))]):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;public class AlbumListViewModel&lt;br /&gt;    {&lt;br /&gt;        [ScaffoldColumn(false)]  //this columns won't be shown in view&lt;br /&gt;        public int ArtistId { get; set; }&lt;br /&gt;&lt;br /&gt;        [ScaffoldColumn(false)]&lt;br /&gt;        public int AlbumId { get; set; }&lt;br /&gt;&lt;br /&gt;        [DisplayName("Artist Name")] //change the display name of the column&lt;br /&gt;        public string ArtistName { get; set; }&lt;br /&gt;&lt;br /&gt;        [DisplayName("Album Name")]&lt;br /&gt;        public string Name { get; set; }&lt;br /&gt;&lt;br /&gt;        [DisplayName("Cover")]&lt;br /&gt;        public byte[] Picture { get; set; }&lt;br /&gt;&lt;br /&gt;        [DisplayName("Last Updated Date")]&lt;br /&gt;        [DisplayFormat(DataFormatString = "{0:g}")] //format the date&lt;br /&gt;        public DateTime LastUpdatedDate { get; set; }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As I mentioned before the main view implements the acutal grid and also the paging and sorting, the viewModel will contain the previous one plus the paging and sort definition. it will look like this:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;public class AlbumListContainerViewModel&lt;br /&gt;    {&lt;br /&gt;        //paging&lt;br /&gt;        public IPagination&lt;albumlistviewmodel&gt; AlbumPageList { get; set; }&lt;br /&gt;        //main view&lt;br /&gt;        public AlbumFilterViewModel AlbumFilterViewModel { get; set; }&lt;br /&gt;        //sort&lt;br /&gt;        public GridSortOptions GridSortOptions { get; set; }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now lets go to the view.&lt;br /&gt;We'll have 3 different partial views (ascx):&lt;br /&gt;1. The filter.&lt;br /&gt;2. The main view.&lt;br /&gt;3. The paging ruler that we'll had before and after the main view.&lt;br /&gt;&lt;br /&gt;The container will look something like this:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;% Html.RenderPartial("SearchFilter", Model.AlbumFilterViewModel); %&gt;&lt;br /&gt;    &lt;% Html.RenderPartial("Pager", Model.AlbumPageList); %&gt;&lt;br /&gt;    &lt;% Html.RenderPartial("SearchResult", Model); %&gt;&lt;br /&gt;    &lt;% Html.RenderPartial("Pager", Model.AlbumPageList); %&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The filter view html is quite simple, notice that the view is strongly typed:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;DiegJukeboxRemote.Models.AlbumFilterViewModel&gt;" %&gt;&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;            &lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;%:Html.DropDownList("ArtistId", Model.Artists, "-- All --", htmlAttributes)%&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The search result view code, you will see the mvcContrib's html helpers does everything, the only two place I wrote my own code was to specify a different behavior for two columns, one is the "More.." column which is linked to a detail view of the chosen row and a the image column which is linked to the controller that retrieve the image from the database:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;DiegJukeboxRemote.Models.AlbumListContainerViewModel&gt;" %&gt;&lt;br /&gt;&lt;%@ Import Namespace="MvcContrib.UI.Grid" %&gt;&lt;br /&gt;&lt;%@ Import Namespace="DiegJukeboxRemote.Models" %&gt;&lt;br /&gt;&lt;%@ Import Namespace="DiegJukeboxRemote.HtmlHelpers" %&gt;&lt;br /&gt;&lt;%= Html.Grid(Model.AlbumPageList).AutoGenerateColumns()&lt;br /&gt;    .Columns(column =&gt; {&lt;br /&gt;        column.For(a =&gt; Html.ActionLink("More..", "ThumbChooserEdit", new { id = a.AlbumId })).InsertAt(4).Encode(false);&lt;br /&gt;    })&lt;br /&gt;    .Columns(column=&gt; {&lt;br /&gt;        column.For(a =&gt; Html.Image(a.AlbumId, "RetrieveImage", "MusicInfo", &lt;br /&gt;            new Dictionary&lt;string, string&gt;() { &lt;br /&gt;                                                { "Height", "100" }, { "Width", "100" },&lt;br /&gt;                                                {"onerror", "onImgErrorSmall(this)"}&lt;br /&gt;            })).InsertAt(3).Encode(false);&lt;br /&gt;    })&lt;br /&gt;    .Sort(Model.GridSortOptions)&lt;br /&gt;    .Attributes(@class =&gt; "table-list")&lt;br /&gt;%&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The pager couldn't be simpler:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;MvcContrib.Pagination.IPagination&gt;" %&gt;&lt;br /&gt;&lt;%@ Import Namespace="MvcContrib.UI.Pager" %&gt;&lt;br /&gt;&lt;p/&gt;&lt;%= Html.Pager(Model)&lt;br /&gt;        .First("First")&lt;br /&gt;        .Last("Last")&lt;br /&gt;        .Next("Next")&lt;br /&gt;        .Previous("Previous") %&gt;&lt;br /&gt;&lt;p/&gt;&lt;/pre&gt;&lt;br /&gt;Finally the controller, using LINQ we retrieve the data we need from artist/album repositories, you will see here two special points:&lt;br /&gt;1. Using System.Web.Mvc.SelectListItem for the dropdownlist.&lt;br /&gt;2. Using MvcContrib.UI.Grid.GridSortOptions &amp; MvcContrib.Pagination.PaginationHelper so mvcContrib helpers can do the rest :-)&lt;br /&gt;&lt;pre name="code" class="C#"&gt;public ActionResult ThumbChooser(int? artistId, GridSortOptions gridSortOptions, int? page, bool? MissingCoverOnly)&lt;br /&gt;        {&lt;br /&gt;            IQueryable&lt;albumlistviewmodel&gt; albumList = null;&lt;br /&gt;&lt;br /&gt;            if (!MissingCoverOnly.HasValue || !MissingCoverOnly.Value)&lt;br /&gt;            {&lt;br /&gt;                albumList = _BL.GetAlbumListView();&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                albumList = _BL.GetAlbumListViewMissingCover();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            if (string.IsNullOrWhiteSpace(gridSortOptions.Column))&lt;br /&gt;            {&lt;br /&gt;                gridSortOptions.Column = "ArtistId";&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            if (artistId.HasValue)&lt;br /&gt;            {&lt;br /&gt;                albumList = albumList.Where(a =&gt; a.ArtistId == artistId.Value);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            var albumFilter = new AlbumFilterViewModel();&lt;br /&gt;            albumFilter.SelectedArtistId = artistId ?? -1;&lt;br /&gt;&lt;br /&gt;            albumFilter.Artists = _BL.GetArtistList().OrderBy(art=&gt;art.Name)&lt;br /&gt;                                    .Select(a =&gt; new { a.ArtistId, a.Name })&lt;br /&gt;                                    .ToList().Select(a =&gt;&lt;br /&gt;                                        new SelectListItem&lt;br /&gt;                                        {&lt;br /&gt;                                            Text = a.Name.Length &gt; 20 ? string.Concat(a.Name.Substring(0,20),"...") : a.Name,&lt;br /&gt;                                            Value = a.ArtistId.ToString(),&lt;br /&gt;                                            Selected = a.ArtistId == albumFilter.SelectedArtistId&lt;br /&gt;                                        }).ToList();&lt;br /&gt;&lt;br /&gt;            var albumPageList = albumList&lt;br /&gt;                                .OrderBy(gridSortOptions.Column, gridSortOptions.Direction)&lt;br /&gt;                                .AsPagination(page ?? 1, 10);&lt;br /&gt;&lt;br /&gt;            var albumListContainer = new AlbumListContainerViewModel&lt;br /&gt;            {&lt;br /&gt;                AlbumFilterViewModel = albumFilter,&lt;br /&gt;                AlbumPageList = albumPageList,&lt;br /&gt;                GridSortOptions = gridSortOptions&lt;br /&gt;            };&lt;br /&gt;&lt;br /&gt;            return View(albumListContainer);&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's it!&lt;br /&gt;&lt;br /&gt;Till next time...&lt;br /&gt;Diego&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_ccc5bYdDZJc/TUPogxos89I/AAAAAAAAIys/nqfeK7gcj8w/s1600/final.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="400" width="322" src="http://1.bp.blogspot.com/_ccc5bYdDZJc/TUPogxos89I/AAAAAAAAIys/nqfeK7gcj8w/s400/final.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-1998438140368229792?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/1998438140368229792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2011/01/grid-view-in-mvc-using-mvccontrib_29.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1998438140368229792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1998438140368229792'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2011/01/grid-view-in-mvc-using-mvccontrib_29.html' title='Grid view in MVC using mvcContrib'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ccc5bYdDZJc/TUPie27fsNI/AAAAAAAAIyk/lj3JIGLX5RA/s72-c/views.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-3965496306752622103</id><published>2011-01-08T10:56:00.064+02:00</published><updated>2011-04-07T01:43:40.394+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='N-Tier Applications'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework 4'/><title type='text'>Building N-Tier Applications with Entity Framework 4</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This post describes using of EF4 for building N-Tier applications. I've decided to write about this topic, after reading an excellent series of articles about N-Tier applications by Daniel Simmons:&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://msdn.microsoft.com/en-us/magazine/ee321569.aspx"&gt;N-Tier Application Patterns&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://msdn.microsoft.com/en-us/magazine/dd882522.aspx"&gt;Anti-Patterns to Avoid in N-Tier Applications&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://msdn.microsoft.com/en-us/magazine/ee335715.aspx"&gt;Building N-Tier Apps with EF 4 &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Those articles provide in-depth explanation about different issues and considerations we need to take into account, while building N-Tier applications.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Self-Tracking Entities&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Self-tracking entities are smart objects with an ability to keep track on their own changes. The key difference between them and regular datasets is that self-tracking entities are plain-old CLR objects (POCO) and consequently are not tied to any specific persistance technology. They are relatively simple objects that represent the entities and information about changes that they went through.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;T4 Templates&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb126445.aspx#2"&gt;T4 templates&lt;/a&gt; are text templates that contain text blocks and control logic mixed together and can generate a text file, similar to &lt;a href="http://velocity.apache.org/engine/index.html"&gt;Velocity Template Engine&lt;/a&gt; used in Java.&lt;br /&gt;&lt;br /&gt;In our example we will use &lt;a href="http://t4toolbox.codeplex.com/"&gt;T4-based code generator&lt;/a&gt; to create our self-tracking entities.&lt;br /&gt;You need to download and install it before you start.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Building N-Tier Application&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The application we're going to build is based on the example from Daniel Simmons third article and uses Northwind database as a back-end.&lt;br /&gt;&lt;br /&gt;Let's start with building our data access layer project:&lt;br /&gt;&lt;br /&gt;New Project---&gt;Class Library Project, name it Northwind.DAL&lt;br /&gt;Add---&gt;New Item---&gt;ADO.NET Entity Data Model&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_KT-RmjJQDTk/TSjUEZNCRgI/AAAAAAAAHlM/JWiL8ItwE5M/s1600/Capture.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 206px;" src="http://2.bp.blogspot.com/_KT-RmjJQDTk/TSjUEZNCRgI/AAAAAAAAHlM/JWiL8ItwE5M/s320/Capture.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5559926911939003906" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We will generate our model from the database:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_KT-RmjJQDTk/TSjVkv1rZJI/AAAAAAAAHlU/G5NM3-zB1xU/s1600/Capture1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 281px;" src="http://4.bp.blogspot.com/_KT-RmjJQDTk/TSjVkv1rZJI/AAAAAAAAHlU/G5NM3-zB1xU/s320/Capture1.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5559928567282492562" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Our model will look like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_KT-RmjJQDTk/TSo1gtz-MjI/AAAAAAAAHuw/jprxnlbfadA/s1600/EntityDesignerDiagram.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 245px; height: 320px;" src="http://1.bp.blogspot.com/_KT-RmjJQDTk/TSo1gtz-MjI/AAAAAAAAHuw/jprxnlbfadA/s320/EntityDesignerDiagram.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5560315526111965746" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Right-click on the model designer---&gt;Add Code Generation Item---&gt;ADO Self-Tracking Entity Generator&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_KT-RmjJQDTk/TSjZ_IXF6QI/AAAAAAAAHlk/-UOpBs_yAtA/s1600/Capture2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 207px;" src="http://4.bp.blogspot.com/_KT-RmjJQDTk/TSjZ_IXF6QI/AAAAAAAAHlk/-UOpBs_yAtA/s320/Capture2.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5559933418588203266" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This action will add T4 template to our project. You can also notice that it will disable the default code generation for our EF model&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_KT-RmjJQDTk/TSjeHKxXmfI/AAAAAAAAHls/0eZ-ZR3_Cps/s1600/Capture4.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 164px;" src="http://2.bp.blogspot.com/_KT-RmjJQDTk/TSjeHKxXmfI/AAAAAAAAHls/0eZ-ZR3_Cps/s320/Capture4.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5559937954720750066" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now we're going to move our newly generated self-tracking entities to separate project in order to decouple the DAL project from the entities.&lt;br /&gt;&lt;br /&gt;Right-click on the solution item---&gt;Add New Project---&gt;Class Library project, name it Northwind.Entities.&lt;br /&gt;Afterwards, you simply cut the Northwind.tt item and paste it into Northwind.Entities project.&lt;br /&gt;Don't forget to reference System.Runtime.Serialization assembly in the Northwind.Entities project and add a reference to Northwind.Entities project in Northwind.DAL project.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT-RmjJQDTk/TSjiv9pFSaI/AAAAAAAAHl0/7s4q5I0NovM/s1600/Capture5.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 205px; height: 320px;" src="http://3.bp.blogspot.com/_KT-RmjJQDTk/TSjiv9pFSaI/AAAAAAAAHl0/7s4q5I0NovM/s320/Capture5.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5559943053617482146" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We're ready to add WCF service layer to our application.&lt;br /&gt;Right-click on the solution item---&gt;Add New Project---&gt;WCF Service Application project, name it Northwind.Service.&lt;br /&gt;Rename the created service definition interface to INorthwindService and move it to the entities project.&lt;br /&gt;&lt;br /&gt;Add following methods to the INorthwindService:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;[ServiceContract]&lt;br /&gt;public interface INorthwindService&lt;br /&gt;{&lt;br /&gt;[OperationContract]&lt;br /&gt;IEnumerable&amp;ltproducts&amp;gt GetProducts();&lt;br /&gt;&lt;br /&gt;[OperationContract]&lt;br /&gt;Customers GetCustomer(string id);&lt;br /&gt;&lt;br /&gt;[OperationContract]&lt;br /&gt;bool SubmitOrder(Orders order);    &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I know that in a real application we would add additional layers like Business Logic layer and Service Interface layer, but for the sake of simplicity we will leave it out.&lt;br /&gt;&lt;br /&gt;Let's add an implementation to our service:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;public class NorthwindService : INorthwindService&lt;br /&gt;{&lt;br /&gt;public IEnumerable&amp;ltproducts&amp;gt GetProducts()&lt;br /&gt;{&lt;br /&gt;using (var ctx = new NorthwindEntities())&lt;br /&gt;{&lt;br /&gt;return ctx.Products.ToList();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Customers GetCustomer(string id)&lt;br /&gt;{&lt;br /&gt;using (var ctx = new NorthwindEntities())&lt;br /&gt;{&lt;br /&gt;return ctx.Customers.Include("Orders")&lt;br /&gt;.Where(c =&gt; c.CustomerID == id)&lt;br /&gt;.SingleOrDefault();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public bool SubmitOrder(Orders newOrder)&lt;br /&gt;{&lt;br /&gt;using (var ctx = new NorthwindEntities())&lt;br /&gt;{&lt;br /&gt;ctx.Orders.ApplyChanges(newOrder);&lt;br /&gt;return ctx.SaveChanges() &gt; 0;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Please note the &lt;span style="font-style:italic;"&gt;Include&lt;/span&gt; method used in GetCustomer method. This method allows so-called eager loading of Orders table to reduce the number of round-trips to the database.&lt;br /&gt;The detailed information about different loading data options in EF may be found &lt;a href="http://msdn.microsoft.com/en-us/library/bb896272.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Instead of building some "state of art" client to test our service, let's add a real test project to our solution:&lt;br /&gt;&lt;br /&gt;Right-click on the solution item---&gt;Add New Project---&gt;Test Project, name it Northwind.Test&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_KT-RmjJQDTk/TSouyjbutoI/AAAAAAAAHuo/PxJBYlUNTmw/s1600/Capture5.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 208px;" src="http://1.bp.blogspot.com/_KT-RmjJQDTk/TSouyjbutoI/AAAAAAAAHuo/PxJBYlUNTmw/s320/Capture5.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5560308135982184066" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You have to add a reference to Northwind.Service and Northwind.Entities. Don't forget to clean up all the proxies automatically generated for the entities.&lt;br /&gt;&lt;br /&gt;Add following test methods to the test class:&lt;br /&gt;&lt;pre name="code" class="C#"&gt;[TestClass]&lt;br /&gt;public class NorthwindTest&lt;br /&gt;{&lt;br /&gt;public NorthwindTest()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private TestContext testContextInstance;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;///Gets or sets the test context which provides&lt;br /&gt;///information about and functionality for the current test run.&lt;br /&gt;///&lt;/summary&gt;&lt;br /&gt;public TestContext TestContext&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return testContextInstance;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;testContextInstance = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[TestMethod]&lt;br /&gt;public void TestGetProducts()&lt;br /&gt;{&lt;br /&gt;using (NorthwindServiceClient client = new NorthwindServiceClient())&lt;br /&gt;{&lt;br /&gt;List&amp;ltProducts&amp;gt products = client.GetProducts();&lt;br /&gt;&lt;br /&gt;Assert.IsTrue(products.Count &gt; 0);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[TestMethod]&lt;br /&gt;public void TestGetCustomer()&lt;br /&gt;{&lt;br /&gt;using (NorthwindServiceClient client = new NorthwindServiceClient())&lt;br /&gt;{&lt;br /&gt;Customers customer = client.GetCustomer("ALFKI");&lt;br /&gt;Assert.IsNotNull(customer);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[TestMethod]&lt;br /&gt;public void TestSubmitOrder()&lt;br /&gt;{&lt;br /&gt;using (NorthwindServiceClient client = new NorthwindServiceClient())&lt;br /&gt;{&lt;br /&gt;var products = new List&amp;ltProducts&amp;gt(client.GetProducts());&lt;br /&gt;Assert.IsTrue(products.Count &gt; 0);&lt;br /&gt;&lt;br /&gt;var customer = client.GetCustomer("ALFKI");&lt;br /&gt;Assert.IsNotNull(customer);               &lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;// add a new order&lt;br /&gt;var newOrder = new Orders();&lt;br /&gt;newOrder.OrderDate = DateTime.Now;&lt;br /&gt;newOrder.RequiredDate = DateTime.Now;&lt;br /&gt;&lt;br /&gt;var orderedProduct = &lt;br /&gt;products.Where(p =&gt; p.ProductName ==  "Chang")&lt;br /&gt;.Single();&lt;br /&gt;Order_Details orderDetails = new Order_Details()&lt;br /&gt;{&lt;br /&gt;ProductID = orderedProduct.ProductID,&lt;br /&gt;Quantity = 1&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;newOrder.Order_Details.Add(orderDetails);                                       &lt;br /&gt;customer.Orders.Add(newOrder);&lt;br /&gt;&lt;br /&gt;var submitSuccess = client.SubmitOrder(newOrder);&lt;br /&gt;Assert.IsTrue(submitSuccess);&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;TestContext.WriteLine(ex.StackTrace);&lt;br /&gt;Assert.Fail();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I think we're done.&lt;br /&gt;&lt;br /&gt;To see your application in action just run all test methods from the "Test" menu.&lt;br /&gt;&lt;br /&gt;The complete code could be downloaded &lt;a href="https://sites.google.com/site/markmishaev/files/NorthwindNTierWithEntityFramework.rar?attredirects=0&amp;d=1"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is it,&lt;br /&gt;&lt;br /&gt;Mark.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-3965496306752622103?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/3965496306752622103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2011/01/building-n-tier-applications-with.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/3965496306752622103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/3965496306752622103'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2011/01/building-n-tier-applications-with.html' title='Building N-Tier Applications with Entity Framework 4'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_KT-RmjJQDTk/TSjUEZNCRgI/AAAAAAAAHlM/JWiL8ItwE5M/s72-c/Capture.JPG' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-984277090066602646</id><published>2010-12-23T17:41:00.008+02:00</published><updated>2010-12-26T12:31:48.472+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WinForms'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>ComboBox SelectedValueChanging Event</title><content type='html'>&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For some reason, a standard WinForm ComboBox does not contain SelectedValueChanging event, which may be useful if you're requested to intercept a change or cancel it.&lt;br /&gt;&lt;br /&gt;After searching for a possible solution on the web, I've found a nice &lt;a href="http://stackoverflow.com/questions/782313/how-can-i-handle-combobox-selected-index-changing"&gt;example &lt;/a&gt;and adopted it with slight modifications.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SelectedValueChanging Event&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Generally, subclassing common WinForm controls is a good idea, since it allows you to customize their appearance and behavior in a single place and affect all instances in the entire application.&lt;br /&gt;&lt;br /&gt;In this case, we will subclass a ComboBox class and add the SelectedValueChanging event:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;br /&gt;public partial class nessComboBox : ComboBox&lt;br /&gt;{&lt;br /&gt;  public event CancelEventHandler SelectedValueChanging;&lt;br /&gt;&lt;br /&gt;  private object m_LastAcceptedSelectedValue;&lt;br /&gt;  private bool m_IgnoreNullPreviousValueChanging = false;&lt;br /&gt;&lt;br /&gt;  public nessComboBox()&lt;br /&gt;  {&lt;br /&gt;      InitializeComponent();&lt;br /&gt;  }&lt;br /&gt;    &lt;br /&gt;  [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;  [Browsable(false)]&lt;br /&gt;  public object LastAcceptedSelectedValue&lt;br /&gt;  {&lt;br /&gt;      get { return m_LastAcceptedSelectedValue; }&lt;br /&gt;      private set { m_LastAcceptedSelectedValue = value; }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;  [Browsable(false)]&lt;br /&gt;  public bool IgnoreNullPreviousValueChanging&lt;br /&gt;  {&lt;br /&gt;      get { return m_IgnoreNullPreviousValueChanging; }&lt;br /&gt;      set { m_IgnoreNullPreviousValueChanging = value; }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected void OnSelectedValueChanging(CancelEventArgs e)&lt;br /&gt;  {&lt;br /&gt;      if (SelectedValueChanging != null)&lt;br /&gt;          SelectedValueChanging(this, e);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected override void OnSelectedValueChanged(EventArgs e)&lt;br /&gt;  {&lt;br /&gt;      if (SelectedValueChanging != null)&lt;br /&gt;      {&lt;br /&gt;          if ((!m_IgnoreNullPreviousValueChanging ||&lt;br /&gt;               LastAcceptedSelectedValue != null) &amp;amp;&amp;amp;&lt;br /&gt;               (LastAcceptedSelectedValue ?? string.Empty).ToString()&lt;br /&gt;               !=  (SelectedValue ?? string.Empty).ToString())&lt;br /&gt;          {&lt;br /&gt;              CancelEventArgs cancelEventArgs = new CancelEventArgs();&lt;br /&gt;              OnSelectedValueChanging(cancelEventArgs);&lt;br /&gt;&lt;br /&gt;              if (!cancelEventArgs.Cancel)&lt;br /&gt;              {&lt;br /&gt;                  LastAcceptedSelectedValue = SelectedValue;&lt;br /&gt;                  base.OnSelectedValueChanged(e);&lt;br /&gt;              }&lt;br /&gt;              else&lt;br /&gt;                  SelectedValue = LastAcceptedSelectedValue;&lt;br /&gt;          }&lt;br /&gt;          else if (m_IgnoreNullPreviousValueChanging &amp;amp;&amp;amp;&lt;br /&gt;                      LastAcceptedSelectedValue == null&lt;br /&gt;                      &amp;amp;&amp;amp; SelectedValue != null)&lt;br /&gt;          {&lt;br /&gt;              LastAcceptedSelectedValue = SelectedValue;&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;          base.OnSelectedValueChanged(e);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see, the overrided OnSelectedValueChanged method performs all required logic: checks if there are subscribers to the new event and raises it before calling of the OnSelectedValueChanged method.&lt;br /&gt;&lt;br /&gt;The variable m_IgnoreNullPreviousValueChanging may be used to ignore the initial selection change from null to some specific value in case of data-binded combo.&lt;br /&gt;&lt;br /&gt;That's it,&lt;br /&gt;Mark.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-984277090066602646?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/984277090066602646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/12/combobox-selectedvaluechanging-event.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/984277090066602646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/984277090066602646'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/12/combobox-selectedvaluechanging-event.html' title='ComboBox SelectedValueChanging Event'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-2559355382132050233</id><published>2010-12-20T15:31:00.031+02:00</published><updated>2010-12-21T23:23:27.064+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF Data Services</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Introduction&lt;/span&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;WCF technology provides &lt;a href="http://blogs.msdn.com/b/endpoint/archive/2010/01/04/wcf-data-services-ria-services-alignment-questions-and-answers.aspx"&gt;several types of services&lt;/a&gt; sharing the same undelying infrastructure and we can choose the appropriate service type based on our needs:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT-RmjJQDTk/TQ-vQbbMweI/AAAAAAAAACA/8emgMMID7Kc/s1600/WcfOverviewDiagram_18.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_KT-RmjJQDTk/TQ-vQbbMweI/AAAAAAAAACA/8emgMMID7Kc/s320/WcfOverviewDiagram_18.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5552849562345718242" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;In this post, I would like to make a quick overview of WCF Data Services.&lt;br /&gt;&lt;br /&gt;According to MSDN,  &lt;a href="http://msdn.microsoft.com/en-us/library/cc668792.aspx"&gt;WCF Data Services&lt;/a&gt;  (formerly known as "ADO.NET Data Services") is a component of the .NET Framework that enables you to create services that use the Open Data Protocol (&lt;a href="http://www.odata.org/"&gt;OData&lt;/a&gt;)  to expose and consume data over the Web or intranet by using the semantics of representational state transfer (&lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm"&gt;REST&lt;/a&gt;).&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The main advantage of using WCF Data Services is that it allows easy access to data from any client that supports OData.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Visual Studio makes it easy to create OData service by utilizing an ADO.NET Entity Framework data model.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following example is based on &lt;a href="http://msdn.microsoft.com/en-us/library/cc668796.aspx"&gt;WCF Data Service Quickstart&lt;/a&gt; and built with Visual Studio 2010.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;WCF Data Services Quick Start&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The example is divided into four steps:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Creating a simple ASP.NET application&lt;/li&gt;&lt;li&gt;Defining a data model based on the well-known &lt;a href="https://sites.google.com/site/markmishaev/files/instnwnd.rar?attredirects=0&amp;d=1"&gt;Northwind&lt;/a&gt; database by using the Entity Framework 4&lt;/li&gt;&lt;li&gt;Adding the data service to to the web application&lt;/li&gt;&lt;li&gt;Creating a WPF client that consumes the service&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Let's start with the ASP.NET application:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;File---&gt;Project---&gt;ASP.NET Web Application&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Name it &lt;i&gt;NorthwindService&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next step is creating the corresponding data model:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right-click the name of the ASP.NET project---&gt;Add New Item---&gt;ADO.NET Entity Data Model&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For the name of the data model, type Northwind.edmx&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Third step is creating the data service:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right-click the name of the ASP.NET project---&gt;Add New Item---&gt;WCF Data Service&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For the name of the service, type &lt;i&gt;Northwind&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;After completing of these three steps, your project might look like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT-RmjJQDTk/TQ-7LY0wrSI/AAAAAAAAACI/xzjLxfiQNu4/s1600/Capture.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 182px; height: 320px;" src="http://3.bp.blogspot.com/_KT-RmjJQDTk/TQ-7LY0wrSI/AAAAAAAAACI/xzjLxfiQNu4/s320/Capture.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5552862669887810850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In order to enable access to our data service, we need to grant rights to the particular enities within the model:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;br /&gt;public static void InitializeService(DataServiceConfiguration config)&lt;br /&gt;{&lt;br /&gt;    config.SetEntitySetAccessRule("Orders", EntitySetRights.AllRead&lt;br /&gt;      | EntitySetRights.WriteMerge&lt;br /&gt;      | EntitySetRights.WriteReplace);&lt;br /&gt;&lt;br /&gt;    config.SetEntitySetAccessRule("Order_Details", EntitySetRights.AllRead&lt;br /&gt;      | EntitySetRights.AllWrite);&lt;br /&gt;&lt;br /&gt;    config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Our final step will be creating a simple WPF client for consuming and modifying the model data:&lt;br /&gt;&lt;br /&gt;In Solution Explorer, right-click the solution,&lt;br /&gt;click Add---&gt;New Project---&gt;WPF Application.&lt;br /&gt;&lt;br /&gt;Enter &lt;span style="font-style:italic;"&gt;NorthwindClient &lt;/span&gt;for the project name.&lt;br /&gt;Replace the existing code in MainWindow.xaml with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="XML"&gt;&lt;br /&gt;&amp;lt;Window x:Class="MainWindow"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;Title="Northwind Orders" Height="335" Width="425"&lt;br /&gt;Name="OrdersWindow" Loaded="Window1_Loaded"&amp;gt;&lt;br /&gt;&amp;lt;Grid Name="orderItemsGrid"&amp;gt;&lt;br /&gt;&amp;lt;ComboBox DisplayMemberPath="OrderID" ItemsSource="{Binding}"&lt;br /&gt;         IsSynchronizedWithCurrentItem="true"&lt;br /&gt;         Height="23" Margin="92,12,198,0" Name="comboBoxOrder" VerticalAlignment="Top"/&amp;gt;&lt;br /&gt;&amp;lt;DataGrid ItemsSource="{Binding Path=Order_Details}"&lt;br /&gt;         CanUserAddRows="False" CanUserDeleteRows="False"&lt;br /&gt;         Name="orderItemsDataGrid" Margin="34,46,34,50"&lt;br /&gt;         AutoGenerateColumns="False"&amp;gt;&lt;br /&gt;   &amp;lt;DataGrid.Columns&amp;gt;&lt;br /&gt;       &amp;lt;DataGridTextColumn  Header="Product" Binding="{Binding ProductID, Mode=OneWay}" /&amp;gt;&lt;br /&gt;       &amp;lt;DataGridTextColumn  Header="Quantity" Binding="{Binding Quantity, Mode=TwoWay}" /&amp;gt;&lt;br /&gt;       &amp;lt;DataGridTextColumn  Header="Price" Binding="{Binding UnitPrice, Mode=TwoWay}" /&amp;gt;&lt;br /&gt;       &amp;lt;DataGridTextColumn  Header="Discount" Binding="{Binding Discount, Mode=TwoWay}" /&amp;gt;       &lt;br /&gt;   &amp;lt;/DataGrid.Columns&amp;gt;&lt;br /&gt;&amp;lt;/DataGrid&amp;gt;&lt;br /&gt;&amp;lt;Label Height="28" Margin="34,12,0,0" Name="orderLabel" VerticalAlignment="Top"&lt;br /&gt;      HorizontalAlignment="Left" Width="65"&amp;gt;Order:&amp;lt;/Label&amp;gt;&lt;br /&gt;&amp;lt;StackPanel Name="Buttons" Orientation="Horizontal" HorizontalAlignment="Right"&lt;br /&gt;           Height="40" Margin="0,257,22,0"&amp;gt;&lt;br /&gt;   &amp;lt;Button Height="23" HorizontalAlignment="Right" Margin="0,0,12,12"&lt;br /&gt;       Name="buttonSave" VerticalAlignment="Bottom" Width="75"&lt;br /&gt;           Click="buttonSaveChanges_Click"&amp;gt;Save Changes&lt;br /&gt;   &amp;lt;/Button&amp;gt;&lt;br /&gt;   &amp;lt;Button Height="23" Margin="0,0,12,12"&lt;br /&gt;       Name="buttonClose" VerticalAlignment="Bottom" Width="75"&lt;br /&gt;           Click="buttonClose_Click"&amp;gt;Close&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;/StackPanel&amp;gt;&lt;br /&gt;&amp;lt;/Grid&amp;gt;&lt;br /&gt;&amp;lt;/Window&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It will give the following look to our client:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_KT-RmjJQDTk/TQ_HMEwbz9I/AAAAAAAAACQ/xcxFgqAu6I8/s1600/Capture1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 251px;" src="http://1.bp.blogspot.com/_KT-RmjJQDTk/TQ_HMEwbz9I/AAAAAAAAACQ/xcxFgqAu6I8/s320/Capture1.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5552875875820359634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We need to add a data service reference to the client project:&lt;br /&gt;&lt;br /&gt;Right-Click the project---&gt;Add Reference---&gt;Discover&lt;br /&gt;In the Namespace text box, type &lt;span style="font-style:italic;"&gt;Northwind&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The only thing left is to to access the service data and we're done.&lt;br /&gt;Copy this code into MainWindow.xaml.cs:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;br /&gt;&lt;br /&gt;private NorthwindEntities context;&lt;br /&gt;private string customerId = "ALFKI";&lt;br /&gt;&lt;br /&gt;// Replace the host server and port number with the values&lt;br /&gt;// for the test server hosting your Northwind data service instance.&lt;br /&gt;private Uri svcUri = new Uri("http://localhost:12345/Northwind.svc");&lt;br /&gt;&lt;br /&gt;private void Window1_Loaded(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt; try&lt;br /&gt; {&lt;br /&gt;     // Instantiate the DataServiceContext.&lt;br /&gt;     context = new NorthwindEntities(svcUri);&lt;br /&gt;&lt;br /&gt;     // Define a LINQ query that returns Orders and&lt;br /&gt;     // Order_Details for a specific customer.&lt;br /&gt;     var ordersQuery = from o in context.Orders.Expand("Order_Details")&lt;br /&gt;                       where o.Customer.CustomerID == customerId&lt;br /&gt;                       select o;&lt;br /&gt;&lt;br /&gt;     // Create an DataServiceCollection&amp;ltt&amp;gt based on&lt;br /&gt;     // execution of the LINQ query for Orders.&lt;br /&gt;     DataServiceCollection&amp;lorder&amp;gt customerOrders = new&lt;br /&gt;         DataServiceCollection&amp;lorder&amp;gt(ordersQuery);&lt;br /&gt;&lt;br /&gt;     // Make the DataServiceCollection&amp;lt&amp;gt the binding source for the Grid.&lt;br /&gt;     this.orderItemsGrid.DataContext = customerOrders;&lt;br /&gt; }&lt;br /&gt; catch (Exception ex)&lt;br /&gt; {&lt;br /&gt;     MessageBox.Show(ex.ToString());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void buttonSaveChanges_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt; try&lt;br /&gt; {&lt;br /&gt;     // Save changes made to objects tracked by the context.&lt;br /&gt;     context.SaveChanges();&lt;br /&gt; }&lt;br /&gt; catch (DataServiceRequestException ex)&lt;br /&gt; {&lt;br /&gt;     MessageBox.Show(ex.ToString());&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;private void buttonClose_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt; this.Close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/t&gt;&lt;/order&gt;&lt;/order&gt;&lt;/t&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now we can build and run the application.&lt;br /&gt;&lt;br /&gt;As you can see, exposing and consuming a model data with WCF data services is a straightforward process, but that's not the issue, the more important thing that our WPF client can be easily replaced by other clients located in a totally different environment with no change of the service itself.&lt;br /&gt;&lt;br /&gt;The runnable code for this tutorial could be downloaded &lt;a href="https://sites.google.com/site/markmishaev/files/NorthwindWcfDataServiceExample.rar?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is it,&lt;br /&gt;&lt;br /&gt;Mark..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-2559355382132050233?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/2559355382132050233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/12/wcf-data-services.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2559355382132050233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2559355382132050233'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/12/wcf-data-services.html' title='WCF Data Services'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_KT-RmjJQDTk/TQ-vQbbMweI/AAAAAAAAACA/8emgMMID7Kc/s72-c/WcfOverviewDiagram_18.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-7495964557747905432</id><published>2010-12-07T00:02:00.021+02:00</published><updated>2010-12-08T00:00:50.517+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='DataBinding'/><title type='text'>Custom Binding with INotifyPropertyChanged Interface</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this post I would like to show a simple example of using INotifyPropertyChanged interface for binding a custom object properties to WinForm controls.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;According to Microsoft's documentation INotifyPropertyChanged interface is used to notify clients about properties value changes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The underneath idea is very simple: implementing this interface, forces raising PropertyChange event, which in-turn notifies client that binded property has changed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The Example&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Let's start with building a simple BankAccount class :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;public class BankAccount : INotifyPropertyChanged&lt;br /&gt;    {&lt;br /&gt;        public event PropertyChangedEventHandler PropertyChanged;&lt;br /&gt;&lt;br /&gt;        private decimal m_Balance;&lt;br /&gt;        private decimal m_CreditLimit;&lt;br /&gt;&lt;br /&gt;        public BankAccount(decimal initialBalance)&lt;br /&gt;        {&lt;br /&gt;            this.m_Balance = initialBalance;&lt;br /&gt;            this.m_CreditLimit = initialBalance * 2;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public decimal Balance&lt;br /&gt;        {&lt;br /&gt;            get { return m_Balance; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public decimal CreditLimit&lt;br /&gt;        {&lt;br /&gt;            get { return m_CreditLimit; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void Withdrawal(decimal sum)&lt;br /&gt;        {&lt;br /&gt;            if (sum &lt;= m_Balance) &lt;br /&gt;            { &lt;br /&gt;                m_Balance -= sum; &lt;br /&gt;                if (PropertyChanged != null) &lt;br /&gt;                { &lt;br /&gt;                    PropertyChanged(this, &lt;br /&gt;                       new PropertyChangedEventArgs("Balance")); &lt;br /&gt;                } &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void Deposit(decimal sum)&lt;br /&gt;        {&lt;br /&gt;            if (sum &gt; 0)&lt;br /&gt;            {&lt;br /&gt;                m_Balance += sum;&lt;br /&gt;                if (PropertyChanged != null)&lt;br /&gt;                {&lt;br /&gt;                    PropertyChanged(this, &lt;br /&gt;                       new PropertyChangedEventArgs("Balance"));&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                if(m_Balance &gt;= m_CreditLimit)&lt;br /&gt;                {&lt;br /&gt;                    m_CreditLimit = m_Balance * 2;&lt;br /&gt;                    if (PropertyChanged != null)&lt;br /&gt;                    {&lt;br /&gt;                        PropertyChanged(this, &lt;br /&gt;                          new PropertyChangedEventArgs("CreditLimit"));&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The class contains two properties "Balance" and "CreditLimit" which are going to be binded to our simple UI elements:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_KT-RmjJQDTk/TP4QYRGLTGI/AAAAAAAAABw/4qsW_41Lm6g/s1600/UI.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 262px;" src="http://1.bp.blogspot.com/_KT-RmjJQDTk/TP4QYRGLTGI/AAAAAAAAABw/4qsW_41Lm6g/s320/UI.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5547889800059243618" /&gt;&lt;/a&gt;Here is the code demonstrating how we actually bind it:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;public partial class MainForm : Form&lt;br /&gt;{&lt;br /&gt;    private BankAccount m_Account;&lt;br /&gt;&lt;br /&gt;    public MainForm()&lt;br /&gt;    {&lt;br /&gt;       InitializeComponent();&lt;br /&gt;       m_Account = new BankAccount(1000);&lt;br /&gt;&lt;br /&gt;       BindControls();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void BindControls()&lt;br /&gt;    {&lt;br /&gt;        txtBalance.DataBindings.Add("Text",&lt;br /&gt;                               m_Account,&lt;br /&gt;                               "Balance",&lt;br /&gt;                               true,&lt;br /&gt;                               DataSourceUpdateMode.OnPropertyChanged);&lt;br /&gt;&lt;br /&gt;       txtCreditLimit.DataBindings.Add("Text",&lt;br /&gt;                                  m_Account,&lt;br /&gt;                                  "CreditLimit",&lt;br /&gt;                                  true,&lt;br /&gt;                                  DataSourceUpdateMode.OnPropertyChanged);&lt;br /&gt;    } &lt;br /&gt;&lt;br /&gt;    private void btnWithdrawal_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        m_Account.Withdrawal(decimal.Parse(txtSum.Text));&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void btnDeposit_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        m_Account.Deposit(decimal.Parse(txtSum.Text));&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Now, the binded textboxes will automatically reflect changes of "Balance" and "CreditLimit" properties after calling Withdrawal/Deposit methods:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT-RmjJQDTk/TP4b9w6_qHI/AAAAAAAAAB4/TNjgFm_1SDk/s1600/UI1.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 254px;" src="http://3.bp.blogspot.com/_KT-RmjJQDTk/TP4b9w6_qHI/AAAAAAAAAB4/TNjgFm_1SDk/s320/UI1.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5547902538885343346" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The working example could be downloaded &lt;a href="https://sites.google.com/site/markmishaev/files/INotifyPropertyChangedExample.rar?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is it,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Mark&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-7495964557747905432?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/7495964557747905432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/12/implementing-custom-binding-by-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/7495964557747905432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/7495964557747905432'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/12/implementing-custom-binding-by-using.html' title='Custom Binding with INotifyPropertyChanged Interface'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_KT-RmjJQDTk/TP4QYRGLTGI/AAAAAAAAABw/4qsW_41Lm6g/s72-c/UI.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-4673313961233411414</id><published>2010-12-04T22:06:00.042+02:00</published><updated>2010-12-05T14:53:23.530+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Parallel Programming'/><title type='text'>Parallel Loops with .NET Framework 4</title><content type='html'>&lt;div&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Parallel computing draws a lot of attention at these days, because of amazing pace in which multi-core computers become widely available for industrial and personal use.&lt;/div&gt;&lt;div&gt;Developing applications that can take advantage of this computitional power, requires revision of the existing practices and design patterns, since those practices were born in the sequential world and do not solve similar&lt;/div&gt;&lt;div&gt;We all know that writting paraller applications is difficult and painful mission, not only because of well-known issues such as deadlocks and race-conditions, but simply because human beings have been always struggling to think in a parallel way.&lt;/div&gt;&lt;div&gt;That's why, existing of well-designed patterns for parallel programming is so crucial.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a C# developer, I've started looking for the parallel programming resources by using .NET framework 4 , and found an excellent paper by Stephen Toub&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=86B3D32B-AD26-4BB8-A3AE-C1637026C3EE"&gt; "Patterns of Parallel Programming"&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;The paper contains in-depth tour in .NET framework 4 for parallel programming.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this post I would like to show one of the examples from the mentioned above paper :"Parallel Loops".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Parallel Loops&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you can guess, parallel loops allow running independent actions in parallel.&lt;/div&gt;&lt;div&gt;Loops are the most common control stuctures that enable the application to repeatedly execute some set of instructions.&lt;/div&gt;&lt;div&gt;We can use such loop when the statements within loop body have a few or no dependencies.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Creating Manual Parallel For&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's start with the example of performing parallel "For" manually:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;&lt;br /&gt;public static void MyParallelFor(int inclusiveLowerBound, int exclusiveUpperBound, Action body)&lt;br /&gt;{&lt;br /&gt;// Determine the number of iterations to be processed, the number of&lt;br /&gt;// cores to use, and the approximate number of iterations to process&lt;br /&gt;// in each thread.&lt;br /&gt;int size = exclusiveUpperBound - inclusiveLowerBound;&lt;br /&gt;int numProcs = Environment.ProcessorCount;&lt;br /&gt;int range = size / numProcs;&lt;br /&gt;// Use a thread for each partition. Create them all,&lt;br /&gt;// start them all, wait on them all.&lt;br /&gt;var threads = new List(numProcs);&lt;br /&gt;for (int p = 0; p &lt;&gt;&lt;br /&gt;{&lt;br /&gt;int start = p * range + inclusiveLowerBound;&lt;br /&gt;int end = (p == numProcs - 1) ?&lt;br /&gt;exclusiveUpperBound : start + range;&lt;br /&gt;threads.Add(new Thread(() =&gt;&lt;br /&gt;{&lt;br /&gt;for (int i = start; i &lt;&gt;&lt;br /&gt; body(i);&lt;br /&gt;}));&lt;br /&gt;}&lt;br /&gt;foreach (var thread in threads) thread.Start();&lt;br /&gt;foreach (var thread in threads) thread.Join();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The main drawback of this solution is relative high cost paid for creating and destroying each thread.&lt;br /&gt;We can improve it by utilizing pools of threads:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;&lt;br /&gt;public static void MyParallelFor(&lt;br /&gt;int inclusiveLowerBound, int exclusiveUpperBound, Action body)&lt;br /&gt;{&lt;br /&gt;// Determine the number of iterations to be processed, the number of&lt;br /&gt;// cores to use, and the approximate number of iterations to process in&lt;br /&gt;// each thread.&lt;br /&gt;int size = exclusiveUpperBound - inclusiveLowerBound;&lt;br /&gt;int numProcs = Environment.ProcessorCount;&lt;br /&gt;int range = size / numProcs;&lt;br /&gt;// Keep track of the number of threads remaining to complete.&lt;br /&gt;int remaining = numProcs;&lt;br /&gt;using (ManualResetEvent mre = new ManualResetEvent(false))&lt;br /&gt;{&lt;br /&gt;// Create each of the threads.&lt;br /&gt;for (int p = 0; p &lt;&gt;&lt;br /&gt;{&lt;br /&gt;int start = p * range + inclusiveLowerBound;&lt;br /&gt;int end = (p == numProcs - 1) ?&lt;br /&gt;exclusiveUpperBound : start + range;&lt;br /&gt;ThreadPool.QueueUserWorkItem(delegate&lt;br /&gt;{&lt;br /&gt; for (int i = start; i &lt;&gt;&lt;br /&gt;  body(i);&lt;br /&gt; if (Interlocked.Decrement(ref remaining) == 0)&lt;br /&gt;  mre.Set();&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;// Wait for all threads to complete.&lt;br /&gt;mre.WaitOne();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;PARALLEL.FOR&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The new "Parallel" class has been added to the .NET Framework 4 library. The class provides methods for performing parallel loops and regions, one of them is "For".  In his paper Stephen gives a very good example of using Parallel.For in order to trace rays of light. Following code snippets demonstrate the sequential and parallel variations of this problem:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;&lt;br /&gt;void RenderSequential(Scene scene, Int32[] rgb)&lt;br /&gt;{&lt;br /&gt;Camera camera = scene.Camera;&lt;br /&gt;for (int y = 0; y &lt;&gt;&lt;br /&gt;{&lt;br /&gt;int stride = y * screenWidth;&lt;br /&gt;for (int x = 0; x &lt;&gt;&lt;br /&gt;{&lt;br /&gt;Color color = TraceRay(&lt;br /&gt;new Ray(camera.Pos, GetPoint(x, y, camera)), scene, 0);&lt;br /&gt;rgb[x + stride] = color.ToInt32();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void RenderParallel(Scene scene, Int32[] rgb)&lt;br /&gt;{&lt;br /&gt;Camera camera = scene.Camera;&lt;br /&gt;Parallel.For(0, screenHeight, y =&gt;&lt;br /&gt;{&lt;br /&gt;int stride = y * screenWidth;&lt;br /&gt;for (int x = 0; x &lt;&gt;&lt;br /&gt;{&lt;br /&gt;Color color = TraceRay(&lt;br /&gt;new Ray(camera.Pos, GetPoint(x, y, camera)), scene, 0);&lt;br /&gt;rgb[x + stride] = color.ToInt32();&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;We can notice that only difference between the implementations is replacing of regular for by&lt;/div&gt;&lt;div&gt;Parallel.For&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's it for now.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'll continue extracting and adding such small articles to give a "gustations" of the wonderful stuff from Stephen's book.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Mark.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-4673313961233411414?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/4673313961233411414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/12/parallel-loops-with-net-framework-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4673313961233411414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4673313961233411414'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/12/parallel-loops-with-net-framework-4.html' title='Parallel Loops with .NET Framework 4'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-4653139897082398060</id><published>2010-11-15T16:53:00.009+02:00</published><updated>2010-11-16T10:01:11.865+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='Enterprise library'/><title type='text'>Dependency Injection</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dependency Injection (DI) is a design pattern which allows us to "inject" the concrete object into a class instead of having this initialization within the class itself.&lt;/div&gt;&lt;div&gt;One common way to achive similar result is using "Factory Method" design pattern.&lt;/div&gt;&lt;div&gt;"Factory Method" is a method, responsible for creating and returning of an instance of a class.&lt;/div&gt;&lt;div&gt;Usually a variable is passed to the "Factory" method to signalize which specific subclass should be returned.&lt;/div&gt;&lt;div&gt;The major drawbacks of the "Factory Method" are:&lt;/div&gt;&lt;div&gt;1. The method implementation is too specific and therefore cannot be used across other applications.&lt;/div&gt;&lt;div&gt;2. The creation options are hardcoded into "Factory" implementation, which means that all dependencies are known at compile time and cannot be dynamically extented without re-compiling.&lt;/div&gt;&lt;div&gt;3. The class which calls "Factory" method should know which subclass to create (sounds like dependency itself).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just to make it clear: I'm not saying that using factories is bad. There are many applications in which using factories is valuable and sufficient, but if you need more flexible solution, that's when DI enters the picture.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Dependency Injection&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DI is implemented by using so-called containers - configurable components that host the abstraction, create the concrete instance variables and inject it into appropriate classes.&lt;/div&gt;&lt;div&gt;There are many DI providers available on the market, here is the partial list:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. &lt;a href="http://www.castleproject.org/container/index.html"&gt;Castle Windsor&lt;/a&gt;&lt;/div&gt;&lt;div&gt;2. &lt;a href="http://www.springframework.net/"&gt;Spring.NET&lt;/a&gt;&lt;/div&gt;&lt;div&gt;3. &lt;a href="http://unity.codeplex.com/"&gt;Unity&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the following example we will use the Unity 2.0 components which is part of Enterprise Library 5.0.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The Example&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Lets start with creating of a simple interface &lt;i&gt;IDatabase &lt;/i&gt;containing a single method "Save"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;code&gt;&lt;div&gt; interface IDataBase&lt;/div&gt;&lt;div&gt; {&lt;/div&gt;&lt;div&gt;    void Save();&lt;/div&gt;&lt;div&gt; }&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, we'll add two classes that implement IDatabase:&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; class OracleDatabase : IDataBase&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public OracleDatabase()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;Console.WriteLine("OracleDatabase Constructor");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public void Save()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;Console.WriteLine("Save with Oracle");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And&lt;/div&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; public class SqlDatabase :  IDataBase&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;public SqlDatabase()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;Console.WriteLine("SqlDatabase Constructor");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;public void Save()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;Console.WriteLine("Save with SQL Server");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The "Customer" class will be the main class which uses the services of IDatabase component:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt; class Customer&lt;/div&gt;&lt;div&gt;  {&lt;/div&gt;&lt;div&gt;      private IDataBase m_Database = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;     [Dependency]&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;public IDataBase Database&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;get { return m_Database; }&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;set { m_Database = value; }&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;public void Save()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;m_Database.Save();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The "Dependency" attribute is part of the Unity application block and it's simply a gateway used by the Unity container for the concrete type injection.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The mapping between the abstract variable and the concrete type may be performed through the code or by adding a special configuration section to App.config file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The final usage is quite simple:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;            &lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;IUnityContainer container = new UnityContainer();                                     &lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;UnityConfigurationSection configSection = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");            &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;configSection.Configure(container);              &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;        &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Customer customer = container.Resolve&lt;customer&gt;();             &lt;/customer&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;customer&gt;&lt;/customer&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt; customer.Save();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The complete example could be downloaded &lt;a href="https://sites.google.com/site/markmishaev/files/DependencyInjectionWithUnity.rar?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's it,&lt;/div&gt;&lt;div&gt;Mark.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-4653139897082398060?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/4653139897082398060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/11/dependency-injection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4653139897082398060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4653139897082398060'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/11/dependency-injection.html' title='Dependency Injection'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-4024061079994147162</id><published>2010-10-18T12:41:00.014+02:00</published><updated>2010-10-18T15:39:45.087+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><title type='text'>Propagator Design Pattern</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;I've encountered this design pattern while I was looking for an existing solution to the problem of propagating an object property to the dependant objects.&lt;br /&gt;Actually the "Propagator" is based on well-known "Observer" design pattern&lt;br /&gt;in which an object known as the &lt;i&gt;Subject &lt;/i&gt;holds a list of &lt;i&gt;Observers &lt;/i&gt;and notifies them automatically of any state changes.&lt;/div&gt;&lt;div&gt;The difference is that "Propagator" makes it possible to construct each object to be  "Subject" and "Observer" interchangeably.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Propagator&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT-RmjJQDTk/TLwozhBS1II/AAAAAAAAABY/6pkc3a8EOyg/s1600/Propagator_Classes.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 279px; height: 195px;" src="http://3.bp.blogspot.com/_KT-RmjJQDTk/TLwozhBS1II/AAAAAAAAABY/6pkc3a8EOyg/s320/Propagator_Classes.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5529339308006364290" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The idea behind the pattern is to establish a network of dependent objects and when a change occurs, push it through propagators to all descendants.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's give a brief explanation of each actor in the diagram above:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;IPropagator interface contains methods for adding/removing dependent objects  and processing state changes.&lt;/li&gt;&lt;li&gt;Propagator class, implements the IPropagator interface and contains&lt;br /&gt;the "&lt;i&gt;AddHandler&lt;/i&gt;" method used for managing a list of delegates to be invoked when a change takes place.&lt;/li&gt;&lt;li&gt;StateChange class represents the change itself.&lt;/li&gt;&lt;li&gt;StateChangeOptions enum allows specifying a change propagation options.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;The final usage is quite simple - we just need to call "Process" method of corresponding propagator to have all objects synchronized with the recent change.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The detailed description of Propagator design pattern along with a nice code example could be found in &lt;a href="http://www.codeproject.com/KB/architecture/Propagator.aspx"&gt;this &lt;/a&gt;post by &lt;span class="Apple-style-span" style="font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px; "&gt;Martijn Boeker.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 16px;"&gt;That's it,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 16px;"&gt;Mark.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-4024061079994147162?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/4024061079994147162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/10/propagator-design-pattern.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4024061079994147162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4024061079994147162'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/10/propagator-design-pattern.html' title='Propagator Design Pattern'/><author><name>Mark Mishaev</name><uri>http://www.blogger.com/profile/01806548641703354029</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_KT-RmjJQDTk/SpfQ15RTJeI/AAAAAAAAAAU/GoX1UqnVdoo/S220/DSC01804.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_KT-RmjJQDTk/TLwozhBS1II/AAAAAAAAABY/6pkc3a8EOyg/s72-c/Propagator_Classes.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-6695257710968828461</id><published>2010-10-08T17:02:00.006+02:00</published><updated>2010-10-17T23:56:03.282+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Compare'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='Cogniview'/><title type='text'>How to Compare Two Spreadsheets in Excel</title><content type='html'>This time a contribution from Yoav Ezer the CEO of Cogniview.&lt;br /&gt;&lt;br /&gt;Enjoy,&lt;br /&gt;Diego&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Being Microsoft Excel experts, the Cogniview team are often being emailed with tricky spreadsheet questions. A particularly interesting puzzle came through recently that we thought we would share with you here:&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;&amp;quot;Each month I have to compare two spreadsheets of products, each with the same header rows and same number of column. The number of rows are different each time.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Is it possible using Excel to compare these two lists and show only the differences? I would love it if we could create a macro to solve this??&amp;quot;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Seems like a cool challenge, and I would love to say I had a hand in coming up with the solution but I am afraid it was the programming boffins at Cogniview who solved it!&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;The Solution&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Several ideas were suggested and considered, including going through each sheet line by line using VB code. The problem always came when either or both sheets were really long and contained tons of data. Even on the fastest machine it could be seen to grind to a halt.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The answer was to use Excel's built-in function RemoveDuplicates to handle this. Unfortunately that makes it a solution not available to users of older versions.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;We need two source spreadsheets to compare, then a target spreadsheet for the results, as shown below.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_ccc5bYdDZJc/TK8zjwKhjkI/AAAAAAAAIvM/-wME2rOrW8Y/s1600/sheets.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 250px; height: 45px;" src="http://2.bp.blogspot.com/_ccc5bYdDZJc/TK8zjwKhjkI/AAAAAAAAIvM/-wME2rOrW8Y/s400/sheets.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525691957124369986" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Basically, this process requires our macro to perform two steps.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Step one,&lt;/b&gt; we copy the first sheet's data to a new sheet and put the second's data after it, then we use the RemoveDuplicates function which removes the items from the second sheet that appear in the first.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_ccc5bYdDZJc/TK8zh0cbrII/AAAAAAAAIu8/7b3_doxzbxc/s1600/sheet1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 263px; height: 164px;" src="http://4.bp.blogspot.com/_ccc5bYdDZJc/TK8zh0cbrII/AAAAAAAAIu8/7b3_doxzbxc/s400/sheet1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525691923913485442" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;In the second step&lt;/b&gt; we do the same again in reverse order - copy the second sheet's data and then the first, and use RemoveDuplicates again. The left over data in each case is the difference we need to display.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_ccc5bYdDZJc/TK8ziy-2EiI/AAAAAAAAIvE/LwbUIlZ6egI/s1600/sheet2.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 232px; height: 250px;" src="http://3.bp.blogspot.com/_ccc5bYdDZJc/TK8ziy-2EiI/AAAAAAAAIvE/LwbUIlZ6egI/s400/sheet2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525691940700820002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;All we need to do then is present the results.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_ccc5bYdDZJc/TK8zhRW2EAI/AAAAAAAAIu0/jfApVEF7Cw8/s1600/compare.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 215px;" src="http://1.bp.blogspot.com/_ccc5bYdDZJc/TK8zhRW2EAI/AAAAAAAAIu0/jfApVEF7Cw8/s400/compare.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525691914494808066" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;For each row we state where the data was found.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;The Macro&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;Most of the first routine sets everything up, copying the range of data as described above. The last two lines call our custom function LeaveOnlyDifferent.&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre name="code" class="vb"&gt;Sub CompareSheets()&lt;br /&gt;' Merge into the current sheet&lt;br /&gt;Dim sheetResult As Worksheet, Sheet1 As Worksheet, Sheet2 As Worksheet&lt;br /&gt;Set sheetResult = ActiveSheet&lt;br /&gt;&lt;br /&gt;' Clean merge sheet so we can work with it&lt;br /&gt;If (MsgBox("This will erase all the data on the current sheet." &amp; vbCrLf &amp; "Do you wish to continue?", vbYesNo Or vbQuestion) &lt;&gt; vbYes) Then&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;sheetResult.UsedRange.Delete&lt;br /&gt;&lt;br /&gt;' Ask for two sheets to compare&lt;br /&gt;SelectSheet.SheetNames.Clear&lt;br /&gt;For i = 1 To Worksheets.Count&lt;br /&gt;SelectSheet.SheetNames.AddItem Worksheets(i).Name&lt;br /&gt;Next&lt;br /&gt;sFirstSheet = AskSheet&lt;br /&gt;If (sFirstSheet = "") Then&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;Set Sheet1 = Sheets(sFirstSheet)&lt;br /&gt;SelectSheetStart:&lt;br /&gt;sSecondSheet = AskSheet&lt;br /&gt;If (sSecondSheet = "") Then&lt;br /&gt;Exit Sub&lt;br /&gt;End If&lt;br /&gt;If (sSecondSheet = sFirstSheet) Then&lt;br /&gt;MsgBox "Please select different first and second sheets"&lt;br /&gt;GoTo SelectSheetStart&lt;br /&gt;End If&lt;br /&gt;Set Sheet2 = Sheets(sSecondSheet)&lt;br /&gt;&lt;br /&gt;' Find the column to use for marking&lt;br /&gt;Dim sFromColumn As String&lt;br /&gt;Dim nLastColumn As Integer&lt;br /&gt;sTemp = Sheet1.UsedRange.Offset(1, 1).Address(True, True, 1)&lt;br /&gt;sTemp = Mid(sTemp, InStr(sTemp, ":") + 1)&lt;br /&gt;sFromColumn = Mid(sTemp, 2, InStrRev(sTemp, "$") - 2)&lt;br /&gt;nLastColumn = Sheet1.UsedRange.Columns.Count&lt;br /&gt;&lt;br /&gt;' Copy header&lt;br /&gt;Sheet1.Range("A1:" &amp; sFromColumn &amp; "1").Copy sheetResult.Range("A1")&lt;br /&gt;sheetResult.Range(sFromColumn &amp; "1").Formula = "From Sheet"&lt;br /&gt;&lt;br /&gt;' Compare stuff&lt;br /&gt;LeaveOnlyDifferent Sheet2, Sheet1, sheetResult, sFromColumn, nLastColumn, 2&lt;br /&gt;LeaveOnlyDifferent Sheet1, Sheet2, sheetResult, sFromColumn, nLastColumn, sheetResult.UsedRange.Rows.Count&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;h3&gt;LeaveOnlyDifferent Function&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;This function is where the real solution lies, comparing and presenting the result. It accepts the sheets to compare and the destination, the columns and the first row. After copying the cells and removing duplicates it copies the result to the top of the destination sheet.&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre name="code" class="vb"&gt;Function LeaveOnlyDifferent(Sheet1 As Worksheet, Sheet2 As Worksheet, sheetResult As Worksheet, sFromColumn As String, nLastColumn As Integer, nFirstCompareRow As Integer)&lt;br /&gt;' Copy first sheet data&lt;br /&gt;nFirstDataRowCount = Sheet1.UsedRange.Rows.Count - 1&lt;br /&gt;Sheet1.Range("A2:" &amp; sFromColumn &amp; (nFirstDataRowCount + 1)).Copy sheetResult.Range("A" &amp; nFirstCompareRow)&lt;br /&gt;&lt;br /&gt;' Copy second sheet data below the first&lt;br /&gt;nStartOfSecondData = nFirstCompareRow + nFirstDataRowCount&lt;br /&gt;Sheet2.Range("A2:" &amp; sFromColumn &amp; Sheet2.UsedRange.Rows.Count).Copy sheetResult.Range("A" &amp; nStartOfSecondData)&lt;br /&gt;&lt;br /&gt;' Remove duplicates&lt;br /&gt;Dim arColumns() As Variant&lt;br /&gt;ReDim arColumns(0 To nLastColumn - 1)&lt;br /&gt;For i = 0 To nLastColumn - 1&lt;br /&gt;arColumns(i) = CVar(i + 1)&lt;br /&gt;Next&lt;br /&gt;sheetResult.Range("A" &amp; nFirstCompareRow &amp; ":" &amp; sFromColumn &amp; sheetResult.UsedRange.Rows.Count).RemoveDuplicates arColumns, xlYes&lt;br /&gt;&lt;br /&gt;' Mark the different data as coming from the proper sheet&lt;br /&gt;nDiffRowCount = sheetResult.UsedRange.Rows.Count - nStartOfSecondData + 1&lt;br /&gt;If (nDiffRowCount &gt; 0) Then&lt;br /&gt;sheetResult.Range(sFromColumn &amp; nStartOfSecondData &amp; ":" &amp; sFromColumn &amp; sheetResult.UsedRange.Rows.Count).Formula = "Found only on " &amp; Sheet2.Name&lt;br /&gt;' Copy it to the top&lt;br /&gt;sheetResult.Range("A" &amp; nStartOfSecondData &amp; ":" &amp; sFromColumn &amp; sheetResult.UsedRange.Rows.Count).Copy sheetResult.Range("A" &amp; nFirstCompareRow)&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;' Delete all the rest&lt;br /&gt;sheetResult.Range("A" &amp; (nFirstCompareRow + nDiffRowCount) &amp; ":" &amp; sFromColumn &amp; sheetResult.UsedRange.Rows.Count).Delete&lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;h3&gt;Over to You&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;As mentioned earlier, there are many ways to solve this particular Excel challenge - how would you solve it? Could you see this solution as being useful? Please share your thoughts and experiences with us on &lt;a href="http://www.facebook.com/Cogniview.Codswallop"&gt;Facebook&lt;/a&gt; or &lt;a href="http://twitter.com/cogniview"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;About the author&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;This article was written by Yoav Ezer, the CEO of a company that creates &lt;a href="http://www.cogniview.com/articles/pdf-to-xls-converter.php"&gt;PDF to XLS&lt;/a&gt; conversion software, called Cogniview.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Prior to that, cwas the CEO of Nocturnus, a technology-centered software solution company.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-6695257710968828461?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/6695257710968828461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/10/how-to-compare-two-spreadsheets-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/6695257710968828461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/6695257710968828461'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/10/how-to-compare-two-spreadsheets-in.html' title='How to Compare Two Spreadsheets in Excel'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ccc5bYdDZJc/TK8zjwKhjkI/AAAAAAAAIvM/-wME2rOrW8Y/s72-c/sheets.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-7012074909461708011</id><published>2010-09-20T23:46:00.006+02:00</published><updated>2010-10-17T23:57:45.392+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC 2'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Displaying images from a database - MVC style</title><content type='html'>Exploring MVC 2 I started a small project that included displaying images from my database, I know this is quite the basics, but I was impressed of the simplicity &amp; elegant style this simple task gets when using MVC.&lt;br /&gt;&lt;br /&gt;In the database I have a table that includes images contained in varbinary(max) column.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;CREATE TABLE [dbo].[Album](&lt;br /&gt;[AlbumId] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[Name] [nvarchar](max) NOT NULL,&lt;br /&gt;&lt;b&gt;[Picture] [varbinary](max) NULL,&lt;/b&gt;&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;CONSTRAINT [PK_Album] PRIMARY KEY CLUSTERED &lt;br /&gt;(&lt;br /&gt;[AlbumId] ASC&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next in my data access layer I've added a linq query to retrieve an image by albumId.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="csharp"&gt;public byte[] GetAlbumCover(int albumId)&lt;br /&gt;{&lt;br /&gt;var q = from album in _db.Album&lt;br /&gt;where album.AlbumId == albumId&lt;br /&gt;select album.Picture;&lt;br /&gt;&lt;br /&gt;byte[] cover = q.First();&lt;br /&gt;&lt;br /&gt;return cover;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As for the actual MVC...&lt;br /&gt;&lt;br /&gt;The controller:&lt;br /&gt;&lt;pre name="code" class="csharp"&gt;public ActionResult RetrieveImage(int id)&lt;br /&gt;{&lt;br /&gt;byte[] cover = _BL.GetAlbumCover(id);&lt;br /&gt;&lt;br /&gt;if (cover != null)&lt;br /&gt;&lt;b&gt;return File(cover, "image/jpg");&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The view:&lt;br /&gt;&lt;pre name="code" class="csharp"&gt;&amp;lt;% foreach (var item in Model) { %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;%: item.ArtistName %&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;%: item.AlbumName %&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;img &lt;b&gt;src="/MusicInfo/RetrieveImage/&amp;lt;%:item.AlbumId%&amp;gt;" &lt;/b&gt; alt="" height=100 width=100/&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;%: Html.ActionLink("Edit", "Edit", new {id=item.AlbumId}) %&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;% } %&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The link of the picture points to the controller (MusicInfo), the method inside the controller (RetrieveImage) &amp; the specific image id to be able to retrieve it.&lt;br /&gt;&lt;br /&gt;That's it...simple yet elegant.&lt;br /&gt;&lt;br /&gt;Till next time&lt;br /&gt;Diego&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-7012074909461708011?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/7012074909461708011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/09/display-images-from-database-mvc-style.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/7012074909461708011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/7012074909461708011'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/09/display-images-from-database-mvc-style.html' title='Displaying images from a database - MVC style'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-2476948389087148982</id><published>2010-09-14T15:45:00.010+02:00</published><updated>2010-09-14T15:59:55.325+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Import/Export DataSet to Excel file with ADO.NET</title><content type='html'>&lt;div&gt;Often it is necessary to Import/Export DataSet to external databases or external file. Here I will present how Import/Export DataSet to excel file (*.xls or *.xlsx) with ADO.NET.&lt;/div&gt;&lt;div&gt;The most significant advantage of this method is that excel installation is not necessary on running station.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will first need a connection string to connect to the Excel Workbook, which would be the following:&lt;/div&gt;&lt;div&gt;&lt;b&gt;Excel 8 (Excel 1997):&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;blockquote&gt;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=YES";&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Excel 12 (Excel 2007):&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;blockquote&gt;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\MyExcel.xlsx;Extended Properties="Excel 12.0;HDR=YES";&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Implementation of Import:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;public static DataSet ImportFromExcel(string connectionString, string fileName)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DataSet returnDS = new DataSet();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;string excelConnectionString = string.Format(connectionString, fileName);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;string[] excelSheets = getExcelSheetNames(excelConnectionString);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DbDataAdapter adapter = factory.CreateDataAdapter();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;using (DbConnection connection = factory.CreateConnection())&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;connection.ConnectionString = excelConnectionString;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;foreach (string excelSheet in excelSheets)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DbCommand selectCommand = factory.CreateCommand();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;selectCommand.CommandText = string.Format("SELECT * FROM [{0}]", excelSheet);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;selectCommand.Connection = connection;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;adapter.SelectCommand = selectCommand;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DataTable dt = new DataTable(excelSheet.Remove(excelSheet.Length - 1, 1));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;adapter.Fill(dt);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;returnDS.Tables.Add(dt);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;return returnDS;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-weight: bold; "&gt;Implementation of Export:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;public static void ExportToExcel(DataSet dataSet, string connectionString, string fileName)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;if (dataSet != null &amp;amp;&amp;amp; dataSet.Tables.Count &gt; 0)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;using (OleDbConnection connection = new OleDbConnection(string.Format(connectionString, fileName)))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;OleDbCommand command = null;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;connection.Open();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;foreach (DataTable dt in dataSet.Tables)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;command = new OleDbCommand(getCreateTableCommand(dt), connection);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;command.ExecuteNonQuery();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;for (int rowIndex = 0; rowIndex &lt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;command = new OleDbCommand(getInsertCommand(dt, rowIndex), connection);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;command.ExecuteNonQuery();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-weight: bold; "&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;How to use:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Lets define 2 variables:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES""";&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;string fileName = @"C:\MyExcel.xls";&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Import:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;blockquote&gt;DataSet ds = ImportFromExcel(connectionString, fileName);&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Export:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;blockquote&gt;ExportToExcel(ds, connectionString, fileName);&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;Source Code:&lt;/u&gt; &lt;a href="https://sites.google.com/site/eduardfilefepositore/ExcelReaderWriter.cs?attredirects=0&amp;amp;d=1"&gt;ExcelReaderWriter.cs&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-2476948389087148982?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/2476948389087148982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/09/importexport-dataset-to-excel-file-with.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2476948389087148982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2476948389087148982'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/09/importexport-dataset-to-excel-file-with.html' title='Import/Export DataSet to Excel file with ADO.NET'/><author><name>Eduard</name><uri>http://www.blogger.com/profile/10643815548326591497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-1214395498376969042</id><published>2010-09-06T23:00:00.012+03:00</published><updated>2010-10-27T14:53:45.833+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='T SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>SQL Server performance - querying by date</title><content type='html'>In every application that includes a database we will probably need to query some table by some date column - &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;SELECT Id, MyDate&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE MyDate = GETDATE()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Although this is a very simple syntax, I will show you how it can be a performance hit.&lt;br /&gt;&lt;br /&gt;We'll start by filling a table with some random dates(and one row of a specific date just to make sure it exists) and add a clustered index on this column.&lt;br /&gt;&lt;br /&gt;The data we are looking for is all the rows with today's date.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;DECLARE @myNow DATETIME&lt;br /&gt;SET @myNow = '2010-09-06 22:47'&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE MyDate = @myNow&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This query will work very fast, but, because the column 'MyDate' contains time and not just date - the result won't be as expected, only rows with the exact date &amp; time will appear.&lt;br /&gt;&lt;br /&gt;We can see in the execution plan that it uses 'clustered index seek' and results with one row which is the row we added manually with exact time.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_ccc5bYdDZJc/TIVVGwYSVjI/AAAAAAAAInY/LlTxplzmV54/s1600/1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 85px;" src="http://1.bp.blogspot.com/_ccc5bYdDZJc/TIVVGwYSVjI/AAAAAAAAInY/LlTxplzmV54/s400/1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5513906893339383346" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We can try using DATEDIFF to eliminate the time in the column:&lt;br /&gt;&lt;pre name="code" class="sql"&gt;SELECT *&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE DATEDIFF(day,MyDate,@myNow)=0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This will get the exact result, but, using a function over the 'MyDate' column causes the sql server to scan the entire index!!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_ccc5bYdDZJc/TIVVYh6tPtI/AAAAAAAAIng/78rfhC7PEPo/s1600/2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 94px;" src="http://3.bp.blogspot.com/_ccc5bYdDZJc/TIVVYh6tPtI/AAAAAAAAIng/78rfhC7PEPo/s400/2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5513907198694866642" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the column does not contain time, we can eliminate the time in the '@myNow' parameter:&lt;br /&gt;&lt;pre name="code" class="sql"&gt;DECLARE @myNowNoTime DATETIME&lt;br /&gt;&lt;br /&gt;SET @myNowNoTime = dateadd(dd,datediff(dd,0,GETDATE()),0)&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE MyDate = @myNowNoTime&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This will also perform well as the 1st query, but again...what if 'myDate' column contains time??&lt;br /&gt;&lt;br /&gt;The solution is to avoid doing functions (like DATEDIFF, DATEADD or any user defined function) over 'MyDate' column.&lt;br /&gt;&lt;br /&gt;The solution is very simple - date range.&lt;br /&gt;First I've created two functions that one returns the begining of the day (time will be '00:00:00') and the other the end of the day (time will be 23:59:59:997)&lt;br /&gt;&lt;pre name="code" class="sql"&gt;CREATE FUNCTION [dbo].[fnGetBeginOfDay]&lt;br /&gt;(@myDate DATETIME)&lt;br /&gt;RETURNS DATETIME&lt;br /&gt;BEGIN&lt;br /&gt;RETURN CAST(FLOOR(CAST(@myDate AS DECIMAL(12, 5))) AS DATETIME)&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE FUNCTION [dbo].[fnGetEndOfDay]&lt;br /&gt;(@myDate DATETIME )&lt;br /&gt;RETURNS DATETIME&lt;br /&gt;BEGIN&lt;br /&gt;RETURN DATEADD(ms, -3, DATEADD(day, 1, (dbo.fnGetBeginOfDay(@myDate))))&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Than the query will look like this:&lt;br /&gt;&lt;pre name="code" class="sql"&gt;DECLARE @beginOfDay DATETIME, @endOfDay DATETIME&lt;br /&gt;SET @beginOfDay = dbo.fnGetBeginOfDay(GETDATE())&lt;br /&gt;SET @endOfDay = dbo.fnGetEndOfDay(GETDATE())&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates with (index(idx_MyDate))&lt;br /&gt;WHERE &lt;b&gt;MyDate BETWEEN @beginOfDay AND @endOfDay&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the execution plan looks like this, back to the wonderfull 'index seek' and returns the expected amount of rows:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_ccc5bYdDZJc/TIVV3hsBc3I/AAAAAAAAIno/bzVy3nLjyPo/s1600/3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 203px;" src="http://3.bp.blogspot.com/_ccc5bYdDZJc/TIVV3hsBc3I/AAAAAAAAIno/bzVy3nLjyPo/s400/3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5513907731209220978" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Additional facts:&lt;br /&gt;1. Testing the same queries with &lt;b&gt;NONCLUSTERED&lt;/b&gt; index shows that the date range solution is as bad as DATEDIFF - both result with &lt;b&gt;table scan&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;2. Adding to (1) a table hint (with(index(idx_MyDate))) to both queries shows that while datediff uses 'index scan', date range uses 'index seek' (which is obviously better).&lt;br /&gt;&lt;br /&gt;Conclusions:&lt;br /&gt;&lt;br /&gt;1. When querying using a date column which is included in an index - use 'date range' solution.&lt;br /&gt;&lt;br /&gt;2. If the index is nonclustered - check if a table hint makes the difference.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Till next time....&lt;br /&gt;Diego&lt;br /&gt;&lt;br /&gt;Full sample test source code: &lt;br /&gt;&lt;pre name="code" class="sql"&gt;--fill table with random dates&lt;br /&gt;CREATE TABLE #CompareDates (Id int identity(1,1), MyDate DATETIME)&lt;br /&gt;&lt;br /&gt;DECLARE @myNow DATETIME&lt;br /&gt;SET @myNow = '2010-09-06 22:47'&lt;br /&gt;DECLARE @i int, @myDate DATETIME&lt;br /&gt;SET @i = 0&lt;br /&gt;&lt;br /&gt;WHILE @i &lt; 10000&lt;br /&gt;BEGIN&lt;br /&gt;--random date (10x to &lt;a href="http://www.bennadel.com/blog/310-Ask-Ben-Getting-A-Random-Date-From-A-Date-Range-In-SQL.htm"&gt;Ben Nadel&lt;/a&gt; for the useful &amp; short function :-)&lt;br /&gt;SET @myDate = CAST(CAST( @myNow AS INT ) -5 * RAND( CAST( CAST( NEWID() AS BINARY(8) ) AS INT ) )AS DATETIME)&lt;br /&gt;&lt;br /&gt;INSERT INTO #CompareDates (MyDate)&lt;br /&gt;SELECT @myDate&lt;br /&gt;SET @i=@i+1&lt;br /&gt;&lt;br /&gt;IF @i=500&lt;br /&gt;INSERT INTO #CompareDates (MyDate) VALUES(@myNow)&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;CREATE CLUSTERED INDEX idx_MyDate ON #CompareDates(MyDate)&lt;br /&gt;&lt;br /&gt;SELECT * FROM #CompareDates&lt;br /&gt;&lt;br /&gt;-----TESTING:&lt;br /&gt;&lt;br /&gt;--fast, looks for specific date including time, not quite we are looking for..&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE MyDate = @myNow&lt;br /&gt;&lt;br /&gt;--exact results, scans entire index&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE DATEDIFF(day,MyDate,@myNow)=0&lt;br /&gt;&lt;br /&gt;--if the column does not contain time, you can eliminate time in the parameter&lt;br /&gt;DECLARE @myNowNoTime DATETIME&lt;br /&gt;SET @myNowNoTime = dateadd(dd,datediff(dd,0,@myNow),0)&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates&lt;br /&gt;WHERE MyDate = @myNowNoTime&lt;br /&gt;&lt;br /&gt;--if column contains time, use range&lt;br /&gt;DECLARE @beginOfDay DATETIME, @endOfDay DATETIME&lt;br /&gt;SET @beginOfDay = dbo.fnGetBeginOfDay(@myNow)&lt;br /&gt;SET @endOfDay = dbo.fnGetEndOfDay(@myNow)&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM #CompareDates with (index(idx_MyDate))&lt;br /&gt;WHERE MyDate BETWEEN @beginOfDay AND @endOfDay&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-1214395498376969042?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/1214395498376969042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/09/sql-server-performance-querying-by-date.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1214395498376969042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1214395498376969042'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/09/sql-server-performance-querying-by-date.html' title='SQL Server performance - querying by date'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ccc5bYdDZJc/TIVVGwYSVjI/AAAAAAAAInY/LlTxplzmV54/s72-c/1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-39936436252848155</id><published>2010-07-29T15:52:00.010+03:00</published><updated>2010-07-29T17:05:51.477+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='TWAIN'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='WIA'/><title type='text'>Scanning images using WIA and TWAIN</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;The development of windows imaging applications requires choosing an API to communicate with scanner s or cameras. The most used APIs are WIA and TWAIN.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;The &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;WIA &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;(Windows Image Acquisition) platform enables imaging/graphics applications to interact with imaging hardware and standardizes the interaction between different applications and scanners. This allows those different applications to talk to and interact with those different scanners without requiring the application writers and scanner manufactures to customize their application or drivers for each application-device combination.  (&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms630368(VS.85).aspx"&gt;&lt;span class="Apple-style-span"&gt;http://msdn.microsoft.com/en-us/library/ms630368(VS.85).aspx&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;TWAIN &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;is a standard software protocol and applications programming interface (API) that regulates communication between software applications and imaging devices such as scanners and digital cameras.  (&lt;/span&gt;&lt;a href="http://www.twain.org/"&gt;&lt;span class="Apple-style-span"&gt;http://www.twain.org/&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Differences:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. WIA uses a common dialog for all devices while TWAIN uses a dialog created by the&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;device manufacturer.  Practically speaking, this almost always means that the TWAIN&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;dialog will provide more options and advanced control over the device.&lt;/div&gt;&lt;div&gt;2. TWAIN allows you to use custom capabilities that the device manufacturer has created&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;even though they don't exist in the TWAIN specifications.&lt;/div&gt;&lt;div&gt;3. In general, when a device supports both Twain and WIA, TWAIN is better for scanners&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;and WIA is better for acquiring images from cameras and video devices.&lt;/div&gt;&lt;div&gt;4. TWAIN has three transfer modes (Native, Memory, File) and WIA only has two&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;(Memory, File).&lt;/div&gt;&lt;div&gt;5. Most TWAIN sources save the settings of the previous scan while WIA does not.&lt;/div&gt;&lt;div&gt;6. TWAIN supports options for each page when scanning in duplex mode but WIA uses the&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;same settings for both sides.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large; "&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Problem&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Usually, older scanners (drivers) are build for TWAIN and does not supported by WIA platform, moreover newer devices which created under Microsoft standard does not supported by TWAIN API.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;span class="Apple-style-span"&gt;Solution &lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: small; "&gt;&lt;a href="http://sites.google.com/site/eduardfilefepositore/TwainGui.zip?attredirects=0"&gt;Full Source Download&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;In order to build scanning application that will communicate with both types of devices I combined those APIs under a uniform interface which will provide the easy access to both type of devices.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_qgTpY2Nr3-Q/TFF3zuWrRXI/AAAAAAAAABQ/rLYV1dfo92Q/s400/diagram.JPG" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 204px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5499308350496261490" /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;ScannerAdapterBase&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;public abstract class ScannerAdapterBase&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;protected List&amp;lt;Image&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small; "&gt; m_ImagesList = null;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;protected ScannerDeviceData m_ScannerDeviceData = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// Initializes the Adapter&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public abstract void InitAdapter(nessScanning control, IMessageFilter messageFilter, IntPtr &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;handle);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// Selects scanning device, and returns the indicator that the device selected&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// Returns the indicator that the device selected&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public abstract bool SelectDevice();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// Acquires images from scanning device and fills ImagesLis&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public abstract void AcquireImages(bool showUI);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;…&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Factory Method&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;public static ScannerAdapterBase GetScannerAdapter(nessScanning control, IMessageFilter messageFilter, IntPtr handle)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;lock (locker)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;bool isTwainDeviceSelected = false;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (m_ScannerAdapterBase != null)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return m_ScannerAdapterBase;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//Checks WIA Devices&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;m_ScannerAdapterBase = new WiaScannerAdapter();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;m_ScannerAdapterBase.InitAdapter(control, messageFilter, handle);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;isWiaDeviceSelected = m_ScannerAdapterBase.SelectDevice();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if (isWiaDeviceSelected)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;return m_ScannerAdapterBase;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//Checks TWAIN Devices&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;m_ScannerAdapterBase = new TwainScannerAdapter();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;m_ScannerAdapterBase.InitAdapter(control, messageFilter, handle);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;isTwainDeviceSelected = m_ScannerAdapterBase.SelectDevice();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if (isTwainDeviceSelected)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;return m_ScannerAdapterBase;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;catch (ScannerException ex)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;throw ex;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return null;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Wia Adapter &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;AcquireImages&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"&gt; method&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small; "&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;public override void AcquireImages(bool showUI)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CommonDialogClass wiaCommonDialog = new CommonDialogClass();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//Select Device&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if (m_DeviceID == null)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;Device device = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;device = wiaCommonDialog.ShowSelectDevice(WiaDeviceType.ScannerDeviceType, &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;false, false);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if (device != null)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;m_DeviceID = device.DeviceID;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;FillDeviceData(device);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;return;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;catch (COMException ex)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if ((WiaScannerError)ex.ErrorCode == WiaScannerError.ScannerNotAvailable)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;return;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;WiaScannerException se = BuildScannerException(device, ex);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;throw se;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//Create DeviceManager&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;DeviceManager manager = new DeviceManagerClass();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Device WiaDev = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;foreach (DeviceInfo info in manager.DeviceInfos)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (info.DeviceID == m_DeviceID)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;WIA.Properties infoprop = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;infoprop = info.Properties;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//connect to scanner&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;WiaDev = info.Connect();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//Get Scanning Properties&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;WIA.Item scanningItem = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;WIA.Items items = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if (showUI)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;items = wiaCommonDialog.ShowSelectItems(WiaDev, WiaImageIntent.TextIntent, &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;WiaImageBias.MinimizeSize, false, true, false);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;items = WiaDev.Items;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if (items != null &amp;amp;&amp;amp; items.Count &gt; 0)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;scanningItem = items[1] as WIA.Item;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;WIA.ImageFile imgFile = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;WIA.Item item = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//Prepare ImagesList&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if (m_ImagesList == null)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;m_ImagesList = new List&amp;lt;Image&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small; "&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//Start Scan&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;while (HasMorePages(WiaDev))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;item = scanningItem;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//Scan Image&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;imgFile = (ImageFile)wiaCommonDialog.ShowTransfer(item, &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;ImageFormat.Jpeg.Guid.ToString("B")/* wiaFormatJPEG*/, false);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;byte[] buffer = (byte[])imgFile.FileData.get_BinaryData();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;MemoryStream ms = new MemoryStream(buffer);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;m_ImagesList.Add(Image.FromStream(ms));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;imgFile = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;catch (COMException ex)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if ((WiaScannerError)ex.ErrorCode == WiaScannerError.PaperEmpty)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;WiaScannerException se = BuildScannerException(WiaDev, ex);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;throw se;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;WiaScannerException se = BuildScannerException(WiaDev, ex);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;throw se;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;finally&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;item = null;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, serif; "&gt;&lt;span class="Apple-style-span"&gt;Wia Adapter &lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;HasMorePages &lt;/i&gt;method&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;private bool HasMorePages(Device WiaDev)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;try&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;bool hasMorePages = false;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;//determine if there are any more pages waiting&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Property documentHandlingSelect = null;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Property documentHandlingStatus = null;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;foreach (Property prop in WiaDev.Properties)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;documentHandlingSelect = prop;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;                        &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;documentHandlingStatus = prop;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;if (documentHandlingSelect != null) //may not exist on flatbed scanner but required for feeder&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;//check for document feeder&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) &amp;amp; WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) &amp;amp; WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;return hasMorePages;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;catch (COMException ex)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;WiaScannerException se = BuildScannerException(WiaDev, ex);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;throw se;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;TWAIN Adapter &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;AcquireImages&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"&gt; method&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;public ArrayList TransferPictures()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ArrayList pics = new ArrayList();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if (srcds.Id == IntPtr.Zero)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return pics;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;TwRC rc;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;IntPtr hbitmap = IntPtr.Zero;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;TwPendingXfers pxfr = new TwPendingXfers();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;do&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;pxfr.Count = 0;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;hbitmap = IntPtr.Zero;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;TwImageInfo iinf = new TwImageInfo();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;rc = DSiinf(appid, srcds, TwDG.Image, TwDAT.ImageInfo, TwMSG.Get, iinf);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (rc != TwRC.Success)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;CloseSrc();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return pics;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;rc = DSixfer(appid, srcds, TwDG.Image, TwDAT.ImageNativeXfer, TwMSG.Get, ref hbitmap);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (rc != TwRC.XferDone)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;CloseSrc();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return pics;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;rc = DSpxfer(appid, srcds, TwDG.Control, TwDAT.PendingXfers, TwMSG.EndXfer, pxfr);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (rc != TwRC.Success)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;CloseSrc();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return pics;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;pics.Add(hbitmap);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;while (pxfr.Count != 0);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;rc = DSpxfer(appid, srcds, TwDG.Control, TwDAT.PendingXfers, TwMSG.Reset, pxfr);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;return pics;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-39936436252848155?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/39936436252848155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/07/scanning-images-via-wia-and-twain.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/39936436252848155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/39936436252848155'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/07/scanning-images-via-wia-and-twain.html' title='Scanning images using WIA and TWAIN'/><author><name>Eduard</name><uri>http://www.blogger.com/profile/10643815548326591497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qgTpY2Nr3-Q/TFF3zuWrRXI/AAAAAAAAABQ/rLYV1dfo92Q/s72-c/diagram.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-1174193410295589088</id><published>2010-06-28T16:22:00.008+03:00</published><updated>2010-10-18T00:01:51.022+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Compare two object's values</title><content type='html'>Recently we encounter an event that receives two objects and we wanted to compare their values (before and after of a column 'changing' event on a datatable). Using '==' doesn't do the work because the implementation of '==' in object compares the actual reference and not the values.&lt;br /&gt;&lt;br /&gt;This simple method does the work.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="csharp"&gt;static bool CompareObjectsValues(object a, object b)&lt;br /&gt;{&lt;br /&gt;if (a.GetType()!=b.GetType() &lt;br /&gt;|| !(a is IComparable) || !(b is IComparable))&lt;br /&gt;return false;&lt;br /&gt;&lt;br /&gt;IComparable valA = a as IComparable;&lt;br /&gt;IComparable valB = b as IComparable;&lt;br /&gt;&lt;br /&gt;return (valA.CompareTo(valB) == 0);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Full sample to show the problem and test:&lt;br /&gt;&lt;pre name="code" class="csharp"&gt;&lt;br /&gt;static bool Compare(object a, object b)&lt;br /&gt;{&lt;br /&gt;return (a == b);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;object a = new object();&lt;br /&gt;object b = new object();&lt;br /&gt;&lt;br /&gt;DateTime d1 = new DateTime(2010, 6, 27);&lt;br /&gt;DateTime d2 = new DateTime(2010, 6, 27);&lt;br /&gt;&lt;br /&gt;a = d1;&lt;br /&gt;b = d2;&lt;br /&gt;&lt;br /&gt;object c = a;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//returns 'true' -&gt; same reference&lt;br /&gt;Console.WriteLine(Compare(a , c)); &lt;br /&gt;//returns 'false'-&gt; same value but not same reference -&gt; problem&lt;br /&gt;Console.WriteLine(Compare(a , b)); &lt;br /&gt;//returns 'true' -&gt; compares values and not references&lt;br /&gt;Console.WriteLine(CompareObjectsValues(a, b));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's it...&lt;br /&gt;Diego&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-1174193410295589088?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/1174193410295589088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/06/compare-two-objects-values.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1174193410295589088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/1174193410295589088'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/06/compare-two-objects-values.html' title='Compare two object&apos;s values'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-2324384031987198826</id><published>2010-06-17T18:32:00.004+03:00</published><updated>2010-06-17T18:34:06.295+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Working with LayoutEngine</title><content type='html'>&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;When you developing your custom controls sometime it&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;requires a certain behavior or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;graphical representation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&amp;nbsp;of&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;it child controls .&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span title=""&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;In this case you Control have a property called&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;LayoutEngine&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span title=""&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Example below shows you how to implement your&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;LayoutEngine&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;public&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DemoPanel&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;Panel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; m_CustomLayout = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DemoPanelLayout&lt;/span&gt; layoutEngine = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DemoPanelLayout&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; DemoPanel() { }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; CustomLayout&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; m_CustomLayout; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;set&lt;/span&gt; { m_CustomLayout = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;LayoutEngine&lt;/span&gt; LayoutEngine&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;get&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; layoutEngine;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; text-align: left; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Now for the custom&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;LayoutEngine&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;implementation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DemoPanelLayout&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;LayoutEngine&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; Layout(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;object&lt;/span&gt; container,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;LayoutEventArgs&lt;/span&gt; layoutEventArgs)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;Control&lt;/span&gt; parent = container &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Control&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;if&lt;/span&gt; (((parent &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DemoPanel&lt;/span&gt;).CustomLayout))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Rectangle&lt;/span&gt; parentDisplayRectangle = parent.DisplayRectangle;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Point&lt;/span&gt; nextControlLocation = parentDisplayRectangle.Location;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Control&lt;/span&gt; c &lt;span style="color: blue;"&gt;in&lt;/span&gt; parent.Controls)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!c.Visible)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;continue&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (nextControlLocation == parentDisplayRectangle.Location)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nextControlLocation.Y += c.Margin.Top;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nextControlLocation.X += c.Margin.Left;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c.Location = nextControlLocation;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!((c.Location.X + c.Width + c.Margin.Left)&amp;gt; (parent.Width - c.Width-c.Margin.Left)))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nextControlLocation.Offset(c.Width+c.Margin.Left, 0 );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nextControlLocation.X = parent.Left+c.Margin.Left;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nextControlLocation.Offset(0,c.Height+c.Margin.Top);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; 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: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; mso-layout-grid-align: none; text-align: left; text-autospace: none; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" dir="LTR" style="direction: ltr; text-align: left; unicode-bidi: embed;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;In example above DemoPanel's &lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;LayoutEngine &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;will check the CustomLayout property&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;and order child controls as tabled view .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ukmYE2QwGhI/TBo_tAXLzlI/AAAAAAAACCU/zrtxdFKXk0Y/s1600/step6.bmp" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_ukmYE2QwGhI/TBo_tAXLzlI/AAAAAAAACCU/zrtxdFKXk0Y/s320/step6.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-2324384031987198826?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/2324384031987198826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/06/working-with-layoutengine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2324384031987198826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2324384031987198826'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/06/working-with-layoutengine.html' title='Working with LayoutEngine'/><author><name>Albert Yacobov</name><uri>http://www.blogger.com/profile/08845815836896170689</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://bp2.blogger.com/_ukmYE2QwGhI/SDxTZ1gVGsI/AAAAAAAAArc/nRtipyNbQH0/S220/IMG_0091_new.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ukmYE2QwGhI/TBo_tAXLzlI/AAAAAAAACCU/zrtxdFKXk0Y/s72-c/step6.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-2357842608245322621</id><published>2010-06-15T11:13:00.010+03:00</published><updated>2010-06-15T11:58:58.282+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2005'/><title type='text'>Paging in SQL 2005</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span title=""&gt;Suppose that you need to reduce the load of traffic between the Microsoft SQL 2005 DB&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span title=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span title=""&gt;and application&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span title=""&gt;in case of&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span style="background-color: white;" title=""&gt;client \ server application also reduce the load of traffic between&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span style="background-color: white;" title=""&gt;client and application server.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;One of the known methods is Paging .&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span title=""&gt;In a simple example below, I'll show you how to&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;"&gt;implement&amp;nbsp;&lt;/span&gt;Paging&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&amp;nbsp;method at&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;SQL 2005&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; line-height: 22px;"&gt;server side.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;Create and fill temporary table&amp;nbsp;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;#someTable &lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;for example :&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;create table&lt;/span&gt; #someTable(RecordKey &lt;span class="Apple-style-span" style="color: blue;"&gt;int&lt;/span&gt;,FieldA &lt;span class="Apple-style-span" style="color: blue;"&gt;int&lt;/span&gt;, FieldB &lt;span class="Apple-style-span" style="color: blue;"&gt;nvarchar&lt;/span&gt;(50))&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;insert into&lt;/span&gt; #someTable(RecordKey,FieldA , FieldB)&lt;span class="Apple-style-span" style="color: blue;"&gt;values&lt;/span&gt;(1,5,'a')&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;insert into&lt;/span&gt;&amp;nbsp;#someTable(RecordKey,FieldA , FieldB)&lt;span class="Apple-style-span" style="color: blue;"&gt;values&lt;/span&gt;(2,4,'ab')&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;insert into&lt;/span&gt;&amp;nbsp;#someTable(RecordKey,FieldA , FieldB)&lt;span class="Apple-style-span" style="color: blue;"&gt;values&lt;/span&gt;(3,3,'abc')&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;insert into&lt;/span&gt;&amp;nbsp;#someTable(RecordKey,FieldA , FieldB)&lt;span class="Apple-style-span" style="color: blue;"&gt;values&lt;/span&gt;(4,2,'abcd')&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;We'll use &lt;i&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;page size&lt;/span&gt;&lt;/i&gt;=2 ,&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;FieldA&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;as&amp;nbsp;sort field and &amp;nbsp;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;page number&lt;/span&gt;&lt;/i&gt;&amp;nbsp;= 1&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE &lt;/span&gt;@PageSize &lt;span class="Apple-style-span" style="color: blue;"&gt;INT&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE&lt;/span&gt; @RequestPageNumber &lt;span class="Apple-style-span" style="color: blue;"&gt;INT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;set &lt;/span&gt;@RequestPageNumber = 1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;set &lt;/span&gt;@PageSize = 2&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE&amp;nbsp;&lt;/span&gt;&amp;nbsp;@FromKey&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;INT&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE&amp;nbsp;&lt;/span&gt;@ToKey&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;INT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;set&amp;nbsp;&lt;/span&gt;@ToKey = (@PageSize * @RequestPageNumber)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;set&amp;nbsp;&lt;/span&gt;@FromKey = @ToKey - @PageSize + 1;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                &lt;/span&gt;;&lt;span class="Apple-style-span" style="color: blue;"&gt;WITH &lt;/span&gt;SortedTable &lt;span class="Apple-style-span" style="color: blue;"&gt;As&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                      &lt;/span&gt;(&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                       &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ROW_NUMBER() &lt;span class="Apple-style-span" style="color: blue;"&gt;OVER &lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;ORDER BY&lt;/span&gt; FieldA) as RowNumber,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RecordKey,&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                        &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; FieldA,&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                        &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; FieldB&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                       &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM &lt;/span&gt;#someTable&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RecordKey,&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                        &lt;/span&gt; &amp;nbsp; FieldA,&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                        &lt;/span&gt; &amp;nbsp; FieldB&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;FROM &lt;/span&gt;SortedTable&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                       &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;WHERE&lt;/span&gt; RowNumber &lt;span class="Apple-style-span" style="color: #666666;"&gt;BETWEEN &lt;/span&gt;@FromKey &lt;span class="Apple-style-span" style="color: #666666;"&gt;AND &lt;/span&gt;@ToKey&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The result as you can see two rows sorted by FieldA :&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_ukmYE2QwGhI/TBc06SkAkMI/AAAAAAAACCM/7ohzvG4LucU/s1600/step5.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_ukmYE2QwGhI/TBc06SkAkMI/AAAAAAAACCM/7ohzvG4LucU/s320/step5.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The example showed us the MS SQL 2005 server side implementation of paging&amp;nbsp;technique&lt;br /&gt;the application server/client paging techniques is&amp;nbsp;another post issue ,but the common idea&lt;br /&gt;identical to this one that implemented here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-2357842608245322621?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/2357842608245322621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/06/paging-in-sql-2005.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2357842608245322621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/2357842608245322621'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/06/paging-in-sql-2005.html' title='Paging in SQL 2005'/><author><name>Albert Yacobov</name><uri>http://www.blogger.com/profile/08845815836896170689</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://bp2.blogger.com/_ukmYE2QwGhI/SDxTZ1gVGsI/AAAAAAAAArc/nRtipyNbQH0/S220/IMG_0091_new.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ukmYE2QwGhI/TBc06SkAkMI/AAAAAAAACCM/7ohzvG4LucU/s72-c/step5.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-4597206843937934981</id><published>2010-06-13T12:02:00.005+03:00</published><updated>2010-06-13T12:19:59.429+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vb6'/><category scheme='http://www.blogger.com/atom/ns#' term='COM Interop'/><category scheme='http://www.blogger.com/atom/ns#' term='COM'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Simple example of how to expose .net controls to VB6</title><content type='html'>There's already a lot of discussions on iNet on this theme i'll just show you on simple&lt;br /&gt;example how&amp;nbsp;to expose your .Net Controls as COM to other development&lt;br /&gt;environment (in our case VB6 as example).&lt;br /&gt;&lt;br /&gt;Create your control library and make it com visible as in picture below&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_ukmYE2QwGhI/TBSZyHxprfI/AAAAAAAACBs/xMHY32DBxrY/s1600/step2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="432" src="http://4.bp.blogspot.com/_ukmYE2QwGhI/TBSZyHxprfI/AAAAAAAACBs/xMHY32DBxrY/s640/step2.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Because we do not have setup for now and for test we should register our library as COM&lt;br /&gt;check the register for COM option to register it&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_ukmYE2QwGhI/TBSaYqa59EI/AAAAAAAACB0/5u_Z6_xkIBs/s1600/step3.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_ukmYE2QwGhI/TBSaYqa59EI/AAAAAAAACB0/5u_Z6_xkIBs/s400/step3.bmp" width="382" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Create some control and make it com visible also give it a ProgId to expose it to out world&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_ukmYE2QwGhI/TBSaxPvG6PI/AAAAAAAACB8/gfOFG6WhDeE/s1600/step1.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="392" src="http://1.bp.blogspot.com/_ukmYE2QwGhI/TBSaxPvG6PI/AAAAAAAACB8/gfOFG6WhDeE/s640/step1.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Build the project and let test our control in VB6&lt;br /&gt;Create new vb6 exe project . To add our control&amp;nbsp;dynamically onto the form we will use&lt;br /&gt;the &lt;i&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;VBControlExtender&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;and code looks like that :&lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Option Explicit&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Dim WithEvent&lt;/span&gt;s objExt &lt;span class="Apple-style-span" style="color: blue;"&gt;As &lt;/span&gt;VBControlExtender&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Private Sub&lt;/span&gt; Form_Load()&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'adding our control licens to licences collection&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Licenses.Add "InteropControlLib.DotNetControl", "ewrinvcmcoe"&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'adding the control to Form&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;Set &lt;/span&gt;objExt = Me.Controls.Add("InteropControlLib.DotNetControl", "DotNetControl1", Me)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objExt.Visible = &lt;span class="Apple-style-span" style="color: blue;"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; End Sub&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Run the test project and wuala,&amp;nbsp;you got .net control on vb6 form :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_ukmYE2QwGhI/TBSc-7S5kPI/AAAAAAAACCE/SBbtsSVdyO4/s1600/step4.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="456" src="http://3.bp.blogspot.com/_ukmYE2QwGhI/TBSc-7S5kPI/AAAAAAAACCE/SBbtsSVdyO4/s640/step4.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Those of you who found this article interesting and want to find more&lt;br /&gt;check out links below :&lt;br /&gt;&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/e7a79b4y(VS.80).aspx"&gt;COM Interoperability in .NET Framework Applications&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/6bw51z5z(VS.80).aspx"&gt;COM Interop&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-4597206843937934981?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/4597206843937934981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/06/simple-example-of-how-to-expose-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4597206843937934981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/4597206843937934981'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/06/simple-example-of-how-to-expose-net.html' title='Simple example of how to expose .net controls to VB6'/><author><name>Albert Yacobov</name><uri>http://www.blogger.com/profile/08845815836896170689</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://bp2.blogger.com/_ukmYE2QwGhI/SDxTZ1gVGsI/AAAAAAAAArc/nRtipyNbQH0/S220/IMG_0091_new.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ukmYE2QwGhI/TBSZyHxprfI/AAAAAAAACBs/xMHY32DBxrY/s72-c/step2.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-754792273085158980</id><published>2010-06-10T13:26:00.019+03:00</published><updated>2010-06-11T15:05:25.752+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Batch'/><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='DTS'/><category scheme='http://www.blogger.com/atom/ns#' term='T SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Executing dtsx on Microsoft SQL 2005 Express with schedule</title><content type='html'>Let say you need to run scheduled DTS package on Microsoft SQL 2005 Express and  &lt;br /&gt;as you probably know there is no SSIS and Agent Services in Microsoft SQL 2005 Express  &lt;br /&gt;edition but you can do this job actually very easy :  &lt;br /&gt;&lt;br /&gt;&lt;b&gt;1&lt;/b&gt;.&lt;br /&gt;&amp;nbsp;&amp;nbsp; Assure that you do have the &lt;a href="http://msdn.microsoft.com/en-us/library/ms162810.aspx"&gt;DTExec util&lt;/a&gt;, it should be in  &lt;br /&gt;&amp;nbsp;&amp;nbsp; C:\Program Files\Microsoft SQL Server\90\DTS\Binn folder ,  &lt;br /&gt;&amp;nbsp;&amp;nbsp; if you do not have one means you should install &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3c856b93-369f-4c6f-9357-c35384179543&amp;amp;displaylang=en"&gt;SQL Toolkit&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2&lt;/b&gt;.&lt;br /&gt;&amp;nbsp;&amp;nbsp; Next step is to make a batch file to run the DTS package.  &lt;br /&gt;&amp;nbsp;&amp;nbsp; Create batch file with DTExec formatted command for example  &lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setlocal&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Set upPath=[Some folder path where you have your package or whatever ]  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Set logFileName=DTS_Batch_Log  &lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cd "C:\Program Files\Microsoft SQL Server\90\DTS\Binn"  &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set startDate=%date%&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set startTime=%time%&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set sdy=%startDate:~10,4%&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set sdm=%startDate:~4,2%&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set sdd=%startDate:~7,2%&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set sth=%startTime:~0,2%&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set stm=%startTime:~3,2%&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;set sts=%startTime:~6,2%&amp;nbsp;0&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DTExec.exe /F "%upPath%\DTS\[MyDTSName].dtsx"  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/MAXCONCURRENT " -1 " /CHECKPOINTING OFF  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/SET "\Package.Variables[My DTS Variable name].Value";&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"[Here is comes the My DTS Variable &amp;nbsp;value]"  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt;&amp;gt; "%upPath%\%logFileName%_%sdy%.%sdm%.%sdd%-%sth%.%stm%.log"  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF %ERRORLEVEL% == 0 GOTO [Some label ] ELSE GOTO End  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: Some label&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt; your code comes here&lt;/i&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: End  &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&amp;nbsp;&amp;nbsp; The example above shows how to run DTSX Package from File and Log  &lt;br /&gt;&amp;nbsp;&amp;nbsp; the results of execution to some log file.  &lt;br /&gt;&lt;br /&gt;&lt;b&gt;3&lt;/b&gt;.&lt;br /&gt;&amp;nbsp;&amp;nbsp; Last step is schedule and Yes there is one in Windows it called " Scheduled  &lt;br /&gt;&amp;nbsp;&amp;nbsp; Tasks" you could find it in System Tools – just create one with call of the batch  &lt;br /&gt;&amp;nbsp;&amp;nbsp; that you created earlier to run dtsx packages.  &lt;br /&gt;&lt;br /&gt;And that's all you need for the job to be done ;)...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-754792273085158980?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/754792273085158980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/06/how-to-run-dtsx-on-microsoft-sql-2005.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/754792273085158980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/754792273085158980'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/06/how-to-run-dtsx-on-microsoft-sql-2005.html' title='Executing dtsx on Microsoft SQL 2005 Express with schedule'/><author><name>Albert Yacobov</name><uri>http://www.blogger.com/profile/08845815836896170689</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://bp2.blogger.com/_ukmYE2QwGhI/SDxTZ1gVGsI/AAAAAAAAArc/nRtipyNbQH0/S220/IMG_0091_new.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-3099768063604569448</id><published>2010-06-07T16:00:00.003+03:00</published><updated>2010-10-18T00:05:58.794+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLBroker'/><category scheme='http://www.blogger.com/atom/ns#' term='T SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SqlBroker clean up</title><content type='html'>Testing SqlBroker for the 1st time outside the development environment I realized I did not define the Authorization attribute when creating the objects (messagetype, contract &amp; services) see &lt;a href="http://diegworld.blogspot.com/2010/03/asynchronous-triggers-using-sql-broker.html"&gt;Asynchronous triggers using SQL Broker&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;This mistake filled the queue with over 300,000 messages that were not going anywhere even after I fixed the Authorization.&lt;br /&gt;&lt;br /&gt;Good thing I found this on test environment which allowed me to run a short script that cleans up those messages without worrying about the consequences.&lt;br /&gt;&lt;br /&gt;BTW, if you were thinking of dropping the objects and rebuild them...tried that - got a weird out of memory message from SQL Server.&lt;br /&gt;&lt;br /&gt;Here is the script:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;declare @conversation uniqueidentifier&lt;br /&gt;&lt;br /&gt;while exists (select 1 from sys.transmission_queue )&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;set @conversation = (select top 1 conversation_handle from sys.transmission_queue )&lt;br /&gt;&lt;br /&gt;end conversation @conversation with cleanup&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Till next time...&lt;br /&gt;Diego&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4545163587452304025-3099768063604569448?l=diegworld.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://diegworld.blogspot.com/feeds/3099768063604569448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://diegworld.blogspot.com/2010/06/sqlbroker-clean-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/3099768063604569448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4545163587452304025/posts/default/3099768063604569448'/><link rel='alternate' type='text/html' href='http://diegworld.blogspot.com/2010/06/sqlbroker-clean-up.html' title='SqlBroker clean up'/><author><name>Dieg</name><uri>http://www.blogger.com/profile/15977769850127757216</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-Lp3RbL-3rmc/Tl0syOkBrVI/AAAAAAAAKTE/VVFGf1ZHOBE/s220/small2371.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4545163587452304025.post-3443228910371169835</id><published>2010-05-03T14:06:00.020+03:00</published><updated>2010-06-13T10:44:47.973+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='T SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='PIVOT'/><title type='text'>Pivot in SQL Server 2005</title><content type='html'>&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; text-align:right; direction:rtl; unicode-bidi:embed; font-size:12.0pt; font-family:"Times New Roman";}a:link, span.MsoHyperlink {color:blue; text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;}@page Section1 {size:612.0pt 792.0pt; margin:72.0pt 171.0pt 72.0pt 90.0pt;}div.Section1 {page:Section1;}--&gt;&lt;/style&gt; &lt;br /&gt;A pivot is a&amp;nbsp; method of grouping and displaying&amp;nbsp;&amp;nbsp; data by means of aggregating values -&lt;br /&gt;&lt;div class="Section1"&gt;in&amp;nbsp; simple words , present one table-valued expression into another table. &lt;br /&gt;Let see what that means in the example below. &lt;br /&gt;&lt;br /&gt;Table &lt;i&gt;&lt;span class="Apple-style-span" style="color: #666666;"&gt;#tmpBeforePivot&lt;/span&gt;&lt;/i&gt; representing table of transactions ,&lt;br /&gt;the&amp;nbsp;purpose is to get the transactions summary by each month of year in one row for&lt;br /&gt;each policy .&lt;br /&gt;You could use the &lt;span style="color: blue;"&gt;case&lt;/span&gt; statement but within sql&amp;nbsp;2005 you got the pivot statement .&lt;br /&gt;&lt;br /&gt;We will fill&amp;nbsp;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;#tmpBeforePivot&lt;/span&gt;&lt;/i&gt;&amp;nbsp;with dummy data :&lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;create&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;br /&gt;&lt;span style="color: blue;"&gt;table&lt;/span&gt; #tmpBeforePivot&lt;span style="color: grey;"&gt;(&lt;/span&gt;PolicyKey &lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt;[ValueDate] &lt;span style="color: blue;"&gt;datetime&lt;/span&gt;&lt;span style="color: grey;"&gt;,&lt;/span&gt;Amount&amp;nbsp; &lt;spanstyle='color:blue'&gt;decimal&lt;/spanstyle='color:blue'&gt;&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;18&lt;spanstyle='color:gray'&gt;,2&lt;span style="color: grey;"&gt;))&lt;/span&gt; &lt;br /&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;insert&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;into&lt;/span&gt; #tmpBeforePivot&lt;span style="color: grey;"&gt;(&lt;/span&gt;PolicyKey&lt;spanstyle='color:gray'&gt;,&lt;/spanstyle='color:gray'&gt;&lt;/span&gt;[ValueDate]&lt;span style="color: grey;"&gt;,&lt;/span&gt;Amount&lt;spanstyle='color:gray'&gt;) &lt;span style="color: blue;"&gt;values&lt;/span&gt;&lt;spanstyle='color:gray'&gt;(1&lt;span style="color: grey;"&gt;,&lt;/span&gt;&lt;spanstyle='color:red'&gt;'2009-01-23'&lt;span style="color: grey;"&gt;,&lt;/span&gt;1243.00&lt;spanstyle='color:gray'&gt;) &lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New'; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New'; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; and so on ...&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/div&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;br /&gt;And now for the pivot ....&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;br /&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;For each month declare in select statement ,column that represent month of year .&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;The alias such as "Jan","Feb","March"… is for your discretion but columns within [] should &lt;br /&gt;be the same as excepted key in our example Month of year from 1 to 12 . &lt;br /&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;div style="background: #F4F5F7 url(http://s61.photobucket.com/albums/h59/c_stavanger/inove/blockquote.gif) no-repeat; border: 1px dashed #CCC; font-family: Arial; font-size: small;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PolicyKey&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: grey;"&gt;,&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [1] &amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; Jan&lt;span class="Apple-style-span" style="color: grey;"&gt;,&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [2] &amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; Feb&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="color: grey; font-family: 'Courier New'; font-size: 13px;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;[3]&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/span&gt;&amp;nbsp;March&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="color: grey; font-family: 'Courier New'; font-size: 13px;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;span style="color: grey;"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;spanstyle='color:blue'&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;[4]&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/span&gt;&amp;nbsp;April&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: grey;"&gt;,&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [5] &amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; May&lt;span class="Apple-style-span" style="color: grey;"&gt;,&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [6] &amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; June&lt;span style="color: grey;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span style="color: grey;"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;[7] &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;Jule&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="color: grey; font-family: 'Courier New'; font-size: 13px;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;span style="color: grey;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;[8]&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;August&lt;span class="Apple-style-span" style="color: grey; font-family: 'Courier New'; font-size: 13px;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:blue'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;[&lt;/span&gt;9] &amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; September&lt;span style="color: grey;"&gt;,&lt;/span&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;[10] &lt;span style="color: blue;"&gt;AS&lt;/span&gt; November&lt;span style="color: grey;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:blue'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span style="color: grey;"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;[11]&amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&amp;nbsp;October&lt;span style="color: grey;"&gt;,&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;[12]&amp;nbsp;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&amp;nbsp;December&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt; &lt;br /&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;FROM&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;spanstyle='color:gray'&gt;(&lt;/spanstyle='color:gray'&gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;spanstyle='color:blue'&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&lt;/spanstyle='color:blue'&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &lt;/span&gt;[PolicyKey]&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: grey;"&gt;,&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;span style="color: magenta;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;month&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;[ValueDate]&lt;spanstyle='color:gray'&gt;)&lt;/spanstyle='color:gray'&gt;&lt;/span&gt; &lt;span style="color: blue;"&gt;as&lt;/span&gt; ValueDateMonth&lt;spanstyle='color:gray'&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: grey;"&gt;,&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Amount&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;FROM&lt;/span&gt; #tmpBeforePivot&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;/span&gt; &lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;spanstyle='color:gray'&gt;&amp;nbsp;)&lt;/spanstyle='color:gray'&gt;&lt;/span&gt; p&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:gray'&gt; &lt;span style="font-family: 'Courier New'; 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;&amp;nbsp;&lt;spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;PIVOT&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;spanstyle='color:gray'&gt;(&lt;/spanstyle='color:gray'&gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;spanstyle='color:fuchsia'&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: magenta;"&gt;sum&lt;/span&gt;&lt;/spanstyle='color:fuchsia'&gt;&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;Amount&lt;spanstyle='color:gray'&gt;)&amp;nbsp;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt; &lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;spanstyle='color:blue'&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;FOR&lt;/span&gt;&lt;/spanstyle='color:blue'&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt; &lt;/span&gt;ValueDateMonth &lt;span style="color: grey;"&gt;IN&lt;/span&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:blue'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt; &lt;span style="color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:blue'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:red'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;(&lt;/span&gt;[1]&lt;span style="color: grey;"&gt;,&lt;/span&gt;[2]&lt;span style="color: grey;"&gt;,&lt;/span&gt;[3]&lt;spanstyle='color:gray'&gt;,[4]&lt;span style="color: grey;"&gt;,&lt;/span&gt;[5]&lt;spanstyle='color:gray'&gt;,[6]&lt;span style="color: grey;"&gt;,&lt;/span&gt;[7]&lt;spanstyle='color:gray'&gt;,[8]&lt;span style="color: grey;"&gt;,&lt;/span&gt;[9]&lt;spanstyle='color:gray'&gt;,[10]&lt;span style="color: grey;"&gt;,&lt;/span&gt;[11]&lt;spanstyle='color:gray'&gt;,[12]&lt;span style="color: grey;"&gt;)&lt;/span&gt; &lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;/spanstyle='color:gray'&gt;&lt;br /&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:red'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='color:gray'&gt;&lt;spanstyle='c
