Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

Menu

Skip to content
  • Home
  • My Books
  • Presentations
  • Best Practice Resources: Blogs & Books from the Experts
  • Video Tutorials
  • COVID-19 Daily Updates Report
  • Visualizations
  • About/Bio
  • Paul’s Bio
  • Note to SPAMers

Tag Archives: HTML text

Rich Embedded Text Formatting in Reports

January 11, 2011 by Paul Turley

4

I’ve recently come to realize what a truly remarkable feature it is to be able to format report text using simple HTML tags.  This capability was added to Reporting Services in SQL Server 2008.  Prior to this, all of the text in a textbox could be formatted with a font size, bold, italic or what not – but these properties were applied to all of the text in the textbox.  Now, the contents of any textbox can be either behave as it used to or the contents of a textbox can be converted to a placeholder for rich-formatted text.

Working on a client’s project, several reports need to be localized.  It’s not so much that reports need to show information in different languages but elements like the company subsidiary name, division and contact information are different in various regions of the world where this company conducts business.  On contracts and invoices, the legal terms and disclaimers are different because of regional laws and different business practices.  In the past, they have created different reports for each region – which has been a high cost maintenance issue.

I’ve created only one version of each report to be localized using a Region parameter.  There’s one Invoice, Quote report and Job Information sheet report.  I created a table in the database containing fields to store the report name, the name of the text block, the region and the HTML formatted text for the region-specific text block.  In the report, I use a simple dataset with a query that returns the text for that report using these fields and the parameterized region in the WHERE clause.  It’s a simple but elegant solution to an otherwise complex problem.

Reporting Services supports a short list of simple HTML tags for embedded or data bound rich text.  These include:

· Hyperlinks: <A href>

· Fonts: <FONT>

· Header, style and block elements: <H{n}>, <DIV>, <SPAN>,<P>, <DIV>, <LI>, <HN>

· Text format: <B>, <I>, <U>, <S>

· List handling: <OL>, <UL>, <LI>

Detailed instructions for this feature are available in the online MSDN library.

What?  No CSS Support?

One of the constants in the universe is that when a new feature is added to a software application, a lot of users and customers will immediately complain and demand that the feature be improved to meet some greater need.  To this I say quit your whining and be grateful for what you you have.  This is what my parents used to say before they shared stories about walking up hill in the snow both ways to and from school.  Many reporting products don’t have anything close to this.  When this feature was added, the product team made it a point to keep this feature simple while giving us some very useful capabilities.  

I recently needed to include a rich-formatted legal disclaimer as an ordered number list with multiple levels of subordinate numbered levels.  I know that as a web designer, this kind of thing can be managed in greater detail using CSS styles which are not supported by SSRS.  The trick in my case was to get the right combination of nested <LI> and <OL> tags.  The following combination did the trick:

<ol>

<li>First item</li>

<li>Second item

<ol>

<li>First child of second item</li>

<li>Second child of second item</li>

</ol>

</li>

<li>Third item</li>

</ol>

…which produces:

1. First item

2. Second item

    i.    First child of Second item

    ii.   Second child of second item

3. Third item

Why doesn’t this feature support Cascading Style Sheets?  Simple… the embedded HTML is not ever parsed by the web browser.  These tags are read by the core report rendering engine which translates the inline tags to static text elements and then outputs the appropriate content to the appropriate rendering extension.  This means that, like most report features, the rich formatted text is going to work the same way in reports rendered to PDF, Excel, Word, an image, print or any web browser because the report content is rendered on the server, rather than in a web browser.

Thanks to Andrew Karcher, Thiago Silva and Robert Bruckner for their contributions.

Share this:

  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Reddit (Opens in new window)

Like this:

Like Loading...
Posted in SQL Syndication, SSRS Design. Tagged Embedded formatting, HTML text

Post navigation

Blog Stats

  • 1,385,041 hits

Email Subscription

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,075 other subscribers

Recent Posts

  • Doing Power BI the Right Way: 4. Power Query in Dataflows or Power BI Desktop
  • A First Look at Gen 2 Composite Models with Live Power BI Datasets
  • Power BI: The Week in Graphics
  • Doing Power BI the Right Way: 5. Data Modeling Essentials & Best Practices (2 of 2)
  • Doing Power BI the Right Way: 5. Data Modeling Essentials & Best Practices (1 of 2)
  • Composite Models Gen 2 and DirectQuery over Power BI Datasets
  • Power BI Expert Resources
  • Doing Power BI the Right Way: 7. Planning for separation – data models and reports
  • Doing Power BI the Right Way: 6. Validating data model results – Part 2
  • Doing Power BI the Right Way: 6. Validating data model results – Part 1

Category Cloud

