{"id":72,"date":"2010-12-12T15:57:00","date_gmt":"2010-12-12T15:57:00","guid":{"rendered":"\/lisa\/post\/2010\/12\/12\/Everything-has-a-point-Part-Deux.aspx"},"modified":"2010-12-12T15:57:00","modified_gmt":"2010-12-12T15:57:00","slug":"everything-has-a-point-part-deux","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2010\/12\/12\/everything-has-a-point-part-deux\/","title":{"rendered":"Everything has a point, Part Deux"},"content":{"rendered":"<p><a title=\"blog post about group variables in SSRS\" href=\"\/lisa\/2010\/12\/04\/Everything-has-a-point-Part-Un\/\">Last week<\/a>, I told you about my recent discovery of a good reason to use group variables in SSRS. The requirement seemed simple, obvious, and could be given to you any time.<\/p>\n<p>This week, I&#8217;ll tell you about another standard scenario that really bugs me, and comes up pretty often, and how the Word renderer helped me resolve it.<\/p>\n<p>I&#8217;m calling this a &#8220;standard scenario&#8221;, not a &#8220;requirement&#8221;, for a reason.&nbsp; Here&#8217;s what happened to me &#8212; and I bet it happens to you, too:<\/p>\n<p>I had already fulfilled the requirements, and then somebody wanted to repurpose the report by analyzing the results in Excel, and had a minor anxiety attack.<\/p>\n<p>You don&#8217;t recognize this scenario, you say?&nbsp; I bet you will, once I illustrate it.<\/p>\n<h3>Here&#8217;s how it was<\/h3>\n<p>To illustrate, let&#8217;s take the following simple query (from <a title=\"LSN's SQLWorld db script\" href=\"http:\/\/spacefold.com\/wp-content\/downloads\/MSWorld.zip\" target=\"_blank\" rel=\"noopener\">my standard MS-SQL implementation of the MySQL World tutorial database<\/a>):<\/p>\n<p class=\"code\"><span style=\"color: #0000ff; \">SELECT<br \/><\/span><span style=\"color: #ff00ff; \">&nbsp; RTRIM<\/span><span style=\"color: #808080; \">(<\/span>City<span style=\"color: #808080; \">.<\/span>Name<span style=\"color: #808080; \">)<\/span> <span style=\"color: #0000ff; \">AS<\/span> CityName<span style=\"color: #808080; \">,<br \/><\/span>&nbsp;&nbsp;City<span style=\"color: #808080; \">.<\/span><span style=\"color: #0000ff; \">Population<\/span><span style=\"color: #808080; \">,<br \/><\/span><span style=\"color: #ff00ff; \">&nbsp;&nbsp;RTRIM<\/span><span style=\"color: #808080; \">(<\/span>Country<span style=\"color: #808080; \">.<\/span>Name<span style=\"color: #808080; \">)<\/span> <span style=\"color: #0000ff; \">AS<\/span> CountryName<span style=\"color: #808080; \">,<br \/><\/span>&nbsp; Country<span style=\"color: #808080; \">.<\/span>Continent<br \/><span style=\"color: #0000ff; \">FROM <br \/>&nbsp;&nbsp; <\/span>SQLWorld<span style=\"color: #808080; \">.<\/span>dbo<span style=\"color: #808080; \">.<\/span>City <span style=\"color: #808080; \">INNER<\/span>&nbsp;<span style=\"color: #808080; \">JOIN<br \/>&nbsp;&nbsp;&nbsp;<\/span>SQLWorld<span style=\"color: #808080; \">.<\/span>dbo<span style=\"color: #808080; \">.<\/span>Country <span style=\"color: #0000ff; \">ON <\/span>City<span style=\"color: #808080; \">.<\/span>CountryCode <span style=\"color: #808080; \">= <\/span>Country<span style=\"color: #808080; \">.<\/span>Code<\/p>\n<p>&nbsp;&#8230; We&#8217;ll express this as a simple table, grouped on Continent, and grouped within Continent by Country.&nbsp; We want to&nbsp;see Country populations as a total line for each Country group, and then be able to drill down into City details as needed.&nbsp; What could be more obvious?&nbsp;<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/WordRenditionSampleReportDesigntime.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/WordRenditionSampleReportRuntime.png\" alt=\"\" \/><\/p>\n<p>Okay, okay, the real report is more complex, sure, but this is the basic idea: Look at the aggregate, then optionally drill down to the details.&nbsp; That&#8217;s all.<\/p>\n<h3>So what&#8217;s the problem?<\/h3>\n<p>The first time&nbsp;a user&nbsp;decides to try&nbsp;the &#8220;Export to Excel&#8221; feature, they find out that they can&#8217;t easily sort by country population, filter by country, et cetera, because the Excel renderer preserves this report layout as outline levels.&nbsp;<\/p>\n<p>You may not be able to see the cities because the rows are hidden, but they&#8217;re there, and they&#8217;re interfering with what looked like an &#8220;obvious&#8221; extension use case for the original report.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/StandardExcelRendition.png\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The user in question was None Too Pleased.<\/p>\n<p>There now.&nbsp; Are you sure this has never happened to you?<\/p>\n<p>If it were really a simple report, it might be easy to create&nbsp;an aggregated version of the original report and export it without the detail lines, either as a simpler RDL or even as CSV.&nbsp; Do this additional query-plus-export&nbsp;to give this user a chance to analyze the data in Excel to his heart&#8217;s content.&nbsp; But it&#8217;s not really a simple report, is it?&nbsp;<\/p>\n<p class=\"NB\">In this case there happens to have been a lot of code and arrays that apply business logic both across and down, which create the subtotal results.&nbsp; They&#8217;re not really coming from the database at all, and it would be very difficult for them to be derived from straight SQL.&nbsp; This part may or may not have happened to you, and it&#8217;s not really relevant.&nbsp; You have a report, it has collapse and expand set, you&#8217;ve already put a lot of work into this report, and you&#8217;re not responsible for the hash that the Excel renderer makes of it.<\/p>\n<p>The fact is that the Excel renderer, while not exactly as dumb as a box of rocks, only fulfills one out of many reasons why people might want Excel exported a report.&nbsp; The requirement it fulfills is: give me something that looks like the fancy layout of the original report.&nbsp; The requirement it does not fulfill is: give me something that will function well for additional manipulation in Excel.<\/p>\n<p>The designers couldn&#8217;t do both, and they chose faithful reproduction of RDL appearance.&nbsp;&nbsp;They made&nbsp;a judgement call, and a reasonable one &#8212; I&#8217;ll explain why I think this, below, but I shouldn&#8217;t really have to explain and give you an alternative.&nbsp; Just imagine for a minute that the designers&nbsp;<strong>hadn&#8217;t<\/strong> made this choice.&nbsp; Now imagine&nbsp;what early reviewers would have said when the Excel export <strong>didn&#8217;t<\/strong> look like the RDL result.&nbsp; Now imagine what the designers&#8217; bosses would have thought of their design choice.<\/p>\n<h3>Oh my Word, what a rendition<\/h3>\n<p>Guess what?&nbsp; The Word renderer reproduces the collapsed layout more faithfully than Excel. If you leave everything collapsed in the Report Viewer interface when you Export to Word, you don&#8217;t get the detail.&nbsp; You get a Word table that looks like this:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"TEXT-ALIGN: center\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/StandardWordRendition.png\" alt=\"\" \/><\/p>\n<p style=\"TEXT-ALIGN: left\">That doesn&#8217;t immediately solve all your problems, unfortunately.&nbsp; The Word renderer may not look like it&#8217;s dumb as a box of rocks, but it really is.&nbsp; Sure, this is a table, and sure tables in Word can be sorted, etc.&nbsp; Just try it.<\/p>\n<p style=\"TEXT-ALIGN: left\">&nbsp;<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/WordRenditionTableTreatment.png\" alt=\"\" \/><\/p>\n<p style=\"TEXT-ALIGN: left\">Uh-oh.&nbsp; Well, NBD.&nbsp; They didn&#8217;t really want simple Word table tools anyway, right?&nbsp; They wanted all the nifty data-manipulation of Excel.&nbsp; So here is what you do:<\/p>\n<ul>\n<li>\n<div style=\"TEXT-ALIGN: left\">1 &#8211; Export to Word, see above.&nbsp; Assuming all groups are collapsed to start with, this gets rid of the detail rows, without going through manual or macro-driven work in Excel.<\/div>\n<\/li>\n<li>\n<div style=\"TEXT-ALIGN: left\">2 &#8211; Save the Word document As Filtered HTML.&nbsp; This will give you a relatively &#8220;cleansed&#8221; (compared to regular Word HTML) version of the output.<\/div>\n<\/li>\n<li>\n<div style=\"TEXT-ALIGN: left\">3 &#8211; Close the HTML document in Word&#8230; and open it in Excel.<\/div>\n<\/li>\n<li>\n<div style=\"TEXT-ALIGN: left\">4 &#8211; This new version will open as a simple table, without hidden or merged cells, ready for analysis. In my experience, it even tends to have fewer datatype problems than the &#8220;official&#8221; Excel export.<\/div>\n<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/WordSaveAsFilteredHTML.png\" alt=\"\" \/>&nbsp;<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/FilteredHTMLInExcel.png\" alt=\"\" \/><\/p>\n<h3>YAPS: What&#8217;s the <em>right<\/em> solution?<\/h3>\n<p>Well, it works. It kind of makes my skin crawl, but it works with the SSRS-native tools and actually gives me a reason to use the Word renderer in a pinch.&nbsp; Never saw that one coming.<\/p>\n<p>I didn&#8217;t have much time and much user patience left, on this occasion.&nbsp;&nbsp;I was honestly more interested in defending the ability of &#8220;native SSRS&#8221; to do a good job than in showing how a little custom code made all the difference.&nbsp; Some people think that, if you have to write&nbsp;anything custom, the tool itself is a failure. <strong>That&#8217;s hardly true<\/strong>, but I wasn&#8217;t in a position to argue at that moment.<\/p>\n<p>Here&#8217;s the argument I&#8217;d like to make, to you: The reason the designers&nbsp;could make the decision to have the Excel renderer handle the physical layout of the RDL as faithfully as possible is&#8230; drum roll&#8230; we can always get any Excel we want.&nbsp;<\/p>\n<p>We have the XML renderer, after all.&nbsp; It doesn&#8217;t care about presentation; it gives us the result of the RDL&#8217;s calculations (including all my arrays and custom business logic in the real report here).<\/p>\n<p>No matter how complex the inner workings of the report, and no matter how tortured the original RDL presentation, the XML output of an RDL is always pretty clear.&nbsp; Group levels are presented beautifully, simply, like this:&nbsp;<\/p>\n<p style=\"TEXT-ALIGN: center\"><img decoding=\"async\" src=\"\/lisa\/wp-non\/migrated\/2010\/12\/XMLRendition.png\" alt=\"\" \/><\/p>\n<p style=\"TEXT-ALIGN: left\">&#8230; and XSLT to parse out the summary details for each country, while ignoring the details, is never going to be more complicated than this (I&#8217;ve added a tiny bit of complexity to this version to try to make it extra-generic for you):<\/p>\n<p class=\"code\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&lt;?<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">xml<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">version<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8216;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">1.0<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8216;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">?&gt;<br \/>&lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:stylesheet<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">version<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">1.0<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">xmlns:xsl<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">http:\/\/www.w3.org\/1999\/XSL\/Transform<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:output<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">encoding<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">utf-8<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">method<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">html<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/&gt;<br \/>&lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:param<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">name<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">LevelsDown<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">select<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">6<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/&gt;<br \/><\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><br \/>&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:template<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">match<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">table<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">tr<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;&lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">th<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">Continent<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">th<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;&lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">th<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">Country<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">th<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;&lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">th<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">Total Pop<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">th<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;&lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">tr<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:apply-templates<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">select<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/\/*[count(ancestor-or-self::*) = $LevelsDown]<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;!&#8211;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #008000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #008000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #008000; font-size: x-small;\"> doing it this way to suit however many nested details <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; you might have in your version, instead of some<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; explicit statement like<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:apply-templates select=&#8221;\/*\/*\/*\/*&#8221;\/&gt;<br \/><\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#8211;&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">table<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:template<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<\/p>\n<p>&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:template<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">match<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">*<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">tr<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">td<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:value-of<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">select<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">..\/..\/@*<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/&gt; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">td<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">td<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:value-of<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">select<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">.\/@*[1]<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/&gt;&nbsp; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">td<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">td<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt; &lt;<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:value-of<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"> <\/span><\/span><\/span><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\"><span style=\"font-family: Consolas; color: #ff0000; font-size: x-small;\">select<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">=<\/span><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">.\/@*[2]<\/span><\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><a href=\"mailto:.\/@*[2]%22%3E%3C\/a%3E%3C\/td\"><\/a><\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><a href=\"mailto:.\/@*[2]%22%3E%3C\/a%3E%3C\/td\"><\/a><\/span><\/span><span style=\"font-family: Consolas; font-size: x-small;\"><span style=\"font-family: Consolas; font-size: x-small;\">&#8220;<\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">\/&gt;&nbsp; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">td<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp; &nbsp;&nbsp; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\"><span style=\"font-family: Consolas; color: #a31515; font-size: x-small;\">tr<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<br \/>&nbsp;&nbsp; &lt;\/<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:template<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<\/span><\/span><\/span><br \/><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&lt;\/<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\"><span style=\"font-family: Consolas; color: #2b91af; font-size: x-small;\">xsl:stylesheet<\/span><\/span><\/span><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&gt;<\/span><\/span><\/span><br \/><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\"><span style=\"font-family: Consolas; color: #0000ff; font-size: x-small;\">&nbsp;<\/span><\/span><\/span><\/p>\n<p>&#8230;. as you can see, I&#8217;m not even bothering to create SSML here.&nbsp; All we need is a simple table for Excel to consume, just as Word produced.&nbsp; HTML output is going to do find, and it is dead simple to produce in XSLT.&nbsp;<\/p>\n<p>I&#8217;ve shown you in other posts <a title=\"First blog post on Excel through XSLT in SSRS\" href=\"\/lisa\/2007\/10\/03\/Changing-the-Sheet-names-in-SQL-Server-RS-Excel-QnD-XSLT\/\">how to attach&nbsp;the XSLT&nbsp;directly to the RDL<\/a> if you want this result directly from Report Manager, although that&#8217;s hardly the sticking poiint for most people, and <a title=\"blog post on processing with XSLT without attaching to the RDL\" href=\"\/lisa\/2007\/10\/28\/After-you-learn-to-walk-you-can-run-a-postscript-to-the-QnD-XSLT-walkthrough\/\">how to do more when you&#8217;re ready<\/a>&nbsp;.<\/p>\n<p>I am entirely sick of hearing that&nbsp;XSLT is &#8220;too much of a learning curve&#8221;, &nbsp;from the&nbsp;exact same people who are currently extolling the virtues of other functional languages &#8212; learning curve or no &#8212; to the skies.<\/p>\n<p>That&#8217;s right, people.&nbsp; XSLT is a declarative, functional language.&nbsp; Complete with immutable variables, no side effects, the works.&nbsp; Just get over yourselves and get some of this goodness working with your reporting implementations.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week, I told you about my recent discovery of a good reason to use group variables in SSRS. The requirement seemed simple, obvious, and could be given to you any time. This week, I&#8217;ll tell you about another standard scenario that really bugs me, and comes up pretty often, and how the Word renderer<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2010\/12\/12\/everything-has-a-point-part-deux\/\">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,10],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-reporting","category-xml-xslt"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/72","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=72"}],"version-history":[{"count":0,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}