{"id":94,"date":"2009-11-08T16:27:00","date_gmt":"2009-11-08T16:27:00","guid":{"rendered":"\/lisa\/post\/2009\/11\/08\/Beginning-to-documenting-RDLsRDLCs-in-RS-2008.aspx"},"modified":"2021-08-30T13:20:30","modified_gmt":"2021-08-30T20:20:30","slug":"beginning-to-documenting-rdls-rdlcs-in-rs-2008","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2009\/11\/08\/beginning-to-documenting-rdls-rdlcs-in-rs-2008\/","title":{"rendered":"Beginning to documenting RDLs\/RDLCs in RS 2008"},"content":{"rendered":"<p>I&#8217;ve been <a title=\"blog post introducing this topic\" href=\"\/lisa\/2009\/08\/09\/And-then-there-were-two\/\" target=\"_blank\" rel=\"noopener\">trying to work my way up<\/a> to a full-blown RS 2008 RDL Documenter implementation. (Better do it before RS 2010 is out&#8230;)<\/p>\n<p>While C was visiting\u00a0family a few weeks ago, I made a start on the complete rewrite of the Designer widget that will be\u00a0necessary. I&#8217;ve also slightly upgraded the TestHarness application so that it comes with a 2008 Compact\u00a0sample db, if you want to\u00a0use it.<\/p>\n<p>The Designer widget is necessary if you want to add custom documentation, to RDLs, and have output documentation files that are similar to XML Comments for your other code files. This concept, which I call XMLRSDocs, was central to my<a title=\"Introduction to XMLRSDocs\" href=\"\/lisa\/2007\/08\/03\/Introducing-XMLRSDocs-and-RDLDocumenter\/\" target=\"_blank\" rel=\"noopener\"> original drive to write the tool<\/a>. It really bugs me that a <a title=\"Blog post on declarative languages\" href=\"\/lisa\/2007\/10\/07\/XSLT-and-other-declarative-languages-neither-elven-bread-nor-kibble\/\" target=\"_blank\" rel=\"noopener\">declarative\u00a0module<\/a>, which is what the RDL format is, can&#8217;t have XML Comments like other application components.<\/p>\n<p>But our team has been working a lot with RS 2008 semantic models, and we have a\u00a0significant need to document the attributes and entities being used\u00a0in multiple reports, before doing an upgrade. (Wow, how unusual: data and the need to document it are driving my work&#8230;)<\/p>\n<p>The work I&#8217;ve already done, for that purpose, is good enough to give some results, with really minor changes for RS 2008.<\/p>\n<p>As a result, you can now pick up an RS-2008-usable version of this tool from our <a title=\"Spacefold download page\" href=\"\/downloads-index\/\" target=\"_blank\" rel=\"noopener\">Spacefold downloads<\/a> page.<\/p>\n<h3><\/h3>\n<h3>What is critical, and\u00a0already done?<\/h3>\n<p>Very little has changed so far.<\/p>\n<p>There is a 2008-valid\u00a0extraction XSLT &#8212; not done, but done enough &#8212; that will work with RS 2008 RDLs. RDLs in RS 2008 have a new namespace, and that&#8217;s all I&#8217;ve changed so far.\u00a0 I haven&#8217;t upgraded the code to recognize the tablix data region type, and numerous other enhancements.\u00a0 For our purposes, we really only care that the data elements get in.\u00a0 I&#8217;ll upgrade the XSLT for layout elements later.<\/p>\n<p>To get a picture of the fields in use in reporting datasets, which is what we really need right now for our team, you only need to get the embedded information into a database so you can query it properly.<\/p>\n<p>I&#8217;ve added a new button to\u00a0TestHarness, to load a full folder of RDL\/RDLCs to a server at once, if you&#8217;re storing your results in the Compact db. But TestHarness is more of a teaching device where all of the elements of RDL Documenter come together in one place.\u00a0 In this release, I&#8217;ve also added the production-grade SSIS package into the deployment set of files now, and this is what you would normally want to use.<\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" title=\"XMLRSDocs package\" src=\"\/wp-content\/include-me\/XMLRSDocs_images\/SSIS2.png\" alt=\"XMLRSDocs package\" \/><\/div>\n<p>I don&#8217;t consider myself an SSIS expert, so earlier I just described the steps in the package, and didn&#8217;t include it in the delivered files earlier.\u00a0 But, for whatever it&#8217;s worth, you have my idea of this somewhat-unique set of steps now.<\/p>\n<h3><\/h3>\n<h3>What&#8217;s not done?<\/h3>\n<p>You&#8217;ll find that each sub-dir of the zip file has a readme saying, basically, &#8220;this isn&#8217;t done yet&#8221;.<\/p>\n<p>The Designer widget was fun and exciting the first time; who wouldn&#8217;t get a thrill out of integrating something directly into the IDE? But\u00a0I really can&#8217;t get up for it now, especially since the\u00a0Custom Properties\u00a0for individual report layout items and the &#8220;global&#8221; report\u00a0is now much better exposed, even by Report Builder.<\/p>\n<p>TestHarness really doesn&#8217;t need much work.\u00a0 I will provide more exiting RDLCs for it, when I expand the supported db schema &#8212; see below &#8212; but really the &#8220;shape&#8221; of the standard RDL elements as they are ported into your db schema was never very important to me.\u00a0 The package supports whatever you want to do here.\u00a0 My real interest was adding custom doc information, which was woefully hard to do.\u00a0 How you choose to store and display that information should be up to you &#8212; that&#8217;s the whole point.\u00a0 The SSIS package just shows you the key actions I expect to be necessary, and a couple of key output types (XML and documenting reports).\u00a0But the package should let you move your RDLs right into <a title=\"Sandcastle project\" href=\"http:\/\/www.codeplex.com\/SHFB\" target=\"_blank\" rel=\"noopener\">whatever you&#8217;re doing with your other XML Comments<\/a>.\u00a0 I hope.<\/p>\n<p>I expect that I will be expanding this sample package to load information from SMDLs into a separate table at some point.\u00a0 Compared to messing around with RDLs, it should really easy to extract\u00a0attribute and entity GUIDs and Names, to tie them directly to report usage later.\u00a0 I could get a simple list of all Entity-Attribute combinations, showing both names and GUIDs, with this single XPATH statement:<\/p>\n<p class=\"code\">\/*\/*\/*\/*\/*:Attribute\/concat(..\/..\/*:Name,<span class=\"c4ZSSG\"><span style=\"color: #800080;\">&#8216; (&#8216;<\/span><\/span>,..\/..\/@ID,<span class=\"c4ZSSG\"><span style=\"color: #800080;\">&#8216;)&#8221; &#8211; &#8216;<\/span><\/span>,.\/*:Name,<span class=\"c4ZSSG\"><span style=\"color: #800080;\">&#8216; (&#8216;<\/span><\/span>,@ID,<span class=\"c4ZSSG\"><span style=\"color: #800080;\">&#8216;)&#8217;<\/span><\/span>)<\/p>\n<p>&#8230; which would look something like:<\/p>\n<ul class=\"dummy\">\n<li class=\"dummy\">Glossary\u00a0(Gb355f720-11df-43d9-9b6d-f9e863abde4b)&#8217; &#8211; Term\u00a0(G4a1f954b-13eb-48cd-b75a-c538c0efd0ba)<\/li>\n<li class=\"dummy\">Glossary (Gb355f720-11df-43d9-9b6d-f9e863abde4b)&#8217; &#8211; Institution (G58288fcd-1422-47dc-b9d7-c3c4062e8f5c)<\/li>\n<li class=\"dummy\">Glossary (Gb355f720-11df-43d9-9b6d-f9e863abde4b)&#8217; &#8211; Date Time Created (G7db0f4e0-74e7-4cc1-a91b-c069bb4b24aa)<\/li>\n<li class=\"dummy\">Glossary (Gb355f720-11df-43d9-9b6d-f9e863abde4b)&#8217; &#8211; Date Time Modified (G04c93e2b-173f-4272-b402-7d2e96746b05)<\/li>\n<li class=\"dummy\">Glossary (Gb355f720-11df-43d9-9b6d-f9e863abde4b)&#8217; &#8211; Note (G6d8953ff-3ab3-44e6-9e46-86dd151677c4)<\/li>\n<\/ul>\n<p>This and other ideas, plus a quick-start guide to use, are in the readme for the package.\u00a0 But, for now,\u00a0our team will be able to run the package as-is and then list the information relevant to their needs simply by doing this:<\/p>\n<p class=\"code\"><span style=\"color: #0000ff;\">SELECT<\/span> RDLFileName<span style=\"color: #808080;\">, <\/span>RDLLayoutParentName<span style=\"color: #808080;\">, <\/span>Value<br \/>\n<span style=\"color: #0000ff;\">\u00a0 FROM<\/span> [Test]<span style=\"color: #808080;\">.<\/span>[dbo]<span style=\"color: #808080;\">.<\/span>[RDLDocPrimary]<br \/>\n<span style=\"color: #0000ff;\">\u00a0 WHERE<\/span> RDLLayoutType <span style=\"color: #808080;\">=<\/span> <span style=\"color: #ff0000;\">&#8216;Field&#8217;<\/span> <span style=\"color: #0000ff;\">ORDER BY<\/span> 2<span style=\"color: #808080;\">,<\/span> 3<\/p>\n<p>&#8230; and they can do fancy things by shredding the semantic model query directly out of CommandText if they want to:<\/p>\n<p class=\"code\"><span style=\"color: #008000;\">&#8212; base query for talking to the XML that forms<br \/>\n<\/span><span style=\"color: #008000;\">&#8212; each semantic model query&#8230;<\/span><br \/>\n<span style=\"color: #0000ff;\">SELECT<\/span> RDLFileName<span style=\"color: #808080;\">,<\/span> RDLLayoutParentName<span style=\"color: #808080;\">,<\/span><br \/>\n<span style=\"color: #ff00ff;\">\u00a0\u00a0 CONVERT<\/span><span style=\"color: #808080;\">(<\/span><span style=\"color: #0000ff;\">xml<\/span><span style=\"color: #808080;\">,<\/span>Value<span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> XmlQueryable<br \/>\n<span style=\"color: #0000ff;\">FROM<\/span> RDLDocPrimary <span style=\"color: #0000ff;\">WHERE<\/span> RDLLayoutType <span style=\"color: #808080;\">=<\/span> <span style=\"color: #ff0000;\">&#8216;CommandText&#8217;<\/span><\/p>\n<p><span style=\"color: #008000;\">&#8212; a list of all lead entities and their guids&#8230;<\/span><br \/>\n<span style=\"color: #0000ff;\">SELECT<\/span> RDLFileName<span style=\"color: #808080;\">,<\/span> RDLLayoutParentName<span style=\"color: #808080;\">,<\/span><br \/>\n<span style=\"color: #ff00ff;\">\u00a0\u00a0 CONVERT<\/span><span style=\"color: #808080;\">(<\/span><span style=\"color: #0000ff;\">xml<\/span><span style=\"color: #808080;\">,<\/span>Value<span style=\"color: #808080;\">).<\/span>value<span style=\"color: #808080;\">(<\/span><span style=\"color: #ff0000;\">&#8216;(\/\/*:Grouping\/@Name)[1]&#8217;<\/span><span style=\"color: #808080;\">,<\/span><span style=\"color: #ff0000;\">&#8216;NVARCHAR(300)&#8217;<\/span><span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> Entity<span style=\"color: #808080;\">,<br \/>\n<\/span><span style=\"color: #ff00ff;\">\u00a0\u00a0 CONVERT<\/span><span style=\"color: #808080;\">(<\/span><span style=\"color: #0000ff;\">xml<\/span><span style=\"color: #808080;\">,<\/span>Value<span style=\"color: #808080;\">).<\/span>value<span style=\"color: #808080;\">(<\/span><span style=\"color: #ff0000;\">&#8216;(\/\/*:Grouping\/*\/*\/*:EntityID)[1]&#8217;<\/span><span style=\"color: #808080;\">,<\/span><span style=\"color: #ff0000;\">&#8216;NVARCHAR(300)&#8217;<\/span><span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> EntityGUID<br \/>\n<span style=\"color: #0000ff;\">FROM<\/span> RDLDocPrimary <span style=\"color: #0000ff;\">WHERE<\/span> RDLLayoutType <span style=\"color: #808080;\">=<\/span> <span style=\"color: #ff0000;\">&#8216;CommandText&#8217;<br \/>\n<\/span><span style=\"color: #0000ff;\">\u00a0\u00a0 ORDER<\/span> <span style=\"color: #0000ff;\">BY<\/span> 1<span style=\"color: #808080;\">,<\/span>2<span style=\"color: #808080;\">,<\/span>3<\/p>\n<p><span style=\"color: #008000;\">&#8212; a list of all attribute in use&#8230;<\/span><br \/>\n<span style=\"color: #0000ff;\">SELECT<\/span> <span style=\"color: #0000ff;\">DISTINCT<br \/>\n<\/span><span style=\"color: #ff00ff;\">\u00a0\u00a0 ISNULL<\/span><span style=\"color: #808080;\">(<\/span>Ents<span style=\"color: #808080;\">.<\/span>value<span style=\"color: #808080;\">(<\/span><span style=\"color: #ff0000;\">&#8216;(..\/@Name)[1]&#8217;<span style=\"color: #808080;\">,<\/span>&#8216;NVARCHAR(300)&#8217;<span style=\"color: #808080;\">),<\/span>&#8216;CalcExpr&#8217;<\/span><span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> AttributeName<span style=\"color: #808080;\">,<br \/>\n<\/span>\u00a0\u00a0 Ents<span style=\"color: #808080;\">.<\/span>value<span style=\"color: #808080;\">(<\/span><span style=\"color: #ff0000;\">&#8216;(.\/*:AttributeID)[1]&#8217;<\/span><span style=\"color: #808080;\">,<\/span><span style=\"color: #ff0000;\">&#8216;NVARCHAR(300)&#8217;<\/span><span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> AttributeGuid<br \/>\n<span style=\"color: #0000ff;\">FROM <\/span><span style=\"color: #808080;\">(<\/span><span style=\"color: #0000ff;\">SELECT<\/span> <span style=\"color: #ff00ff;\">CONVERT<\/span><span style=\"color: #808080;\">(<\/span><span style=\"color: #0000ff;\">xml<\/span><span style=\"color: #808080;\">,<\/span>Value<span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> XmlQueryable <span style=\"color: #0000ff;\">FROM<\/span> RDLDocPrimary<br \/>\n<span style=\"color: #0000ff;\">\u00a0\u00a0 WHERE<\/span> RDLLayoutType <span style=\"color: #808080;\">=<\/span> <span style=\"color: #ff0000;\">&#8216;CommandText&#8217;<\/span> <span style=\"color: #808080;\">)<\/span> RDL1<br \/>\n<span style=\"color: #808080;\">CROSS<\/span> <span style=\"color: #808080;\">APPLY<\/span><br \/>\nXmlQueryable<span style=\"color: #808080;\">.<\/span>nodes<span style=\"color: #808080;\">(<\/span><span style=\"color: #ff0000;\">&#8216;\/\/*:AttributeRef&#8217;<\/span><span style=\"color: #808080;\">)<\/span> <span style=\"color: #0000ff;\">AS<\/span> RDL2<span style=\"color: #808080;\">(<\/span>Ents<span style=\"color: #808080;\">)<\/span><br \/>\n<span style=\"color: #0000ff;\">ORDER<\/span> <span style=\"color: #0000ff;\">BY<\/span> 1<br \/>\n<span style=\"color: #008000;\">&#8212; so far the above includes filters and query fields,<br \/>\n&#8212; I&#8217;ve not worked out that it includes everything possible, but it<br \/>\n&#8212; should be close<\/span><\/p>\n<h4><\/h4>\n<h3>So Wise for one so young<\/h3>\n<p>Long way to go, but this should help <a title=\"Other talk about Wisdom on this blog\" href=\"\/lisa\/2008\/12\/20\/Sensitivity-versus-Consistency-in-Global-Communication\/\" target=\"_blank\" rel=\"noopener\">Wisdom<\/a> and the team figure out the\u00a0impact of a model change on existing RDLs.<\/p>\n<p>Meanwhile, Wisdom&#8217;s working on the companion SSIS Doc Generator for the team that I <a title=\"The origin story for SSIS Doc Generator, being written by Wisdom Guo\" href=\"\/lisa\/2009\/08\/09\/And-then-there-were-two\/\" target=\"_blank\" rel=\"noopener\">suggested<\/a> to him.\u00a0 Maybe he&#8217;ll let me borrow it to properly document all the XMLRSDocs ETL package options\u00a0before my next upload.<\/p>\n<p>As he would say, although maybe he&#8217;s picked it up from me, <strong>so far, so good.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been trying to work my way up to a full-blown RS 2008 RDL Documenter implementation. (Better do it before RS 2010 is out&#8230;) While C was visiting\u00a0family a few weeks ago, I made a start on the complete rewrite of the Designer widget that will be\u00a0necessary. I&#8217;ve also slightly upgraded the TestHarness application so<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2009\/11\/08\/beginning-to-documenting-rdls-rdlcs-in-rs-2008\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6,7,10,11],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-reporting","category-sql-server","category-ssis","category-xml-xslt","category-xmlrsdocs"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":2,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":390,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/94\/revisions\/390"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}