BI Industry BI Projects Business Analytics Microsoft BI Platform MVP Community PASS Power BI PowerPivot Power View Self-service BI SolidQ SQL Server SQLServerPedia SQL Server Pro Magazine SQL Syndication SSAS Administration SSAS Design SSRS Administration SSRS Design Tabular Models

Archives

  • January 2021 (3)
  • December 2020 (4)
  • November 2020 (1)
  • October 2020 (2)
  • September 2020 (1)
  • August 2020 (1)
  • July 2020 (4)
  • May 2020 (1)
  • April 2020 (3)
  • March 2020 (3)
  • February 2020 (1)
  • January 2020 (1)
  • December 2019 (2)
  • November 2019 (5)
  • October 2019 (1)
  • September 2019 (1)
  • August 2019 (2)
  • July 2019 (5)
  • May 2019 (1)
  • April 2019 (3)
  • March 2019 (1)
  • February 2019 (2)
  • December 2018 (3)
  • November 2018 (1)
  • October 2018 (1)
  • September 2018 (3)
  • July 2018 (5)
  • May 2018 (2)
  • April 2018 (2)
  • March 2018 (3)
  • February 2018 (3)
  • January 2018 (3)
  • December 2017 (3)
  • November 2017 (4)
  • October 2017 (1)
  • September 2017 (2)
  • August 2017 (1)
  • July 2017 (1)
  • June 2017 (4)
  • April 2017 (8)
  • March 2017 (1)
  • February 2017 (2)
  • January 2017 (8)
  • December 2016 (4)
  • November 2016 (3)
  • October 2016 (2)
  • September 2016 (1)
  • July 2016 (3)
  • June 2016 (3)
  • May 2016 (3)
  • March 2016 (6)
  • February 2016 (5)
  • January 2016 (2)
  • December 2015 (4)
  • November 2015 (3)
  • October 2015 (2)
  • September 2015 (2)
  • August 2015 (3)
  • July 2015 (6)
  • June 2015 (1)
  • May 2015 (5)
  • April 2015 (4)
  • March 2015 (1)
  • February 2015 (2)
  • January 2015 (4)
  • December 2014 (3)
  • November 2014 (1)
  • October 2014 (4)
  • September 2014 (1)
  • August 2014 (2)
  • July 2014 (5)
  • June 2014 (4)
  • May 2014 (2)
  • April 2014 (6)
  • March 2014 (3)
  • February 2014 (7)
  • January 2014 (5)
  • December 2013 (2)
  • November 2013 (1)
  • October 2013 (1)
  • September 2013 (2)
  • July 2013 (4)
  • June 2013 (5)
  • April 2013 (1)
  • March 2013 (4)
  • February 2013 (3)
  • January 2013 (1)
  • December 2012 (4)
  • November 2012 (4)
  • October 2012 (3)
  • September 2012 (3)
  • August 2012 (2)
  • July 2012 (2)
  • June 2012 (2)
  • May 2012 (3)
  • March 2012 (2)
  • February 2012 (3)
  • December 2011 (1)
  • November 2011 (3)
  • October 2011 (11)
  • September 2011 (7)
  • August 2011 (4)
  • July 2011 (2)
  • June 2011 (4)
  • May 2011 (5)
  • April 2011 (5)
  • March 2011 (4)
  • February 2011 (2)
  • January 2011 (4)
  • December 2010 (4)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (1)
  • August 2010 (2)
  • June 2010 (1)
  • May 2010 (2)
  • April 2010 (1)
  • March 2010 (19)
  • December 2009 (1)
  • June 2009 (1)

Tag Cloud

