<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Saveen Reddy's blog</title><subtitle type="html" /><id>http://blogs.msdn.com/saveenr/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/saveenr/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-07-29T09:31:30Z</updated><entry><title>Now on CodePlex – VisioVDX: a library to generate Visio VDX Files (without Visio)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/10/19/now-on-codeplex-visiovdx-a-library-to-generate-visio-vdx-files-without-visio.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/10/19/now-on-codeplex-visiovdx-a-library-to-generate-visio-vdx-files-without-visio.aspx</id><published>2009-10-19T16:49:02Z</published><updated>2009-10-19T16:49:02Z</updated><content type="html">&lt;p&gt;A follow-up to &lt;a href="http://blogs.msdn.com/saveenr/archive/2009/09/30/creating-a-visio-vdx-file-without-using-visio.aspx"&gt;my previous post&lt;/a&gt;, as promised the library is now on CodePlex. You can find it checked in the source tree used by the &lt;a href="http://visioautomation.codeplex.com/"&gt;VisioAutomation&lt;/a&gt; project.&lt;/p&gt;  &lt;p&gt;If you browse the source code you’ll see a separate folder with the VisioVDX code in it.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/NowonCodePlexVisioVDXalibrarytogenerateV_89F3/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/NowonCodePlexVisioVDXalibrarytogenerateV_89F3/image_thumb_1.png" width="934" height="350" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;NOTES&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;The project is in a separate folder from VisioAutomation to help ensure that it takes no dependencies on Visio binaries.&lt;/li&gt;    &lt;li&gt;This is very much *alpha* quality&lt;/li&gt;    &lt;li&gt;Unit tests provide samples of how to use the library&lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9909211" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Creating a Visio VDX File without using Visio</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/09/30/creating-a-visio-vdx-file-without-using-visio.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/09/30/creating-a-visio-vdx-file-without-using-visio.aspx</id><published>2009-09-30T17:07:33Z</published><updated>2009-09-30T17:07:33Z</updated><content type="html">&lt;p&gt;Take a look at this simple Visio diagram&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/CreatingaVisioVDXFilewithoutusingVisio_642B/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/CreatingaVisioVDXFilewithoutusingVisio_642B/image_thumb_1.png" width="1199" height="816" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What separates it from every other document I’ve shown you? it was generated on a machine that &lt;strong&gt;didn’t even have Visio 2007 installed&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;About a year ago in the middle of my work on &lt;a href="http://visioautomation.codeplex.com/"&gt;VisioAutomation&lt;/a&gt; I had written some code to generate VDX files by directly creating XML instead of automating Visio. At the time my goal was to create an ASPX page that could generate Visio charts on demand. &lt;/p&gt;  &lt;p&gt;This mostly worked (for simple diagrams) but had one core limitation – it still required someone to have the Visio Primary Interop Assembly. With the latest code, now there is no connection at all to the PIA – I could, for example, use this code with Mono running on Ubuntu to generate the same file.&lt;/p&gt;  &lt;p&gt;I’ll be creating a new CodePlex project with the source code shortly. Keep in mind just a few things. First, it isn’t magic – it still requires someone to have an understanding of Visio’s shapesheet concept. Second, a lot of the layout smarts have to be replicated – so for example if you want to automatically layout charts you’ll have to use something like MSAGL or GraphViz to place things. Third, to generate the output VDX it requires an input VDX (this is where it gets masters from). &lt;/p&gt;  &lt;p&gt;As a preview, here’s a screenshot of the code from one of my unit tests. You should get a good idea of how this library works from the example below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/CreatingaVisioVDXFilewithoutusingVisio_642B/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/CreatingaVisioVDXFilewithoutusingVisio_642B/image_thumb_2.png" width="903" height="930" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9901312" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Visio: Controlling Visio 2007 via Powershell cmdlets – VisioPS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/09/27/visio-controlling-visio-2007-via-powershell-cmdlets-visiops.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/09/27/visio-controlling-visio-2007-via-powershell-cmdlets-visiops.aspx</id><published>2009-09-28T00:25:01Z</published><updated>2009-09-28T00:25:01Z</updated><content type="html">&lt;p&gt;I just noticed my &lt;a href="http://visioautomation.codeplex.com/"&gt;VisioAutomation library&lt;/a&gt; was mentioned in &lt;a href="http://odeo.com/episodes/25156045-Episode-84-PowerScripting-Podcast-PowerShell-with-Hal-and-Jonathan"&gt;Episode 84 of the PowerScripting Podcast&lt;/a&gt; – And that made me realize there’s very little explaining how to use the VisioPS powershell module. So, for those who are curious I’ve recorded a quick demo on Vimeo.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This demonstration will show you how to get started with the module and show you how to perform some simple tasks.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Link to Video&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.vimeo.com/6783783"&gt;http://www.vimeo.com/6783783&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.vimeo.com/6783783"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/VisioControllingVisio2007viaPowershellcm_CA1B/image_3d2b21aa-f743-430b-ad86-ee1c6de16b4f.png" width="501" height="358" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9900057" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Dynamics AX 2009: Business Intelligence – A more efficient previewing experience with SSRS reports</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/09/17/dynamics-ax-2009-business-intelligence-a-more-efficient-previewing-experience-with-ssrs-reports.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/09/17/dynamics-ax-2009-business-intelligence-a-more-efficient-previewing-experience-with-ssrs-reports.aspx</id><published>2009-09-17T21:24:17Z</published><updated>2009-09-17T21:24:17Z</updated><content type="html">&lt;p&gt;So far, whenever I’ve shown how to develop SSRS reports in Dynamics AX 2009 I’ve always shown the preview and the report model as separate tabs that we have to switch to &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_9ab3d7d5-ecd8-45ea-9b35-2486006971c8.png" width="1280" height="1024" /&gt; &lt;/p&gt;  &lt;p&gt;This is a pit painful because one can’t see changes to the report immediately, one always has to select the Preview tab&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_bde5d231-830b-4147-a6f3-ec789deda481.png" width="376" height="92" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;A BETTER WAY – SEE BOTH AT THE SAME TIME&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;If you have both the report model up and the preview you can see them by right-clicking on one of the tabs and selecting “New Vertical Tab Group”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_0f1d95ee-0fc7-48b1-a72d-13ef7e391ad7.png" width="506" height="309" /&gt; &lt;/p&gt;  &lt;p&gt;Doing so will result in this …&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_6fa2e639-3888-4484-8f98-db7c79cf6adb.png" width="1280" height="1024" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now you can see both at the same time.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;MANAGING TABS AND TAB GROUPS&lt;/h2&gt;  &lt;p&gt;Once you are using tab groups, you’ll notice that you can manage which tabs appear in which groups by right-clicking on a tab &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_2e3146fc-1509-431e-b92d-ff3880a8708f.png" width="296" height="182" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This is useful if you have multiple previews for multiple designs and want to put all the previews into a single tab group.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;HOW TO SEE CHANGES IMMEDIATELY&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;For example, suppose we start of with the preview and the report model both visible&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_c9e56f2f-9d74-460c-982e-1975eec1d743.png" width="1280" height="1024" /&gt; &lt;/p&gt;  &lt;p&gt;In this case, clearly we don’t have any templates assigned.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So click on the report &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_b281f399-1637-470c-93db-56bd7462dad0.png" width="185" height="63" /&gt; &lt;/p&gt;  &lt;p&gt;And set a template …&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_1579e4eb-4b37-4395-acd8-bec1d930b96e.png" width="299" height="289" /&gt; &lt;/p&gt;  &lt;p&gt;the preview is unchanged&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_cefacc4a-30e2-47fe-a3b4-1c2ee7911951.png" width="1280" height="1024" /&gt; &lt;/p&gt;  &lt;p&gt;So, just click somewhere on the preview UI or hit the Refresh button&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_b4a361c6-5fd0-4f50-80bc-23f54f0d13a2.png" width="490" height="100" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And that click will cause the preview update&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAmoree_A049/image_28bb1c50-89ca-4528-978d-a551ce15b788.png" width="1280" height="1024" /&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896445" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Releasing a new version of my VisioAutomation library (version 2.0.0)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/09/11/releasing-a-new-version-of-my-visioautomation-library-version-2-0-0.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/09/11/releasing-a-new-version-of-my-visioautomation-library-version-2-0-0.aspx</id><published>2009-09-11T18:46:05Z</published><updated>2009-09-11T18:46:05Z</updated><content type="html">&lt;p&gt;Today I’m releasing the latest version of the VisioAutomation library on CodePlex: &lt;a title="http://visioautomation.codeplex.com/" href="http://visioautomation.codeplex.com/"&gt;http://visioautomation.codeplex.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This was a very large update and took about 6 months of effort.&lt;/p&gt;  &lt;h2&gt;CHANGES SINCE 1.X&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;The library itself has been reorganized into several distinct pieces (each in a distinct namespace)&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;strong&gt;VisioAutomation &lt;/strong&gt;– the core low-level library – I don’t expect people to spend much time using this directly&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;VisioAutomation.Scripting &lt;/strong&gt;– if you are writing interactive tools that work with Visio then this is the part of the library that will make using controlling Visio much easier&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;VisioAutomation.DOM&lt;/strong&gt; – This one is a document-oriented API to control Visio – consider it low-level, you generally don’t need to interact with it&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;The tools have been reorganized&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;strong&gt;Visio Power Tools &lt;/strong&gt;– this provides some extra features to Visio (such as Exporting to XAML) and the ability to create really nice gradients&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;VisioInteractive&lt;/strong&gt; - (Experimental) A library meant for use by an interactive IronPython 2.0 session&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;VisioPS&lt;/strong&gt; - (Experimental) an Module for IronPython 2.0 that lets you control Visio from the command line&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;FUTURE PLANS&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;VisioPS will be pulled into its related project I am working on – I haven’t finished with the concept but essentially think of it is a “simple business intelligence &amp;amp; analytics from the command-line” – the idea is to make it easy to play and render human-scale data&lt;/li&gt;    &lt;li&gt;VisioAutomation – evolutionary changes&lt;/li&gt;    &lt;li&gt;VisioAutomation.XML – A library to create Visio .VDX files directly from C# without having Visio installed (yes, it’s possible and it’s not even that hard) &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;PARTING THOUGHTS&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;Even if you aren’t interested in using the code for the library, check out the Visio Power Tools add-in – it add some nice end-user features.&lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9894242" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Edge Rendering Improvement in Visio 2010</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/09/04/edge-rendering-improvement-in-visio-2010.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/09/04/edge-rendering-improvement-in-visio-2010.aspx</id><published>2009-09-05T03:40:16Z</published><updated>2009-09-05T03:40:16Z</updated><content type="html">&lt;p&gt;I pay abnormally close attention to pixels and so it was with great pleasure this week that I discovered that Visio 2010 addressed a long-standing visual visual quality issue. &lt;/p&gt;  &lt;h2&gt;HOW VISIO 2007 EXHIBITED THIS PROBLEM&lt;/h2&gt;  &lt;p&gt;First, I let’s take a look at the Situation in Visio 2007 &lt;/p&gt;  &lt;p&gt;Start with an ellipse – any shape could be used but it’s most obvious with a curved shape.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_3.png" width="580" height="699" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Take a good look at the edges …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_10.png" width="394" height="366" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Do you see how the edge is nice and smooth?&lt;/p&gt;  &lt;p&gt;Now fill it with color.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_9.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_thumb_3.png" width="394" height="366" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The edge is nice and smooth.&lt;/p&gt;  &lt;p&gt;If we remove the line …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_d5da9ef7-dd47-4568-985e-251b92ccac8b.png" width="394" height="366" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;the edge is still smooth&lt;/p&gt;  &lt;p&gt;Now grade a 2-color gradient fill (Here is how to do this in a previous &lt;a href="http://blogs.msdn.com/saveenr/archive/2008/02/06/visio-2007-trick-transparent-gradients.aspx"&gt;blog post&lt;/a&gt;)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_1b08c220-49dc-4a78-84b7-a79d6a0ef936.png" width="394" height="366" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Not so nice.&lt;/p&gt;  &lt;p&gt;As you know, I love gradient fills – especially with multiple transparencies. So this was always a sore point when I used Visio 2007.&lt;/p&gt;  &lt;p&gt;The best I could ever manage was to work-around the problem by picking an border color. &lt;/p&gt;  &lt;p&gt;As you see if you pick set a border, the edge will be smooth again.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_0ed297e0-39ec-49a8-ab52-0f0506a83eb5.png" width="394" height="366" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;My work-around was to set the border to some “nice” value that made the less visible to the eye. In this case, I might have picked a simple gray color.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_9ecff283-aebf-4328-a65f-d24bcb1536a0.png" width="394" height="366" /&gt;&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see adding a border minimized the effect. &lt;/p&gt;  &lt;p&gt;If you compare the black border to the gray one in the example below, you can see that one can approximate the look of a smooth edge with no border for a gradient fill in Visio 2007&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_98c7e0c3-3d97-4de3-8d98-107356841c64.png" width="373" height="202" /&gt;&amp;#160;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_14136c4a-79e5-4152-8cd3-ef2c6e507c7c.png" width="373" height="202" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;However, it is difficult time find such a color in many cases – especially you have many overlapping shapes or transparencies.&lt;/p&gt;  &lt;h2&gt;&amp;#160;&lt;/h2&gt;  &lt;h2&gt;VISIO 2010 FIXED THIS PROBLEM&lt;/h2&gt;  &lt;p&gt;Visio 2010 addresses the problem.&lt;/p&gt;  &lt;p&gt;Here’s the a similar gradient fill in Visio 2010&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160; &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_7d64e6b0-18ce-4fce-b5e9-e8194e7742e1.png" width="914" height="506" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see the edge is smooth – despite the fact it is a gradient fill with no border.&lt;/p&gt;  &lt;h2&gt;ANOTHER EXAMPLE IN VISIO 2007&lt;/h2&gt;  &lt;p&gt;Here is a more complex use of gradient fills and transparencies in Visio 2007&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_e7db3c2e-5362-4d15-841e-ed82de127d5b.png" width="663" height="181" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Let’s zoom in …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_b6cf6be9-6cb8-4e06-bc5b-e2f74ebfed6f.png" width="662" height="318" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;AND HOW IT APPEARS IN VISIO 2010&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="snap0282" border="0" alt="snap0282" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/snap0282_c991fde9-c3d0-464d-b868-1c96f1d78170.png" width="664" height="185" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And zoomed in …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/EdgeRenderingImprovementinVisio2010_F86B/image_e58d1913-eadc-4af2-96f5-bf6831a2d1ba.png" width="678" height="274" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Much better!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;PARTING THOUGHTS&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;Again, it is very good to see that this has improved – a lot of the diagrams I build make use of gradient fills so this is has a big impact for me.&lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9891668" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Simplifying enumeration of Office object model collections with Linq and Extension methods</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/15/simplifying-enumeration-of-office-object-model-collections-with-linq-and-extension-methods.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/15/simplifying-enumeration-of-office-object-model-collections-with-linq-and-extension-methods.aspx</id><published>2009-08-15T21:29:09Z</published><updated>2009-08-15T21:29:09Z</updated><content type="html">&lt;p&gt;I found an interesting post on &lt;a href="http://msmvps.com/blogs/deborahk/default.aspx"&gt;Deborah's Developer MindScape&lt;/a&gt;&amp;#160; (&lt;a href="http://coolthingoftheday.blogspot.com/2009/08/linqing-to-word-and-excel-deborah.html"&gt;via Greg’s blog&lt;/a&gt; )and wanted to share a modification of the technique that can simplify the use of Office object models in C# and VB. I use this heavily in my &lt;a href="http://visioautomation.codeplex.com/"&gt;VisioAutomation library&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;First, let’s look at the the &lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/08/14/using-linq-with-microsoft-word-and-excel.aspx"&gt;Deborah’s original solution&lt;/a&gt; :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Courier New"&gt;var query = from d in Wd.Documents.Cast&amp;lt;Word.Document&amp;gt;()        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select d.Name;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;SIMPLIFYING WITH EXTENSION METHODS&lt;/h2&gt;  &lt;p&gt;This works fine. Through the use of extension methods we can make this even more succinct. The core pain to address is the need to re-enter the type (“Word.Document”) when it is already clear that is the only possible kind of object in the collection&lt;/p&gt;  &lt;p&gt;A simple extension method makes this even easier:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Courier New"&gt;var query = from d in Wd.Documents.&lt;font color="#ff0000"&gt;AsEnumerable&lt;/font&gt;()        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select d.Name;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The extension method that achieved this is trivial&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;public static class WordExtensions       &lt;br /&gt;{        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public static IEnumerable&amp;lt;Word.Document&amp;gt; &lt;font color="#ff0000"&gt;AsEnumerable&lt;/font&gt;(this Word.Documents docs)        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return docs.Cast&amp;lt;Word.Document&amp;gt;();        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;SOURCE CODE&lt;/h2&gt;  &lt;p&gt;The full source code is below ( you can get the entire project &lt;a href="http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Dev/SampleCode/Blog-Post-Samples/DemoOfficeCollectionsIEnumerable-%7C52009-08-15%7C6.zip"&gt;from my SkyDrive&lt;/a&gt;)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;using System;       &lt;br /&gt;using System.Collections.Generic;        &lt;br /&gt;using System.Linq;        &lt;br /&gt;using System.Text;        &lt;br /&gt;using Word = Mi2crosoft.Office.Interop.Word; &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;namespace DemoOfficeCollectionsIEnumerable       &lt;br /&gt;{        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; class Program        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; before();        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; after_with_an_extension_method(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static void before()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Start Word and get Application object        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var Wd = new Word.Application(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Define documents        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var doc1 = Wd.Documents.AddEmptyDoc();        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var doc2 = Wd.Documents.AddEmptyDoc(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Use Linq to access the document names.        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var query = from d in Wd.Documents.Cast&amp;lt;Word.Document&amp;gt;()         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select d.Name;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var docsnames1 = query.ToList(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Or use Lambda expressions        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var query2 = Wd.Documents.Cast&amp;lt;Word.Document&amp;gt;().Select(d=&amp;gt; d.Name);        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var docnames2 = query2.ToList(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static void &lt;font color="#ff0000"&gt;after_with_an_extension_method&lt;/font&gt;()        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Add to the top of the code file &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; object missingValue = System.Reflection.Missing.Value; &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Start Word and get Application object        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var Wd = new Word.Application(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Define documents        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var doc1 = Wd.Documents.AddEmptyDoc();        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var doc2 = Wd.Documents.AddEmptyDoc(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Use Linq to access the document names.        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#ff0000"&gt;var query = from d in Wd.Documents.AsEnumerable()         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select d.Name;&lt;/font&gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var docsnames1 = query.ToList(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Or use Lambda expressions        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#ff0000"&gt;var query2 = Wd.Documents.AsEnumerable().Select(d =&amp;gt; d.Name);&lt;/font&gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var docnames2 = query2.ToList(); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; public static class WordExtensions       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static IEnumerable&amp;lt;Word.Document&amp;gt; AsEnumerable(this Word.Documents docs)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return docs.Cast&amp;lt;Word.Document&amp;gt;();          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static Word.Document AddEmptyDoc(this Word.Documents docs)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; object missingValue = System.Reflection.Missing.Value;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return docs.Add(ref missingValue, ref missingValue,        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ref missingValue, ref missingValue);        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;PARTING THOUGHTS&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;I through in an extra extension method (AddEmptyDoc) and liberal use of ‘var’ to make the sample source code smaller &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9871208" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Dynamics AX 2009: Business Intelligence – Adding Links (via URL Drill Through) to Reports</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/12/dynamics-ax-2009-business-intelligence-adding-links-via-url-drill-through-to-reports.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/12/dynamics-ax-2009-business-intelligence-adding-links-via-url-drill-through-to-reports.aspx</id><published>2009-08-13T04:16:23Z</published><updated>2009-08-13T04:16:23Z</updated><content type="html">&lt;p&gt;In this post we are going to learn how to make reports that have links in them. &lt;/p&gt;  &lt;p&gt;As always, I start with some sample data. In this case, it will be a list of my favorite blogs.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;START WITH THE DATA&lt;/h2&gt;  &lt;p&gt;First, I create a new Data Method&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_44887c07-cfe6-482c-8dde-8160eb8ede5e.png" width="198" height="175" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_44.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_thumb.png" width="617" height="496" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This is the source code for that Data Method&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;[DataMethod(), AxSessionPermission(SecurityAction.Assert)]   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public static System.Data.DataTable DataMethod1()    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var favorite_blogs = new []       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; new {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name=&amp;quot;Visio Guy&amp;quot;,         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Url =&amp;quot;http://www.visguy.com/&amp;quot;},        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; new {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name=&amp;quot;Greg's Cool [Insert Clever Name] of the Day&amp;quot;,         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Url =&amp;quot;http://coolthingoftheday.blogspot.com/&amp;quot;},        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; new {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name=&amp;quot;DisplayBlog&amp;quot;,         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Url =&amp;quot;http://www.displayblog.com/&amp;quot;}&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/strong&gt;&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var datatable = Isotope.Data.DataUtil.DataTableFromEnumerable(favorite_blogs);   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return datatable;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can see from this example how easy it is to create a quick dataset via anonymous types.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And then create a new Data set …&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_e2c3b3be-49f6-4521-9961-a5fd980ae3cc.png" width="246" height="217" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And set the properties as appropriate to point to the Data Method&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_783c7690-3779-45e2-be35-04466293fe6b.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;CREATE A DESIGN&lt;/h2&gt;  &lt;p&gt;Now just drag the Data Set into the Designs node and assign some style templates and preview…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_01b81542-bd26-4d06-a8be-316cbae56365.png" width="735" height="271" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The column layout isn’t perfect (we’ll correct that later).&lt;/p&gt;  &lt;p&gt;So far what we have is just text. If you move the mouse over the URLs they are not treated as URLs but plain text. You can see from the screenshot below that although the cursor is right over the URL that the mouse retains it’s Arrow shape which indicates that this is just plain text.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_afa3264b-f456-4501-a655-60e10a92dead.png" width="744" height="279" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Our next step will be to make them clickable.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;ADD A URL DRILL THROUGH ACTION&lt;/h2&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Expand the design and find the &lt;strong&gt;Data &amp;gt; Url &lt;/strong&gt;field and right click and select &lt;strong&gt;URL Drill Through Action&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_f16a9445-fccd-4dcc-b0ae-ceea342541d9.png" width="514" height="655" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;A new node will appear …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_51ab7296-0ea0-49dc-8163-b5aebac8e1e2.png" width="312" height="374" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Examine its properties. We need to set the Expression value to something useful.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_a26020d2-3510-460f-a9f2-e7106fa1eed2.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click on that field and select “=Fields!Url.Value”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_507f8396-8266-462f-8fba-7f2924daca4a.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_e25b14dc-4726-4e4d-b220-400442269738.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now preview the report and move the mouse over a URL&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_5beb439f-10a9-47c2-9991-1c5793cf8c84.png" width="744" height="279" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see, the cursor now has a hand shape. If you click a new window will launch to that URL&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_45.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_thumb_1.png" width="600" height="480" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_46.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_thumb_2.png" width="600" height="480" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At this point we have the basics done. Let’s optimize the report.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;HIDING THE RAW URLS&lt;/h2&gt;  &lt;p&gt;We don’t want to show the URLs in the report – we want the user to click on the NAME of the blog and that should go to the appropriate URL. This is simple to achieve.&lt;/p&gt;  &lt;p&gt;Delete the &lt;strong&gt;Url&lt;/strong&gt; from the design &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_1f3fdd54-4e16-4e75-81e1-996fc646bb5f.png" width="326" height="630" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Only the Name field will remain in the design. Right-Click on the Name field and add a URL Drill Through Action&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_1afc303a-7d2e-46d2-aea2-a0ebc3072ec7.png" width="536" height="637" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can see the new node is created.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_9f6af90d-ac74-48a0-a7ab-36d8d3acdeb5.png" width="310" height="356" /&gt;&amp;#160;&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Examine its properties. And set the Expression value to =Fields!Url.Value&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_afd762bc-a03a-4659-8029-1d52f9c22949.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The thing to notice here is that although the Url field has been deleted from the design (what is shown) of the report, the Url field from the data set that is bound to the report.&lt;/p&gt;  &lt;p&gt;Now preview the report&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_0c62ed0a-91c8-440d-9d67-b00cdd88b002.png" width="749" height="242" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;As expected there is only one column. The URLs are not visible.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now move the mouse cursor over on of the links…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_4eed5cf8-e39f-4bf2-a8e0-52fd2ac81016.png" width="185" height="256" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And click…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_47.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_thumb_3.png" width="600" height="480" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Perfect. the link now goes to the correct place.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;IMPROVING THE LAYOUT&lt;/h2&gt;  &lt;p&gt;Let’s make the Name column wide enough so that the blog names don’t span multiple lines.&lt;/p&gt;  &lt;p&gt;Select the Name column.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_e20b4acf-d596-4a99-a7ba-b407d9f9ff2b.png" width="307" height="363" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And examine its properties. You can see that the Display Width property controls the width of the column&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_9d8104a0-c1c5-4fda-bd13-e61fefd7c66c.png" width="290" height="319" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Let’s change this to 4 inches&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160; &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_00b44e12-248b-4fc2-89b6-7a70198bb8c0.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And preview the report.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_859f3670-0afa-4f4f-8de5-6beaafa21886.png" width="757" height="262" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;LINKS THAT LOOK LIKE LINKS&lt;/h2&gt;  &lt;p&gt;One final problem remains: Although the links work – they don’t look like links. They still look like plain text.&lt;/p&gt;  &lt;p&gt;A straightforward way of fixing this problem is to again look at the properties of the Name field. There’s a section called Style&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_abbbea8e-abf4-44de-a731-ef5bbc1337b1.png" width="290" height="319" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you expand that node … you can see there are more options available. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_3ad15570-2136-4f6e-b942-0ddc6a7baedd.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Also, you’ll notice the button on the right with the ellipsis. Click on that.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_9a77b8f1-2f08-438b-b6e9-874c8a5cbead.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And you’ll get a special dialog called the Cell Style editor&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_acf65c02-9aa2-47ba-9459-add5cda7fc8d.png" width="565" height="373" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Set the color to Blue&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_0f136034-112d-4c21-9ce0-4f249b524e99.png" width="596" height="547" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And the Decoration to Underline&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_1f2de980-3433-42fc-ba97-8bfe4077ce0e.png" width="565" height="373" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And click OK.&lt;/p&gt;  &lt;p&gt;Now preview the report.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceAdding_100D2/image_b4589982-2e11-4a5f-a91a-dd21aada6e1e.png" width="735" height="266" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Done. We have a report that has simple clickable links.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;SOURCE CODE&lt;/h2&gt;  &lt;p&gt;You can get it here: &lt;a title="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-12%7C6?view=details" href="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-12%7C6?view=details"&gt;http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-12%7C6?view=details&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9867441" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>A Walkthrough of Dynamically Compiling C# code</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/11/a-walkthrough-of-dynamically-compiling-c-code.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/11/a-walkthrough-of-dynamically-compiling-c-code.aspx</id><published>2009-08-12T03:57:25Z</published><updated>2009-08-12T03:57:25Z</updated><content type="html">&lt;p&gt;One of my side-projects requires me to build some of my own tools. In this case: a code generation tool. In a future post, I’ll describe the tool and provide its source, but for now I did want to share some of what I discovered on the way.&lt;/p&gt;  &lt;p&gt;First, the tool I am building essentially reads a simple DSL and generates C# source code from it. To be more specific it doesn’t just generate C# source code, it also compiles it into an assembly for you so that it is easy to consume in binary form. It’s this last part I will focus on: taking c# code and making it into an assembly.&lt;/p&gt;  &lt;p&gt;I created a simple Console application called DemoCompiler. The entire source is below. I’ll walk you through it section-by-section to illustrate what is going on.&lt;/p&gt;  &lt;h2&gt;THE SOURCE CODE TO GET STARTED&lt;/h2&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;       &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;         &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; DemoCompiler&lt;/p&gt;          &lt;p style="margin: 0px"&gt;{&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Program&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Create the source code&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; source = &lt;span style="color: #a31515"&gt;@&amp;quot;&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;namespace Foo&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;{&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; public class Bar&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Bar.SayHello();&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static void SayHello()&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Console.WriteLine(&amp;quot;&amp;quot;Hello World&amp;quot;&amp;quot;);&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;}&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;quot;&lt;/span&gt;;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Setup for compiling&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; provider_options = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;span style="color: #a31515"&gt;&amp;quot;CompilerVersion&amp;quot;&lt;/span&gt;,&lt;span style="color: #a31515"&gt;&amp;quot;v3.5&amp;quot;&lt;/span&gt;}&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; provider = &lt;span style="color: blue"&gt;new&lt;/span&gt; Microsoft.CSharp.&lt;span style="color: #2b91af"&gt;CSharpCodeProvider&lt;/span&gt;(provider_options);&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; compiler_params = &lt;span style="color: blue"&gt;new&lt;/span&gt; System.CodeDom.Compiler.&lt;span style="color: #2b91af"&gt;CompilerParameters&lt;/span&gt;();&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; outfile = &lt;span style="color: #a31515"&gt;&amp;quot;D:\\Foo.EXE&amp;quot;&lt;/span&gt;;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.OutputAssembly = outfile ;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.GenerateExecutable = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Compile&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; results = provider.CompileAssemblyFromSource(compiler_params, source);&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Print out any Errors&lt;/span&gt;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;Output file: {0}&amp;quot;&lt;/span&gt;, outfile);&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;Number of Errors: {0}&amp;quot;&lt;/span&gt;, results.Errors.Count);&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (System.CodeDom.Compiler.&lt;span style="color: #2b91af"&gt;CompilerError&lt;/span&gt; err &lt;span style="color: blue"&gt;in&lt;/span&gt; results.Errors)&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;ERROR {0}&amp;quot;&lt;/span&gt;, err.ErrorText);&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;          &lt;p style="margin: 0px"&gt;}&lt;/p&gt;       &lt;/div&gt;        &lt;p style="margin: 0px"&gt;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;FYI – pay attention to the two namespaces that are used here:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Microsoft.CSharp &lt;/li&gt;    &lt;li&gt;System.CodeDom.Compiler &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Now run the compiler&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_1e2665b7-dfb3-4df5-919b-dd55b19a47d7.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;Excellent. No errors.&amp;#160; Ok, we have a EXE.&lt;/p&gt;  &lt;p&gt;Let’s run it…&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_14fb9ffe-223c-471e-abc8-50bb9a0347ef.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;And now step through the code &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_70B9/image_4.png" width="800" height="986" /&gt;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;TIP: Always check for compile errors&lt;/p&gt;  &lt;p&gt;Now let’s play around with it and see what happens.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;USING OBJECTS ANOTHER ANOTHER ASSEMBLY&lt;/h2&gt;  &lt;p&gt;First.&amp;#160; let’s try creating a simple Rectangle from System.Drawing.Rectangle and printing it.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Create the source code&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; source = &lt;span style="color: #a31515"&gt;@&amp;quot;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;namespace Foo&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;{&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; public class Bar&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Bar.SayHello();&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static void SayHello()&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Console.WriteLine(&amp;quot;&amp;quot;Hello World&amp;quot;&amp;quot;);&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var r = new System.Drawing.Rectangle(0,0,100,100);&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Console.WriteLine(r);&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;}&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;quot;&lt;/span&gt;;&lt;/p&gt;   &lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;This time the compile doesn’t work…&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_08da5ef6-468b-4962-833f-adc3e5e423f0.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The reason is that the output assembly doesn’t contain a reference to System.Drawing – we fix that very simply by modifying the compiler parameters&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; outfile = &lt;span style="color: #a31515"&gt;&amp;quot;D:\\Foo.EXE&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.OutputAssembly = outfile ;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.GenerateExecutable = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#ff0000"&gt;compiler_params.ReferencedAssemblies.Add(&lt;span style="color: #a31515"&gt;&amp;quot;System.Drawing.Dll&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And try compiling…&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_a89075b8-e363-4da3-8275-2423d202e68c.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;And then running the EXE&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_51c01aab-e74c-4109-b65f-99f917b58196.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;USING LINQ&lt;/h2&gt;  &lt;p&gt;We love LINQ these days, so let’s try using it to print the numbers from 0 to 9&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Create the source code&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; source = &lt;span style="color: #a31515"&gt;@&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;using System.Collections.Generic;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;using System.Linq;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;namespace Foo&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;{&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; public class Bar&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Bar.SayHello();&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static void SayHello()&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Console.WriteLine(&amp;quot;&amp;quot;Hello World&amp;quot;&amp;quot;);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var r = new System.Drawing.Rectangle(0,0,100,100);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Console.WriteLine(r);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#ff0000"&gt;System.Console.WriteLine( string.Join(&amp;quot;&amp;quot;,&amp;quot;&amp;quot;, Enumerable.Range(0,10).Select(n=&amp;gt;n.ToString()).ToArray() ) );&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;}&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;&amp;quot;&lt;/span&gt;;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_dd0eb1e6-de18-4360-ace3-35a2260ad452.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;What could be wrong here? We are missing a reference to “System.Core.Dll” (that’s where Linq is)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; outfile = &lt;span style="color: #a31515"&gt;&amp;quot;D:\\Foo.EXE&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.OutputAssembly = outfile ;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.GenerateExecutable = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.ReferencedAssemblies.Add(&lt;span style="color: #a31515"&gt;&amp;quot;System.Drawing.Dll&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#ff0000"&gt;compiler_params.ReferencedAssemblies.Add(&lt;span style="color: #a31515"&gt;&amp;quot;System.Core.Dll&amp;quot;&lt;/span&gt;);&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now try compiling.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_3b02c574-7efe-4cfe-8005-2061384888b5.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;It works, so run the EXE …&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_21d335b8-3e49-40cb-b716-bf6bcf8cf2ed.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;Perfect.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;WHAT WE LEARNED&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;the basics of compiling source &lt;/li&gt;    &lt;li&gt;How to tell if the compilation worked correctly &lt;/li&gt;    &lt;li&gt;how to specify that an executable is created &lt;/li&gt;    &lt;li&gt;how to ensure that we can use C# 3.0 syntax &lt;/li&gt;    &lt;li&gt;how to address common issues in using Linq and referring to other DLLs &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;CREATING A DLL INSTEAD OF AN EXE&lt;/h2&gt;  &lt;p&gt;This is very simple&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#ff0000"&gt;&lt;strong&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt; outfile = &lt;span style="color: #a31515"&gt;&amp;quot;D:\\Foo.DLL&amp;quot;&lt;/span&gt;;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; compiler_params.OutputAssembly = outfile ;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#ff0000"&gt;compiler_params.GenerateExecutable = &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Just set the output filename to end with “.DLL” and set &lt;strong&gt;GenerateExecutable&lt;/strong&gt; to &lt;strong&gt;false&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;If you run the compiler now, it will generate a DLL that you can import into another project.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/AWalkthroughofDynamicallyCompilingCcode_FC71/image_778a7e90-fc3b-45d5-a9ea-263f3f9dcfc5.png" width="677" height="342" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;SOURCE CODE&lt;/h2&gt;  &lt;p&gt;You can get it here: &lt;a title="http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Dev/SampleCode/Blog-Post-Samples/Saveenr-Blog-Post-%7C52009-08-11%7C6.zip" href="http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Dev/SampleCode/Blog-Post-Samples/Saveenr-Blog-Post-%7C52009-08-11%7C6.zip"&gt;http://cid-19ec39cb500669d8.skydrive.live.com/self.aspx/Public/Dev/SampleCode/Blog-Post-Samples/Saveenr-Blog-Post-%7C52009-08-11%7C6.zip&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9865272" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Visio 2007: An single XML file with all of Visio 2007 ShapeSheet sections, rows, cells, and functions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/08/visio-an-single-xml-file-with-all-of-visio-2007-shapesheet-sections-rows-cells-and-functions.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/08/visio-an-single-xml-file-with-all-of-visio-2007-shapesheet-sections-rows-cells-and-functions.aspx</id><published>2009-08-09T05:11:45Z</published><updated>2009-08-09T05:11:45Z</updated><content type="html">&lt;p&gt;Not a provocative title for this blog post, but it is what it is.&lt;/p&gt;  &lt;p&gt;This week I needed to programmatically generate from C# from the list of sections, rows, cells, etc in Visio. My first discovery is that this information doesn’t already exist in a single place – it’s scattered over many pages in MSDN.&lt;/p&gt;  &lt;p&gt;Fortunately I also discovered two things:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;MSDN has a “Low Bandwidth” version of its webpages - &lt;a title="http://msdn.microsoft.com/en-us/library/bb267452.aspx" href="http://msdn.microsoft.com/en-us/library/bb267452.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb267452.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;The &lt;a href="http://www.codeplex.com/htmlagilitypack"&gt;HTML Agility Pack&lt;/a&gt; makes it easy to do “scraping” of HTML &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Combining those two things with some C# code I was able to extract a single file that contains all the information into a single XML file. &lt;/p&gt;  &lt;h2&gt;GET THE XML FILE HERE&lt;/h2&gt;  &lt;p&gt;You can download the file from my SkyDrive here: &lt;a title="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Visio/Developer%20Information/ShapeSheet-Reference" href="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Visio/Developer%20Information/ShapeSheet-Reference"&gt;http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Visio/Developer%20Information/ShapeSheet-Reference&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9861798" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Dynamics AX 2009: Business Intelligence – Dynamically Generating Bitmap Images for SSRS Reports using Data Methods</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/06/dynamics-ax-2009-business-intelligence-dynamically-generating-bitmap-images-for-ssrs-reports-using-data-methods.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/06/dynamics-ax-2009-business-intelligence-dynamically-generating-bitmap-images-for-ssrs-reports-using-data-methods.aspx</id><published>2009-08-07T01:57:56Z</published><updated>2009-08-07T01:57:56Z</updated><content type="html">&lt;blockquote&gt;   &lt;p&gt;In my last post I took a detour from the Data Method topic and explored how to put bitmaps into reports. This post is going I’ll merge the two topics – instead of embedding and image or retrieving it from another source we are going to build a report that creates bitmaps on-the-fly and places them in report designs.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This technique has several uses&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You can generate custom charts &amp;amp; graphics&lt;/li&gt;    &lt;li&gt;You can create images that are context-sensitive (you could for example show the time the report was rendered as a clock, instead of showing it as text in HH:MM format)&lt;/li&gt;    &lt;li&gt;You can make some very nice looking title bars or backgrounds using effects that are not possible from the SSRS reporting tools directly&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;First, verify that you can create a precision decision that contains an embedded image (you can start with the source code from my previous blog post)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_78dfc8ed-4e2a-4590-be76-e250983839ff.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Verify that it renders in preview&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_21f0f2a8-ccf2-41f4-ab0a-e6320b17c74d.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Good. Now that we have a working report, let’s get some dynamic bitmap content there.&lt;/p&gt;  &lt;p&gt;First create a new Data Method&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_7039f91e-56cd-475c-a979-163998465e5b.png" width="295" height="412" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here’s what was created …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_4c77dd3b-e593-41e8-b6bd-2bc4977542e8.png" width="601" height="109" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We are going to change the return type to &lt;strong&gt;byte[] &lt;/strong&gt;and replace the exception with some simple code that uses things in the &lt;strong&gt;System.Drawing&lt;/strong&gt; namespace. So, first we should add a reference to &lt;strong&gt;System.Drawing&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the &lt;strong&gt;Solution Explorer&lt;/strong&gt;, right click on &lt;strong&gt;BusinessLogic &amp;gt; References&lt;/strong&gt; and click &lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_de56820a-67a2-4c78-8ac7-154133931964.png" width="292" height="535" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_efb470b4-5c7f-4283-93da-0d9415975a52.png" width="467" height="383" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now modify Data Method&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;[DataMethod(), AxSessionPermission(SecurityAction.Assert)]     &lt;br /&gt;public static &lt;strong&gt;&lt;font color="#ff0000"&gt;byte[]&lt;/font&gt;&lt;/strong&gt; DataMethod1()      &lt;br /&gt;{      &lt;br /&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; using (var bmp = new System.Drawing.Bitmap(600, 200))         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var brush_white = System.Drawing.Brushes.White; &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (var g = System.Drawing.Graphics.FromImage(bmp))         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var f = new System.Drawing.Font(&amp;quot;Courier&amp;quot;, 36.0f);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; g.DrawRectangle(System.Drawing.Pens.Red, 10, 10, 400, 100); &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var memstream = new System.IO.MemoryStream();         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bmp.Save(memstream, System.Drawing.Imaging.ImageFormat.Png);          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var bytearray = memstream.ToArray();          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return bytearray;&lt;/strong&gt;&lt;/font&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;All this method does is create a simple bitmap with a red rectangle in it and then returns that bitmap as a byte array.&lt;/p&gt;  &lt;p&gt;Build the solution and select the image in the Precision Design and examine its properties&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_67270651-2558-44fa-b8aa-5622913ce48b.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see it refers to the an &lt;strong&gt;Embedded&lt;/strong&gt; image with the id “Flowers”&lt;/p&gt;  &lt;p&gt;First, we change the &lt;strong&gt;Source&lt;/strong&gt; property&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_1923034e-7f87-4286-9ed6-d7afabee77ec.png" width="290" height="319" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;From &lt;strong&gt;Embedded&lt;/strong&gt; to&amp;#160; &lt;strong&gt;Database&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_3dfed83a-b505-467d-a181-c1d862083cd5.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then change the &lt;strong&gt;Value&lt;/strong&gt; property from “Flowers”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_78f584cf-6fa9-4e06-b646-17bd7da5ef3b.png" width="290" height="319" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To an “Expression”. click on the Expression option. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_48dbab3b-13dc-4db8-a591-840d75122adb.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And the &lt;strong&gt;Edit Expression&lt;/strong&gt; dialog will launch&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_97836015-93ab-4d39-878a-14d1906203ad.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you can see, it retains the original value of “Flowers”. This is not in valid expression syntax so that is why the red underline appears.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_ae2a1593-6d3e-4d6e-bee8-5ba67d53d2a1.png" width="580" height="473" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We know we have a datamethod that generates a bitmap so let’s find it. Click on Data Methods in the left-most pane on the bottom&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_fc973c44-90b9-4a6e-a82f-54b0695b1f8d.png" width="580" height="473" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can now see all the Data Methods in the project. DataMethod1 is the one that creates the bitmap&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_030a4006-9764-4669-b36b-cc182a3d1eef.png" width="580" height="473" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So select the text in the expression text box&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_02d083fc-4de9-4896-aae8-9a6a75e4cb92.png" width="580" height="473" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And replace it with an expression that calls DataMethod1&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_bf7abaf2-a70d-4d54-9df0-711e5ee6d7d3.png" width="580" height="473" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And click OK&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_79c37f73-bf6c-4058-9f7e-23f4615cf288.png" width="580" height="473" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then you’ll see this …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_d39be626-4a54-4fb9-ad04-48afba136113.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I know. Unsatisfying. When images are generated dynamically via datamethods the design surface doesn’t show a preview of the bitmap. &lt;/p&gt;  &lt;p&gt;So, what about preview …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_66c5dd92-f417-4dde-8aa6-ef1bd5f7cc81.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Coo. This works.&lt;/p&gt;  &lt;h2&gt;IMPORTANT TIP&lt;/h2&gt;  &lt;p&gt;An issue you’ll discover when generating bitmaps dynamically is that the preview window doesn’t pick up changes to the bitmap if you simply rewrite the bitmap-generation code or even some changes in the design surface layout even if you click the Refresh button. So to “force” it to pick up the changes I often close the preview window, rebuild the project, and launch the preview window again.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;A MORE COMPLICATED DRAWING&lt;/h2&gt;  &lt;p&gt;I added a new Data Method that creates a more interesting bitmap (the source code for this project includes the code to create this image). This one features some text and three radial gradient fills with transparencies. My intention is to show you how to use this as a header for a report. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_1e5c939b-6616-4ac4-896f-898760a810ba.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;First make the header area larger by resizing it …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_58da8638-8582-40b7-806f-09d38981c902.png" width="294" height="215" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_8146d1f2-f2d6-4a48-858c-f92f39529b9a.png" width="334" height="406" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now select the edge of the image on the design surface&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_e3d5733f-5325-4a81-b325-3e5a8c4b0205.png" width="217" height="218" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And drag it into the header area&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_95835364-b993-46e0-a37b-b04c0477a515.png" width="489" height="507" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You’ll see this …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_90fb3ff1-8bfa-48c9-be5e-55d296fb94b4.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And position it toward the top of the report. (I also changed the size of the image on the design surface but that is not important)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_f246bbf2-a9e0-4134-be70-f5d72c128bd2.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And when you preview …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceDynami_E069/image_ba67302d-52ee-4c40-8c3c-f76c84f83675.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;At this point should you should have a good handle on what can be done with dynamic generation of bitmaps in reports. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;SOURCE CODE&lt;/h2&gt;  &lt;p&gt;You can get it here: &lt;a title="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-06%7C6" href="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-06%7C6"&gt;http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-06%7C6&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9859665" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Dynamics AX 2009: Business Intelligence – Bitmap Images into SSRS Reports and an Introduction to Precision Designs</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/04/dynamics-ax-2009-business-intelligence-bitmap-images-into-ssrs-reports-and-an-introduction-to-precision-designs.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/04/dynamics-ax-2009-business-intelligence-bitmap-images-into-ssrs-reports-and-an-introduction-to-precision-designs.aspx</id><published>2009-08-05T03:52:08Z</published><updated>2009-08-05T03:52:08Z</updated><content type="html">&lt;p&gt;Up until now I’ve been talking about data and code that generates it with Data Methods . In this post, I’ll show you how to put images into your reports.&lt;/p&gt;  &lt;p&gt;First let’s get an image.&amp;#160; &lt;/p&gt;  &lt;p&gt;I found one of the sample Windows 7 pictures and made it smaller &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_5f925b0a-faf3-46f9-a7cc-f5a31f8f3356.png" width="415" height="311" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and then placed that image on my My Pictures folder on the SSRS server.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_92631554-82a6-4075-8b38-485246cc3460.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now lets go back into Visual Studio. I have a simple report defined that renders a table.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_484b867c-a7fd-43f1-9a60-52c5d362ee0f.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The report looks like this when previewed …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_9205b17b-5a19-4d38-a014-de01cd9bea87.png" width="733" height="518" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now let’s just add an image to the report by selecting the &lt;strong&gt;Images&lt;/strong&gt; node and clicking &lt;strong&gt;Add Image&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_ba3fba94-98bc-419a-bafd-0d840223f832.png" width="425" height="507" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;An Image was created called “Image1” – Just rename this to flowers&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_38c6a972-3462-4e95-a6b0-25434f384a2c.png" width="425" height="507" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_e82abbc3-e99d-43d8-9843-f9f5c62e378c.png" width="425" height="507" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And examine its properties&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_4a96b3d6-0d8c-441b-9a5a-2c01bb5e3e1d.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now we need to select the flowers.png file. How? It isn’t obvious at all – you need to click on the field called &lt;strong&gt;Base64 Data&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_eaa15c1d-bae2-471a-bd07-4f425e4afb3f.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then select a suitable bitmap&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_d0e385eb-228a-47bc-a5ef-858d9fc5c3cb.png" width="610" height="480" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And now you’ll see that the bitmap is loaded into the report. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_0ed0bed2-4409-40d7-941a-c2af2af47028.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;At this point you are expecting me to somehow drag this image into the report or use it as the background of some thing on the page – but that’s not possible. &lt;strong&gt;Auto Design &lt;/strong&gt;reports&amp;#160; weren’t created to let you put things like images on a page. We need to move into the more complicated world of &lt;strong&gt;Precision Design&lt;/strong&gt; reports.&lt;/p&gt;  &lt;p&gt;Fortunately, our work on the original report is &lt;strong&gt;NOT &lt;/strong&gt;wasted. We can transform the Auto Design into a Precision design very easily.&lt;/p&gt;  &lt;p&gt;Just right-click on the Auto Design and select &lt;strong&gt;Create Precision Design&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_a419ebb0-1efb-46d5-87db-932a554496ac.png" width="360" height="586" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This will create keep the existing Auto Design but create a new Precision design that is an exact copy of the Auto Design…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_125a86ad-f924-49b6-94d3-954ec3e934e7.png" width="279" height="413" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And if you preview it …&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_9aa66050-1d84-4cb6-98e2-81ad42353aef.png" width="357" height="661" /&gt; &lt;/p&gt;  &lt;p&gt;You’ll see, that it does indeed look exactly like the original AutoDesign – it even has “AutoDesign1” as the title.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_4cc12bae-5339-4a5e-9bd5-67ed1df8e9d6.png" width="745" height="536" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The Precision design editing experience is much different though. We can access it by double-clicking on the precision design or right-clicking it and selecting &lt;strong&gt;Edit Using Designer&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_48504b99-ea81-464c-8eaa-a6997a86f9a4.png" width="362" height="662" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And now we see the Precision Design editing surface. As you can guess, now that we have a surface we can place report elements exactly where we want them. We get exact control over placement but at the cost of simplicity.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_1d9e928b-139f-4d05-9543-98ec2831354f.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;There’s nothing in the UI that shows what we can put on the surface yet. So, from the &lt;strong&gt;View&lt;/strong&gt; menu select &lt;strong&gt;Toolbox&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_b23ed600-332e-4316-a480-308adcb2c336.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And now a list of report elements is available for you to use&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_fe96d51c-bd6a-4b49-9c47-c1ca1050ea6c.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click and hold down on the &lt;strong&gt;Image&lt;/strong&gt; element in the &lt;strong&gt;Toolbox&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_2514c2f0-e6e9-44b0-a4c8-6cee86c0d98b.png" width="445" height="330" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And drag it onto the white area of the Precision Design&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_0c95f075-fe35-4056-b901-8182d7f57314.png" width="668" height="280" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This will leave a tiny icon there. The red x icon appears because we haven’t selected a valid image yet.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_e5040e03-8703-4732-a23e-863eb2fcf908.png" width="668" height="280" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;With the image selected, look at the properties window. The &lt;strong&gt;Source&lt;/strong&gt; property is set to &lt;strong&gt;External&lt;/strong&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_5f1f4bca-c098-4440-98c6-af12fae830c0.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Because we added (embedded) the flowers.png file to the report change the &lt;strong&gt;Source&lt;/strong&gt; property to &lt;strong&gt;Embedded&lt;/strong&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_5172ff9c-4b6f-452d-b831-dc6d18c011a4.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then expand the &lt;strong&gt;Value&lt;/strong&gt; property and pick “Flowers”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_d11fcb0d-86ae-4b59-8869-11a18900cb7d.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Even without previewing it, you’ll see the flowers show up in the design surface&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_4d9c705f-cfef-4b9d-9876-582f87c5431d.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And naturally this works when previewed …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_a4a01aa7-fd11-4ab0-936a-c31741d92e23.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;KOALAS&lt;/h2&gt;  &lt;p&gt;What if the image isn’t embedded but is sitting somewhere else – for example on the IIS server that is on the same box as the SSRS server. In this case, I placed kkoalas.png into an folder in the default web site.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_6fd65c93-7cdf-4f7c-a516-869f3ca6eef2.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And validated that I can see the picture when browsing the website with IE.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_5add148a-8fa0-4531-8b6e-6fce98ec69ef.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now go back to the properties for the image we put on the report&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_52386a4b-812f-4bdf-9c09-809f7b5c95b7.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And set the &lt;strong&gt;Source&lt;/strong&gt; to &lt;strong&gt;External &lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_0c782ea1-4239-4598-8319-7fb2b3628606.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And click on the &lt;strong&gt;Value&lt;/strong&gt; property &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_2956ad59-8317-491e-af72-71d2117a9046.png" width="290" height="310" /&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which lets you type into the field directly&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_4a4bf402-3136-4623-9708-b98e52961340.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And enter the url … http://isotopex/images/koala.png&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_2a5101b5-ade1-464b-82a4-43f4f2a06815.png" width="290" height="310" /&gt;&amp;#160;&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then the design surface will update … to have 100% more Koala&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_3132ada8-2fb1-4bba-b40f-c7cbe2b72021.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And this is visible in preview, of course&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_254e878f-7e05-47da-ace1-12b7982f09e9.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In this Koala example, the bitmap was on the same server as the SSRS server, we can also point SSRS at images on remote machines&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Go to the microsoft website …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_60e9377c-b37e-4d18-97d2-d1364f84ae40.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Find an image you want, and right-lick to see its properties&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_4f5d916b-cd01-4345-a2f8-78723874e70e.png" width="371" height="340" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_52f71aa8-6024-41d6-bd90-21b60705278d.png" width="324" height="449" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And you can see the URL there in the Properties dialog&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_fcee9f88-ed5e-464c-8c3b-f5b9251ba22a.png" width="1280" height="1024" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Select the text, right-click, and choose &lt;strong&gt;Copy&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_5d646823-3665-4e16-8804-1b475595cfb0.png" width="362" height="442" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Go back to your report …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_81581914-376b-4171-a3e2-259008845b98.png" width="1280" height="1024" /&gt;&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And change the &lt;strong&gt;Value&lt;/strong&gt; property&amp;#160; …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_1ef36671-3ba0-4754-9afb-b059fbd17ada.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To the new URL …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_9dc20c87-5df3-422f-8404-039f63cc51dd.png" width="290" height="310" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And there you go …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligenceBitmap_FB1B/image_b91e3caa-8dda-4ccf-9a08-e968593a18f3.png" width="1280" height="1024" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;NOTE: To fetch images remotely requires that the SSRS Execution account be set correctly (&lt;a title="Adding an Image to a Report" href="http://msdn.microsoft.com/en-us/library/ms156482(SQL.90).aspx"&gt;Adding an Image to a Report&lt;/a&gt;)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9857561" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Dynamics AX 2009: Business Intelligence – the Column Chart Layout for Auto Design reports</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/08/02/dynamics-ax-2009-business-intelligence-the-column-chart-layout-for-auto-design-reports.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/08/02/dynamics-ax-2009-business-intelligence-the-column-chart-layout-for-auto-design-reports.aspx</id><published>2009-08-02T19:39:33Z</published><updated>2009-08-02T19:39:33Z</updated><content type="html">&lt;p&gt;I’ve been looking forward to sharing this post for a while. I am going to show exactly how to get a column chart in SSRS using Dynamics AX 2009. I’m going to go step-by-step and show you “gotchas” you will encounter as you develop charts. Although this takes more to do it in this way, ultimately prepares you for the real-world use the reporting components in Dynamics AX.&lt;/p&gt;  &lt;p&gt;Ultimately I want a simple column chart showing a list of numbers. Instead of hard-coding the numbers I’ve written a function that generates as many random points as we need. Because we often want to see numbers in a trend, this method generates n numbers from from some starting value to some ending value (i.e. points along a line displaced by some factor)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public static IEnumerable&amp;lt;double&amp;gt; generate_random_sequence(int num_values, double min_value, double max_value,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double start_value, double end_value, double factor)      &lt;br /&gt;{ &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; double step = (end_value - start_value) / (num_values - 1);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var r = new System.Random(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; var indices = Enumerable.Range(0, num_values); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; var values = from i in indices     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let delta = (r.NextDouble() * (max_value - min_value) * factor) - (factor * 0.5)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; let v = start_value + (i * step)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select v + delta; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; var normalized_values = from value in values     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select System.Math.Min(max_value, System.Math.Max(min_value, value)); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; return normalized_values; &lt;/p&gt;    &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now I create a data method …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;[DataMethod(), AxSessionPermission(SecurityAction.Assert)]     &lt;br /&gt;public static System.Data.DataTable DataMethod_Series_0()      &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int num_values = 14;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double min_value = 0;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double max_value = 100;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double start_value = 30;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double end_value = 70;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double factor = 0.10; &lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160; var values = generate_random_sequence(num_values, min_value, max_value, start_value, end_value, factor); &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160; var records = values.Select((value) =&amp;gt; new { NumWidgets = (int) value } );&lt;/font&gt; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; var datatable = Isotope.Data.DataUtil.DataTableFromEnumerable(records);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return datatable; &lt;/p&gt;    &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then build the project to verify everything compiles.&lt;/p&gt;  &lt;p&gt;Now create a dataset&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_3.png" width="232" height="208" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Set its &lt;strong&gt;Data Source&lt;/strong&gt; to &lt;strong&gt;Business Logic&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_93667c90-8eb6-410b-8bcd-f852f6e5bcce.png" width="290" height="319" /&gt;&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;And select that data method in the &lt;strong&gt;Query&lt;/strong&gt; property for the dataset&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_ef98862a-ba77-4acb-a176-25799a4fc57d.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_4253045b-24c6-4650-b2b3-9db605a1a24d.png" width="500" height="443" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Build the project to check if anything is wrong.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Notice that we haven’t altered the Default Layout – it is still set to Table. This is deliberate. When you create any charts, I always advise you first to verify that your datasets render as tables.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_72d158be-00e3-4b3b-a600-68c71f431200.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now drag the dataset into the &lt;strong&gt;Designs&lt;/strong&gt; node&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_5087d66c-90dd-4fd5-a444-f4020bc9372c.png" width="207" height="224" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now preview the report&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_8d464c90-1d7c-4534-96d2-e2cbb4cf96bd.png" width="352" height="543" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And we see .. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_815abcb6-6952-4e40-9392-918e7a28c169.png" width="155" height="413" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Ugly report. But we don’t care how it looks. We just did this to validate the data.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt; Now I’ll create a copy of that same data set &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_9b90a3dd-e059-49cb-977f-70b732be7a92.png" width="244" height="289" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And set the Default Layout to ColumnChart&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_ba70bbad-750a-4c78-b657-ea2d7fd5789d.png" width="290" height="319" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And now drag this into the Designs node&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_6d4287c4-f8d9-405e-a5bc-f5e29160cf20.png" width="228" height="289" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now preview ..&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_f36dc831-8c9e-4226-b450-60e4529abea7.png" width="348" height="607" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Only to be greeted by …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_fc51dbf3-13fb-489a-9f62-7ad6c6e14eec.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;OK, first lesson – we need column groupings.&lt;/p&gt;  &lt;p&gt;Maybe you will be tempted to ‘fix’ this problem by going to the NumWidgets field&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_d2074059-d482-4ce4-8920-b2ccb12ec1e4.png" width="231" height="306" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And changing its &lt;strong&gt;Field Type&lt;/strong&gt; from &lt;strong&gt;Data&lt;/strong&gt; to &lt;strong&gt;Grouping&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_57a58069-ead8-438e-98c5-aa74eede2916.png" width="290" height="319" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And if you do that and drag the dataset&amp;#160; into the designs node you’ll get&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_64fdc622-eed6-4bf8-b571-db7b2d257cf1.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So now you have 2 errors – 1 more than previously so things got worse not better.&lt;/p&gt;  &lt;p&gt;The way to solve is is simple. Create an additional field in the dataset that will serve for the category grouping&lt;/p&gt;  &lt;p&gt;To do this we need to modify the data method&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;[DataMethod(), AxSessionPermission(SecurityAction.Assert)]     &lt;br /&gt;public static System.Data.DataTable DataMethod_Series_1()      &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int num_values = 14;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double min_value = 0;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double max_value = 100;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double start_value = 30;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double end_value = 70;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double factor = 0.10; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; var values = generate_random_sequence(num_values, min_value, max_value, start_value, end_value, factor); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; var records = values.Select(&lt;font color="#ff0000"&gt;(value, index) &lt;/font&gt;=&amp;gt; new { &lt;font color="#ff0000"&gt;Index = index&lt;/font&gt;, NumWidgets = (int) value });      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var datatable = Isotope.Data.DataUtil.DataTableFromEnumerable(records);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return datatable; &lt;/p&gt;    &lt;p&gt;} &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Notice the &lt;strong&gt;Select &lt;/strong&gt;method! This version of the Select method in LINQ is not that well known – it provides the current index of the enumeration&lt;/p&gt;  &lt;p&gt;And now delete the dataset and recreate it but bind it to this new data method&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_c6a6972c-ffa1-4ebb-bffc-79fea4f5edab.png" width="219" height="126" /&gt; &lt;/p&gt;  &lt;p&gt;Good, now we see both fields.&lt;/p&gt;  &lt;p&gt;Because the data set is new, the Default Layout is set to table … verify that you can see the table rendering …&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_8ce1f26e-3add-4825-a34a-498f1e03b46d.png" width="264" height="412" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Good so far.&lt;/p&gt;  &lt;p&gt;Now set the &lt;strong&gt;Default Layout&lt;/strong&gt; property of that Data set to &lt;strong&gt;ColumnChart&lt;/strong&gt; and drag the data set into the designs node. You’ll get an AutoDesign that previews as …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_9ea9926a-a2d4-46a9-976c-f71dd0fb2969.png" width="1280" height="1024" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Ugh. Of course – didn’t address the original complaint. We haven’t identified which field to use for the category grouping. &lt;/p&gt;  &lt;p&gt;Go to the &lt;strong&gt;Index&lt;/strong&gt; field in the dataset&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_06c53034-fe05-467a-8cda-62d0ee2de4cc.png" width="199" height="127" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And set the &lt;strong&gt;Field Type&lt;/strong&gt; from &lt;strong&gt;Data&lt;/strong&gt; to &lt;strong&gt;Grouping&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_c5d02fa2-4835-46af-89be-a21961c709ea.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And now drag the dataset into the designs node and preview the report…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_468d2ffd-9a9a-4e33-9523-4679cc5f8778.png" width="683" height="505" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Fantastic – we have an ugly column chart. &lt;/p&gt;  &lt;p&gt;I can’t stand looking at this so let’s set a style template&lt;/p&gt;  &lt;p&gt;Find the chart element in the AutoDesign &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_7d93f9f0-cd02-4587-898f-58b5da4ca7f8.png" width="279" height="345" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And look at its properties. Under the &lt;strong&gt;Style Template&lt;/strong&gt; property you’ll notice there are two different Column Chart styles&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_c44fb111-2ba9-41ed-be1f-cd434a909fd1.png" width="291" height="334" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Let’s try the first one: ColumnChartStyleTemplate&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_e793148f-1bae-4915-b563-ca15736f4bec.png" width="291" height="334" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which gives this result …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_a727a00f-f669-47b7-bdcf-cfd4e1fc5944.png" width="684" height="507" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And the second one: ColumnChartStyleTemplateCC&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_873250a2-bf9c-4717-bf18-f873b948b912.png" width="291" height="336" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which gives … &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_317ddfc5-cc54-41a5-bea1-81bb56a508e0.png" width="673" height="503" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I like this one better. We’ll stick with it.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now that we are OK with the look of the chart. Let’s fix up the content of the chart.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Problem #1 – look at the Y axis – the smallest value on the axis 30. Why is that?&lt;/p&gt;  &lt;p&gt;This is an automatic behavior of the chart. In many cases we’d like to see the Y axis start at zero, of course. &lt;/p&gt;  &lt;p&gt;This behavior is controlled by a property on the chart …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_f3c0fa01-c7ab-4a46-9935-19cfd94dedd7.png" width="290" height="319" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But wait – it says the min value should be zero. What’s going on?&lt;/p&gt;  &lt;p&gt;If you click on the property … you’ll see that the property window contains some additional information.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_22998c07-d907-40db-b60a-246d6071fce6.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Ah, zero zero means “Auto” … so how do I get zero? My workaround is simple: I enter a very small value.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_fdd0c81c-e915-4aab-95c8-57a4a2f912da.png" width="290" height="319" /&gt; '&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which previews as …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_a6926506-aa32-406d-b602-c4f56a2d58f5.png" width="677" height="492" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Great – now the Y axis shows zero on the bottom. &lt;/p&gt;  &lt;p&gt;There is a corresponding property for the top of the Y axis&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_78e5618d-fa00-4fb0-a547-bd40a947657d.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It behaves similarly, Data Scale Min Value but for this example I’ll leave it alone.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Problem #2 – I can’t see the exact number of widgets.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To fix this you’ll have to expand the design nodes and underneath the chart, open the Data node and find the NumWidgets field.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_ee9b5cbe-4a84-46f6-b712-33fc0fb90cfd.png" width="250" height="183" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And look at its properties … specifically the &lt;strong&gt;Display Point Label&lt;/strong&gt; property&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_85d4e545-908f-4dc5-ac23-7ff1dae921b6.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It’s set to False by default, set it to True …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_c5663734-fdb9-476e-a166-e43d5a34b187.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And preview …&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_53bc683a-af7f-4783-b94d-afe8c5894526.png" width="683" height="491" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Excellent. We have a nice looking column chart&lt;/p&gt;  &lt;p&gt;To make it complete I’ll select a template for the report layout …&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_656df3fd-3031-4601-aa39-8c19cb1ed785.png" width="278" height="360" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_55f65006-18ad-4d4c-a9de-ca8d6e61e1f1.png" width="290" height="319" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which gives …&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheCol_87B1/image_a0ede705-c1a2-427f-b9e2-15c756ad9de6.png" width="728" height="580" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;SOURCE CODE&lt;/h2&gt;  &lt;p&gt;You can get it here: &lt;a title="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-02%7C6?view=details" href="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-02%7C6?view=details"&gt;http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-08-02%7C6?view=details&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9855707" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>Dynamics AX 2009: Business Intelligence – the Matrix Layout for Auto Design reports</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/07/29/dynamics-ax-2009-business-intelligence-the-matrix-layout-for-auto-design-reports.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/07/29/dynamics-ax-2009-business-intelligence-the-matrix-layout-for-auto-design-reports.aspx</id><published>2009-07-30T04:14:39Z</published><updated>2009-07-30T04:14:39Z</updated><content type="html">&lt;p&gt;Previously with Auto Design layouts, I left off with by saying that some required us to tweak the Datasets to get them to work. In this post, we’ll change the properties of the datasets and see how that enables the Matrix and chart layouts.&lt;/p&gt;  &lt;p&gt;First, we need more data. I’ve revised the my Data Method to return more patient data …&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;using System;     &lt;br /&gt;using System.Collections.Generic;      &lt;br /&gt;using System.Security.Permissions;      &lt;br /&gt;using System.Data;      &lt;br /&gt;using System.Linq; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;using Microsoft.Dynamics.Framework.Reports;     &lt;br /&gt;public partial class Report1      &lt;br /&gt;{ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; [DataMethod(), AxSessionPermission(SecurityAction.Assert)]     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public static System.Data.DataTable DataMethod_Patient_Data()      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int max_age = 60;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int min_age = 18; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int min_weight = 140; // weight in pounds     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int max_weight = 240; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var areas = new[] { &amp;quot;Thoracic Surgery&amp;quot;, &amp;quot;Emergency&amp;quot;, &amp;quot;ENT&amp;quot; };         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var doctors = new [] { &amp;quot;Reddy&amp;quot;, &amp;quot;Jackson&amp;quot;, &amp;quot;Tordilla&amp;quot; };&lt;/font&gt;&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var r = new System.Random();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var names = new string[] {&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Akuma&amp;quot;, &amp;quot;Ryu&amp;quot;, &amp;quot;Ken&amp;quot;,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Guile&amp;quot;, &amp;quot;M.Bison&amp;quot; ,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Chun-Li&amp;quot;, &amp;quot;Cammy&amp;quot; ,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Blanka&amp;quot;, &amp;quot;E.Honda&amp;quot;,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Gen&amp;quot;, &amp;quot;Birdie&amp;quot;, &amp;quot;Adon&amp;quot;,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Sagat&amp;quot;, &amp;quot;Dhalsim&amp;quot;, &amp;quot;Zangief&amp;quot;,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;Balrog&amp;quot;, &amp;quot;Vega&amp;quot;}; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var records = from name in names     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select new      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = name,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Age = r.Next(min_age, max_age),      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Weight = r.Next(min_weight, max_weight),      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Area = areas[ r.Next(0, areas.Length) ],         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Doctor = doctors [ r.Next(0, doctors.Length)] ,          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Hypertension = (r.NextDouble() &amp;gt; 0.9) ? true : false,          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Diabetes = (r.NextDouble() &amp;gt; 0.85) ? true : false,          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Asthma = (r.NextDouble() &amp;gt; 0.75) ? true : false&lt;/font&gt;&lt;/strong&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var datatable = Isotope.Data.DataUtil.DataTableFromEnumerable(records); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return datatable; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And then create a Data set that uses this Data method …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_7e4ab228-ade6-4831-8470-89476851f9e7.png" width="270" height="329" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And when I drag it into the Designs node a new Design is created which I renamed to AutoDesign_Table_0 and set the styles for the layout and the table. The results are this.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_066c52a0-fffb-4e5a-83fa-8555c9b5abc0.png" width="964" height="595" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Instead of modifying that Data set we will duplicate it using &lt;strong&gt;Copy&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_51a0126d-c653-4407-83df-d4e963d18273.png" width="366" height="440" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then &lt;strong&gt;Paste&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_6f5b1c71-7793-4233-9fba-dd23c9203a55.png" width="268" height="365" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which created this Dataset&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_219fe999-b91a-4ace-806c-5035f48cac23.png" width="268" height="365" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And I will rename this to “Dataset_PatientData_1”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_38074a2f-b063-4987-ac8a-152cfffc75e2.png" width="388" height="432" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_ffcbb053-7ce2-4f74-9b92-efefc85418e7.png" width="257" height="370" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And set the &lt;strong&gt;Default layout&lt;/strong&gt; to &lt;strong&gt;Matrix&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_ed8ba961-639c-44c0-b201-9320ec4f2979.png" width="292" height="323" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And now drag it into the &lt;strong&gt;Designs&lt;/strong&gt; node. A new AutoDesign is created. When you try to preview the design …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_106d2a4b-eddb-45e1-9ccd-fd132aaf58a2.png" width="1282" height="1026" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Obviously something is missing … let’s focus on the errors.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_609a24be-d424-44a9-b854-a869044288b8.png" width="987" height="65" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We obviously need to set something.&lt;/p&gt;  &lt;p&gt;For this report, let’s say we want have a question about the number patients, we want to know who is treating them and what these patients are doing at the hospital.&lt;/p&gt;  &lt;p&gt;In other words we want a matrix like this …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_b28980c3-396a-415f-ad07-285e3b431074.png" width="625" height="493" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Go back to the dataset, click on Doctor and look at the properties for the field&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_6152792b-e8cf-457c-8b54-d3284056f8e0.png" width="187" height="166" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The &lt;strong&gt;Grouping Type&lt;/strong&gt; is set to category which is what we want&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_85b44a47-0085-46a9-b578-320218ec0000.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But the &lt;strong&gt;Field Type&lt;/strong&gt; is set to Data. This we want to change.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_7232f801-0ecd-4154-9ee7-0bdc59d51377.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We’ll set it to &lt;strong&gt;Grouping&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_b9473446-bafc-44a6-b78c-21b6faf19bf0.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;OK, now the Doctor field is set up correctly.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_62bb1665-a62a-4a02-baea-55d5b38ee75e.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After this modification, If we try to drag the dataset into a design and preview we’ll see …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_ed3afe7a-9834-4bca-885f-4bf59adf595d.png" width="1282" height="1026" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is better, now there’s only one error …&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_6e9a4d48-8c2f-40c0-b50f-aaea9d448b0e.png" width="987" height="34" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We are still missing column groupings.&lt;/p&gt;  &lt;p&gt;We wanted the columns to be by “Area”, so let’s go to that field in the Data set&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_694b1627-1252-4201-ac8a-c4956374efe6.png" width="167" height="167" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And examine it’s properties. &lt;strong&gt;Grouping Type&lt;/strong&gt; is set to &lt;strong&gt;Category&lt;/strong&gt; - we want to change this to &lt;strong&gt;Series&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_c1d3ccc6-5550-4e84-839b-f75173633f3b.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_25b0ee5c-a327-4eb2-b509-5f39cb1be64c.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And &lt;strong&gt;Field type&lt;/strong&gt; is set to &lt;strong&gt;Data&lt;/strong&gt;. We’ll change this to &lt;strong&gt;Grouping&lt;/strong&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_6f16c82c-d431-4517-9102-800737714340.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_e3e6988c-1dfc-4404-a374-47fdf6f4d993.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now the data set is ready.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_8a4a0d7f-a2ac-433e-8bd8-1d75857fe991.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Drag the dataset on to the &lt;strong&gt;Designs&lt;/strong&gt; node and preview …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_e16cc7ab-2232-4493-ad5b-d297a328db45.png" width="1282" height="1026" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;At least preview works. &lt;/p&gt;  &lt;p&gt;But we need to fix this - we don’t want to see all the patient information, just the number of patients.&lt;/p&gt;  &lt;p&gt;A simple way of fixing this up is expand the newly-created design&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_40c30378-3751-4d5f-9c9a-b34d58d9e3e3.png" width="216" height="256" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And then remove the data fields we don’t care about – just leave the Name field&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_8d748f4a-be91-4401-b655-a7678cd07270.png" width="224" height="167" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If we drag preview the design now we will see …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_37d80262-85e5-4ed1-a063-26f68be6656f.png" width="652" height="181" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Which is better.&lt;/p&gt;  &lt;p&gt;Now we want to see the numbers of distinct patients, not their names.&lt;/p&gt;  &lt;p&gt;So field the name field in the design.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_e6eb67bc-5628-4dc9-be5c-61d85f67dcfa.png" width="217" height="167" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And examine its properties. We are going to focus on the &lt;strong&gt;Aggregate Function&lt;/strong&gt; from &lt;strong&gt;None&lt;/strong&gt; …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_c78616e6-9adf-47f3-bc45-bac82862d6e0.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;to &lt;strong&gt;CountDistinct&lt;/strong&gt;…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_e96fc95e-45d3-4cb1-8951-294c289e7da5.png" width="293" height="346" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now preview the report …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_88b0858d-f6a1-4b71-b36b-60e044f066ef.png" width="633" height="176" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Almost what we want. But it looks ugly. Let’s set the style templates and see what happens.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_772950de-34ed-4ed0-b90c-eee09d880689.png" width="732" height="291" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Almost done.&lt;/p&gt;  &lt;p&gt;Now we want to get rid of the “Name” on each column though.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_e039e8b0-3ddb-4ea8-896a-27e53edaec94.png" width="732" height="291" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Let’s look at the Name field in the design&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_7d3e0848-fe03-46bb-8109-69e3667adc84.png" width="211" height="167" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And examine its properties. We will change it’s &lt;strong&gt;Caption&lt;/strong&gt; property&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_2203b7f2-fdc4-4deb-8806-659c28729444.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;by removing the expression and leaving it blank&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_7ced038e-1318-4e12-8a56-5ce1679d6384.png" width="292" height="322" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now preview the report…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/saveenr/WindowsLiveWriter/DynamicsAX2009BusinessIntelligencetheMat_10072/image_e1c826b2-12c4-442b-af0b-5583ffd5ba88.png" width="739" height="266" /&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Done.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;SOURCE CODE&lt;/h2&gt;  &lt;p&gt;You can get it here: &lt;a title="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-07-29%7C6?view=details" href="http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-07-29%7C6?view=details"&gt;http://cid-19ec39cb500669d8.skydrive.live.com/browse.aspx/Public/Dev/SampleCode/Dynamics/SaveenR-Blog-Post-%7C52009-07-29%7C6?view=details&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9852753" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry><entry><title>A List of Tools for Automatic Graph and Diagram Layout</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saveenr/archive/2009/07/29/a-list-of-tools-for-automatic-graph-and-diagram-layout.aspx" /><id>http://blogs.msdn.com/saveenr/archive/2009/07/29/a-list-of-tools-for-automatic-graph-and-diagram-layout.aspx</id><published>2009-07-29T19:31:30Z</published><updated>2009-07-29T19:31:30Z</updated><content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Creating diagrams and graphs programmatically is one of passions. Below is a set of links you may find useful if you want to incorporate these techniques into your own applications. Where possible I’ve added licensing information.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;GraphViz&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.graphviz.org/" href="http://www.graphviz.org/"&gt;http://www.graphviz.org/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Made by: ATT&lt;/p&gt;    &lt;p&gt;License: Open Source CPL&lt;/p&gt;    &lt;p&gt;Notes: GraphViz is a set of native (unmanaged) applications (dot.exe, neato.exe, etc.). Using them from a .NET language means calling an EXE with text input and text output. &lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;Diagram.NET&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.dalssoft.com/diagram/" href="http://www.dalssoft.com/diagram/"&gt;http://www.dalssoft.com/diagram/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a title="http://code.google.com/p/diagramnet/" href="http://code.google.com/p/diagramnet/"&gt;http://code.google.com/p/diagramnet/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;License: Apache License 2.0 &lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;Microsoft Automatic Graph Layout&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://research.microsoft.com/en-us/projects/msagl/default.aspx" href="http://research.microsoft.com/en-us/projects/msagl/default.aspx"&gt;http://research.microsoft.com/en-us/projects/msagl/default.aspx&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;License: commercial (license is about $300)&lt;/p&gt;    &lt;p&gt;Notes: I’ve used this in my projects – relatively easy to use and produces great results. &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;July 2009&lt;/font&gt;&lt;/strong&gt;: there’s a &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/automaticgraphlayout/thread/ebe5c8b8-dbe2-4970-96f3-726bf3e7fd64"&gt;limited time promotion code for purchasing a license for only $99&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;ILOG Diagram for .NET&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.ilog.com/products/diagramnet/" href="http://www.ilog.com/products/diagramnet/"&gt;http://www.ilog.com/products/diagramnet/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;License: commercial&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;Flare &lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://flare.prefuse.org/" href="http://flare.prefuse.org/"&gt;http://flare.prefuse.org/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;License: BSD&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;UbiGraph&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://ubietylab.net/ubigraph/" href="http://ubietylab.net/ubigraph/"&gt;http://ubietylab.net/ubigraph/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;Omnigator&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.ontopia.net/omnigator/models/index.jsp" href="http://www.ontopia.net/omnigator/models/index.jsp"&gt;http://www.ontopia.net/omnigator/models/index.jsp&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;aiSee&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.aisee.com/" href="http://www.aisee.com/"&gt;http://www.aisee.com/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Graph#&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.codeplex.com/Wiki/View.aspx?ProjectName=graphsharp" href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=graphsharp"&gt;http://www.codeplex.com/Wiki/View.aspx?ProjectName=graphsharp&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Circos&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://mkweb.bcgsc.ca/circos/" href="http://mkweb.bcgsc.ca/circos/"&gt;http://mkweb.bcgsc.ca/circos/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;License: GPL&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Pajek - Program for Large Network Analysis&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://pajek.imfm.si/doku.php" href="http://pajek.imfm.si/doku.php"&gt;http://pajek.imfm.si/doku.php&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://vlado.fmf.uni-lj.si/pub/networks/pajek/" href="http://vlado.fmf.uni-lj.si/pub/networks/pajek/"&gt;http://vlado.fmf.uni-lj.si/pub/networks/pajek/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Cytoscape&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://cytoscape.org" href="http://cytoscape.org"&gt;http://cytoscape.org&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Piccolo&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.cs.umd.edu/hcil/piccolo/index.shtml" href="http://www.cs.umd.edu/hcil/piccolo/index.shtml"&gt;http://www.cs.umd.edu/hcil/piccolo/index.shtml&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Data Visualization Components from Microsoft Research&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://research.microsoft.com/en-us/downloads/dda33e92-f0e8-4961-baaa-98160a006c27/default.aspx" href="http://research.microsoft.com/en-us/downloads/dda33e92-f0e8-4961-baaa-98160a006c27/default.aspx"&gt;http://research.microsoft.com/en-us/downloads/dda33e92-f0e8-4961-baaa-98160a006c27/default.aspx&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;License: commercial&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Treemaps&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.cs.umd.edu/hcil/treemap/" href="http://www.cs.umd.edu/hcil/treemap/"&gt;http://www.cs.umd.edu/hcil/treemap/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.cs.umd.edu/hcil/photomesa/download/layout-algorithms.shtml" href="http://www.cs.umd.edu/hcil/photomesa/download/layout-algorithms.shtml"&gt;http://www.cs.umd.edu/hcil/photomesa/download/layout-algorithms.shtml&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Squarified Treemaps in XAML &amp;amp; C# using Microsoft Longhorn - &lt;a title="http://www.codeproject.com/KB/recipes/treemaps.aspx" href="http://www.codeproject.com/KB/recipes/treemaps.aspx"&gt;http://www.codeproject.com/KB/recipes/treemaps.aspx&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;QuickGraph&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.codeproject.com/KB/miscctrl/quickgraph.aspx?display=Print" href="http://www.codeproject.com/KB/miscctrl/quickgraph.aspx?display=Print"&gt;http://www.codeproject.com/KB/miscctrl/quickgraph.aspx?display=Print&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;License: &lt;strong&gt;zlib/png&lt;/strong&gt; license&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;NodeXL&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://www.codeplex.com/NodeXL" href="http://www.codeplex.com/NodeXL"&gt;http://www.codeplex.com/NodeXL&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9852265" width="1" height="1"&gt;</content><author><name>saveenr</name><uri>http://blogs.msdn.com/members/saveenr.aspx</uri></author></entry></feed>