top of page
Writer's pictureOmar Vidaure

Retain Attribute Format Across a Project

One of the questions I received recently was related to color formatting attribute values. In this case, font color was being applied to the same attribute on every report. This meant that the analyst/developer needed to remember to apply the font coloring on every single report, document, or dossier they built. There is a much easier way.


We can embed HTML formatting directly onto an attribute. This will retain the same formatting on the attribute elements throughout the project! Let's take a look at this use case.


Use Case: The attributes elements must have uniform font coloring across the project


In this use I have a category attribute and need the font color to be blue throughout the project whenever the attribute is used.


First, let's review the current attribute. It's a basic attribute with an ID and Text description.


When I add this attribute to a report, I see the result below. Nothing special.



Now I'm going to embed color style using html. To get this to work properly, I'll need to use an applysimple (previous post here on applysimple).


I'll use this formula so the SQL will produce the needed style in html

ApplySimple(" '<p style=' + char(34) + 'color:blue;' + char(34) + '>' + #0 + '</p>' ", Category)

Also, you'll need to set the attribute form type to HTML Tag.


Now when I run a report with this attribute, all of the attribute elements will be blue.



And that's it!

 

Thanks for checking out this blog post. If you found this post helpful please consider donating via PayPal. Any contribution is appreciated!



620 views0 comments

Recent Posts

See All

Comments


bottom of page