Can I add a css style in the formula editor in crystal report - css

In crystal report:
right click on a field -> edit formula. I can add some html elements.
example
<u>
IF {myobject.myfield} = "something" THEN
blabla1
ELSE
blabla2
</u>
Is there a way to add a css font style?
I would like to underline the whole line. Not only where there is text

You can use something like this:
IF {myobject.myfield} = "something" THEN
<u>blabla1</u>
ELSE
</u>blabla2</u>
But that would require turning on the 'Interpret as HTML option.
Why not simply format the formula object with underline?

Even with a CSS style, it will still only underline the text and will not extend the underline beyond.
I see two other ways to accomplish this though.
Make the field the entire width of the area that you want to be underlined, then add a bottom border to the field or text object.
Use the line drawing tool to add a horizontal line to the report where it is needed.

It doesn't give a solution to the mentioned problem. But it give a solution to the problem that leads to this problem, i.e., underline the whole line.
select the feld, click on underline. In "edit formula", add space(N) before each line break. With N is a big number

Related

Costum dynamic pandoc (or Latex) command to set text color

I prepare a document in Markdown in which I have to highlight changes in color. I am aware that I could wrap the text like this:
This text is unchanged, however \textcolor{red}{I changed this}, before going back to the original color.
But I would prefer to define my own command, similar to the **<this is bold text>** solution, without all the brackets. I found the following solution to make all bold text also blue, but since I am new to latex I have been unsuccessful trying to adapt this. I found out how to change the textcolor after a custom command for the rest of the document by including this at the beginning of my Markdown document:
\newcommand{\x}{\color{red}}
Like this, the text color switches to red after I write \x somewhere in the text. The next step would be along these lines:
\newcommand{\x}{%
\ifthenelse{\equal{\color}{black}}% if the text color is currently black
{\color{red}}% set it to red
{\color{black}% else set it back to black}}
I want this custom command to check the current text color. Like this, I could ideally have some unchanged text and \x wrap the changed section in the custom command, making this red \x, before going back to the original color.
Does anyone have an idea how I could write this in Latex? Any help appreciated!
Using a similar approach as in https://stackoverflow.com/a/52390056 , you could change the behaviour of **...** to give red text instead of bold:
\renewcommand\textbf[1]{\textcolor{red}{#1}}

SVG styling of text with NVD3 library

I have created a very simple chart with NVD3.js as can be seen on this fiddle.
The problem lies with the title (text in the middle) which consists of a number and a symbol (%).
I need both those parts to be styled separate but this seems to be a real pain.
I have discovered I can only style an SVG through inline style tags so I already applied :
<div id="svgDiv"><svg id="test2" fill='#58B957' letter-spacing='-3px'></svg></div>
to get the color and spacing right. Now I still need the %-symbol to be a lot smaller than the number. Which I can't apply to the full svg, because this would make everything smaller.
I have tried all manners of adding classes, id's, wrapping them in tspan's etc; yet I can't figure it out.
Please tell me there's a straightforward solution for this?
I dont think there is a direct way in nvd3 but you can do this trick to empty the text and fill with tspan.
var text1 = d3.select(".nv-pie-title").text("");//get the title clear it
text1.append("tspan").attr("class", "number").text("85")//make first tspan
text1.append("tspan").attr("class", "percent").text("%")//make second tspan
working code here

Xcode 4.5 ios6 multiple lines with text in a button

When I'm make a button on the screen in the storyboard and have more text in it than the buttons width. The text just keep on going on a straight line past the buttons end. When this happens I want to have a line break so I can have the text on two lines, but I can't figure out how to get two lines of text in a button in the storyboard..
Any ideas how I can get this done in the storyboard?
Set Line Break to "Word Wrap":
Set the frame of the button whatever you want by the code and set Line break to "Word Wrap".
Hope it will solve your problem.
Not only should you "Word Wrap" the text but, you should also use the auto layout debugging tool and select the "add missing constraints."

CSS to make anchor hovers look like highlighter text

I've been struggling with this for days and just can't get it. Is it possible to get the hover state of a link to look like the attached picture? So it appears ilke a highlighter was used on the text and have the white space between the lines
http://krwilliams.com/lab/test/highlighterlinks.jpg
sorry it wouldn't let me attach the image.
Here is the closest I can get
http://krwilliams.com/lab/test/resources.html
In your example, turn off float:left on your A-tag.

Calculating an element's position within a <p>

Is it possible to calculate if an element is at the start of a new line within a <p>? For example take a look at this screenshot:
You'll see that the Twitter button has a slight margin to it. This is fine when it's following a word, but I was wondering if there was a hidden CSS gem that'd allow me to say "if you're the first 'thing' on a line then lose your margin-left".
Edit: The answer was p button:first-child or p > button, but neither work. See the comments.
You might want to set the margin to 0 all the time and then make sure the button always has a space before it. (Edit: won't work either, since a space is not enough. Again, see the comments.)
It is possible to do this calculation programmatically using JavaScript, but I'm not aware of any CSS tricks that will do it for you.
The basic JavaScript algorithm for doing this is to append an invisible node to your document with the same text styling as your paragraphs of text. Then you gradually add text to it, checking its width after each addition to see where the linebreaks are. Then when you've worked out what the width of the final line is, you check to see if that width would put the twitter button on the next line by itself, and update the CSS styles appropriately to remove the margin. This needs to be done for each <p> on the page that includes a twitter button.
It's not the most straightforward approach (in fact, Mr. Lister's solution is far simpler and produces a comparable effect as long as the margin is not more than a few pixels wide), but it's not quite as bad as it sounds, either.
Here's an example:
http://jsfiddle.net/fBUnW/6/

Resources