" & Workspace and Database Recovery Techniques Aaron Nelson Ad-hoc reporting Add columns Add controls Albert Ferrari Alternate row colors Analysis Services Operations Guide Apple Are There Rules for Tabular Model Design? Article Assemblies Azure Azure Reporting Azure SQL Database BARC Survey best practices BI BI Center of Excellence BI COE BI Conference Bill Gates Birds-of-a-Feather BI Roles and Team Composition BISM BI Survey 10 Blogging Breakcrumb links Browser settings Build career Business Intelligence Business Intelligence for Visual Studio 2012 Business scorecard Can I Use Reporting Services with Tabular & PowerPivot Models? Checkbox in report Checkbox list Check mark Chris Webb Cloud computing Column chart Community Conditional formatting Conference presentation Conference review Conference session Conference Session Topics Cortana Power BI Integration Custom code Custom coding reports Custom Functions Dashboard design Dashboard standards Database Lifecycle Management Data Modeling 101 for Tabular Models Data Quality Services Dataset filter nulls Datazen Datazen control selection Date parameters DAX DAX: Essential Concepts DAX: Some of the Most Interesting Functions DAX: Some of the Most Useful Functions DAX functions DAX reference DAX syntax Demo scenario Denali CTP3 DevTeach DLM Do I Write MDX or DAX Queries to Report on Tabular Data? Do We Need to Have SharePoint to Use Tabular Models? Drill-down Drill-through Drillthrough Dynamic column visibility Dynamics CRM Dynamics reporting Embedded formatting ENterprise SSAS Errors Estimating BI European PASS Filter by user Formula Firewall Funnel charts Garner Magic Quadrant Microsoft BI Getting Started with DAX Calculations Global Summit Live Feeds Greenbar report Grocery shopping demo Hans Rosling Happy Birthday Power BI Hide columns Hitachi Consulting How Do You Design a Tabular Model for a Large Volume of Data? How Do You Secure a Tabular Model? How to Deploy and Manage a Tabular Model SSAS Database How to Promote a Business-created PowerPivot Model to an IT-managed SSAS Tabular Model HTML text integrated mode Interview Interviews Isn’t a Tabular Model Just Another Name for a Cube? James Phillips Julie Koesmarno King of Spain KPI indicator Licensing Login prompt Manually starting subscription Map Visualization Marco RUsso Master-detail report Master Data Management MDM MDX datasets MDX queries Microsoft Architecture Journal Microsoft humour Microsoft MVP Microsoft news Mobile Reporting Mobile Reports MVP community MVP Deep Dives 2 MVPs support the community MVP Summit navigation Nested tables Null filter Olivier Matrat Olympia WA Oracle vs Microsoft in the movies Oregon SQL Saturday Parameter controls Parameterize Parameters PASS 2012 PASS BAC Blog Feed PASS community leaders PASS Conference PASS Global Summit 2012 PASS Keynotes PASS Summit PASS Summit 2017 PASS Summit 2018 PASS Summit Announcements Paul te Braak PDF image distortion dithering fonts PerformancePoint Pinal Dave Poll About Product Usage Poll Results Pop-up window; Java script Portland OR Power BI Administration Power BI Best Visuals Contest Power BI DAX Power BI Partner Showcase Power BI Premium Power BI Pro Power BI Training Power BI World Tour Power Pivot PowerPivot Power Pivot DAX Power Query Power Query Training Power View Power View multidimensional cubes Preparing Data for a Tabular Model Project Phoenix Recipes Redmond SQL Saturday Reed Jacobson Remove columns Repeating list Report controls report dependencies Report deployment Reporting Services 2016 Reporting Services Training Report navigation Report parameters Report recipe book Reports for MDX Return specific row Rob Collie DAX Book Robert Bruckner Scheduled Refresh Scripting Tabular Model Measures Self-service reporting Seth Bauer SharePoint SharePoint 2012 SharePoint integration Simplifying and Automating Tabular Model Design Tasks SolidQ SolidQ Journal Solid Quality Mentors Spatial queries; happy holidays; Merry Christmas SQLAuthority SQLCAT SQL Saturday SQL Saturday 446 SQL Saturday Portland Oregon SQL Server SQL Server 2012 Upgrade Guide SQL Server community SQL Server Data Tools – Business Intelligence for Visual Studio 2012 SQL Server Denali SQL Server Denali; Self-service reporting SQL Server Denali CTP3 SQL Server MVP SQL Server Optimization SQL Server Pro Magazine SQL Teach SSAS SSAS Performance Logger SSAS Tabular SSAS Tools BI Development Tools SSDT BI SSRS 2016 SSRS dynamic columns SSRS PowerShell SSRS version control standards Start subscription Steve Jobs StreamInsight Strip line style Subscription Survival Tips for Using the Tabular Model Design Environment Tabular DAX Tabular Model & " Tabular Model Common Errors and Remedies Tabular Model Design Tabular Model Design Checklist Tabular Modeling Tabular models Tabular report design TechEd TechEd 2011 Sessions TechSmith Snagit Pro themes Threshold line Top values Training clsses Unconference User-related report content User authentication User prompted to login Using DAX to Solve real-World Business Scenarios Vancouver BC Vern Rabe Visualisation Visualization Visual Report Design Volunteers Weather and Climate Web.Contents Web API What About Multidimensional – Will Tabular Replace It? What are the Naming Conventions for Tabular Model Objects? What Do You Teach Non-technical Business Users About PowerPivot and Tabular Models? What’s the Best Business User Tool for Browsing & Analyzing Business Data with Tabular Models? What’s the Best IT Tool for Reporting on Tabular Models? What’s the Difference Between Calculated Columns & Measures? What’s the Difference Between PowerPivot and Tabular Models? Why Tabular? Wrox book
RSS
RSS Feed
Powered by WordPress.com.
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
%d bloggers like this: