{"id":135,"date":"2008-03-22T15:29:00","date_gmt":"2008-03-22T15:29:00","guid":{"rendered":"\/lisa\/post\/2008\/03\/22\/Another-postscript-to-QnD-Excel-in-RS-post.aspx"},"modified":"2008-03-22T15:29:00","modified_gmt":"2008-03-22T15:29:00","slug":"another-postscript-to-qnd-excel-in-rs-post","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2008\/03\/22\/another-postscript-to-qnd-excel-in-rs-post\/","title":{"rendered":"Another postscript to QnD Excel-in-RS post"},"content":{"rendered":"<p>\nI have been really gratified by the feedback people have given me about my original post showing <a href=\"\/lisa\/2007\/10\/03\/Changing-the-Sheet-names-in-SQL-Server-RS-Excel-QnD-XSLT\/\" title=\"QnD Excel in RS blog post\">how to change sheet names in Reporting Services-driven Excel using XSLT<\/a>. Lots of people have written to say thanks, and I appreciate it.\n<\/p>\n<p>\nNot much feedback about <a href=\"\/lisa\/2007\/10\/28\/After-you-learn-to-walk-you-can-run-a-postscript-to-the-QnD-XSLT-walkthrough\/\" title=\"Blog post about XSLT use in more scenarios\">my followup post<\/a>, which tried to show how you can easily integrate transformations into more scenarios, pretty much no matter what environment you work in.&nbsp; That&#39;s a pity &#8212; it means people still think this is harder than it is.\n<\/p>\n<p>\nSo I thought I would share one more thing on this subject today&#8230;\n<\/p>\n<p>\nI just had occasion to use this RS-Excel trick myself, for a colleague on my <span class=\"ecwLogoRef\"><strong><span style=\"color: #ff6600\">EC<\/span><span style=\"color: #808080\">|<\/span><\/strong><span class=\"ecwLogoBlack\"><strong>Wise <\/strong><\/span><\/span>team.&nbsp; FWIW I don&#39;t use XSLT mappers or anything visual when I code, it just isn&#39;t my style (no pun intended)&#8230; but I do use both <a href=\"http:\/\/www.altova.com\/\" target=\"_blank\" title=\"Altova-XML Spy\" rel=\"noopener\">XML Spy<\/a> and <a href=\"http:\/\/www.stylusstudio.com\/\" target=\"_blank\" title=\"Stylus Studio\" rel=\"noopener\">Stylus Studio<\/a>&nbsp;as IDEs,&nbsp;and they&nbsp;both have some pretty spiffy diagramming tools.&nbsp;\n<\/p>\n<p class=\"NB\">\nNote to any Fox people reading: XML Spy generated the VFP-RDL diagrams you see in the helpfile under <em>Using VFP Report Output XML<\/em>. MS re did the images but for the life of me I can&#39;t see the difference from what I turned in. <\/p>\n<p>Note for anybody reading and considering a purchase: other than that particular form of diagram, in my opinion Stylus Studio wins, hands-down.\n<\/p>\n<p>\nSo, anyway.&nbsp; I decided to turn on&nbsp;Stylus Studio&#39;s&nbsp;XSLT mapper view, just for kicks.&nbsp;&nbsp;It gave me a&nbsp;great&nbsp;way to&nbsp;show my team, and you,&nbsp;how <em>little<\/em> of the original Excel SSML has to be dynamically driven by the&nbsp;RS data XML export.&nbsp; Most of the workbook you just copy directly from what your Excel example tells you it should look like.\n<\/p>\n<div style=\"text-align: center\">\n<img loading=\"lazy\" decoding=\"async\" style=\"width: 516px; height: 486px\" src=\"\/lisa\/wp-non\/migrated\/StylusStudioQnDExcel.png\" alt=\"Stylus Studio mapping for Excel from RS XML data export\" title=\"Stylus Studio mapping for Excel from RS XML data export\" width=\"516\" height=\"486\" \/>\n<\/div>\n<p>\nEven the part you do have to dynamically drive isn&#39;t hard at all to do, as I hope my walkthrough showed.&nbsp; The particular instance I did this morning had a number of wrinkles, including two tables and a number of grouping levels to be taken care of besides the one that explicitly determines page breaks.&nbsp; (You can probably see that in the screen shot.)&nbsp;&nbsp; It also happens to be a situation, alluded to in my&nbsp;walkthrough,&nbsp;where you have to be careful that your dynamically-driven tab names are actually <em>legal<\/em> tab names in Excel.&nbsp; In this case, I used the following code to validate and change the tab names if necessary:\n<\/p>\n<p>\n<span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">xsl:template <\/span><span style=\"color: #d00020\">name=<\/span><span style=\"color: #000090\">&quot;StripSheetName&quot;<\/span><span style=\"color: #0000ff\">&gt;<br \/>\n<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">xsl:param <\/span><span style=\"color: #d00020\">name=<\/span><span style=\"color: #000090\">&quot;item&quot;<\/span><span style=\"color: #d00020\">\/<\/span><span style=\"color: #0000ff\">&gt;<br \/>\n<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">xsl:variable <\/span><span style=\"color: #d00020\">name=<\/span><span style=\"color: #000090\">&quot;i1&quot;<\/span><span style=\"color: #0000ff\">&gt;<br \/>\n<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">xsl:value-of <\/span><span style=\"color: #d00020\">select=<\/span><span style=\"color: #000090\">&quot;translate($item,&#39;&amp;quot;&ldquo;&rdquo;&#39;,&#39;&#39;)&quot;<\/span><span style=\"color: #d00020\">\/<\/span><span style=\"color: #0000ff\">&gt;<br \/>\n<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">\/xsl:variable<\/span><span style=\"color: #0000ff\">&gt;<br \/>\n<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">xsl:value-of <\/span><span style=\"color: #d00020\">select=<\/span><span style=\"color: #000090\">&quot;translate($i1,&amp;quot;\/\\&#39;&amp;quot;,&amp;quot;&amp;quot;)&quot;<\/span><span style=\"color: #d00020\">\/<\/span><span style=\"color: #0000ff\">&gt;<br \/>\n<\/span><span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #ac306d\">\/xsl:template<\/span><span style=\"color: #0000ff\">&gt;<\/span>\n<\/p>\n<p>\n&#8230; looks a bit wierd and it may not turn out to be sufficient, but basically all I&#39;m doing is taking out characters I know to be illegal.&nbsp; If I find more, I&#39;ll add more.\n<\/p>\n<p>\nSo this was&nbsp;sort of a gnarly case, with some extra work. But,&nbsp;even so, as I do&nbsp;this work,&nbsp;<strong>I really marvel at the cleanliness of the RS data export XML<\/strong>.&nbsp; It makes things incredibly easy to do.&nbsp;\n<\/p>\n<p>\nYou don&#39;t need to indulge in Muenchian grouping or anything weird to figure out how to handle subtotals and groups; it&#39;s all right there the way you most want it to be. I love that in a dialect.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been really gratified by the feedback people have given me about my original post showing how to change sheet names in Reporting Services-driven Excel using XSLT. Lots of people have written to say thanks, and I appreciate it. Not much feedback about my followup post, which tried to show how you can easily<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2008\/03\/22\/another-postscript-to-qnd-excel-in-rs-post\/\">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,10],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-reporting","category-sql-server","category-xml-xslt"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/135","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=135"}],"version-history":[{"count":0,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}