I have the following text stored in a local stringvar in my report:
I need to be able to take the ##px part of the string and replace the ## with the result of a simple multiplication formula. For example, I would need to multiple each ## by 5 to get the result below. One additional complication is that the value of “bar#” is auto-generated, and can climb as high as bar12.
Is this something that’s possible in Crystal? I looked around at the replace function, but that doesn't seem to work in this situation.
Code:
<li class="bar1 purplebar" style="height: [COLOR=#EF2929]12px[/color];">12 </li>
<li class="bar2 redbar" style="height: [COLOR=#EF2929]7px[/color];">7 </li>
<li class="bar3 bluebar" style="height: [COLOR=#EF2929]3px[/color];">3 </li>
<li class="bar4 greenbar" style="height: [COLOR=#EF2929]2px[/color];">2 </li>
<li class="bar5 grapebar" style="height: [COLOR=#EF2929]3px[/color];">3 </li>
<li class="bar6 crimsonbar" style="height: [COLOR=#EF2929]41px[/color];">41 </li>
<li class="bar7 navybar" style="height: [COLOR=#EF2929]31px[/color];">31 </li>
I need to be able to take the ##px part of the string and replace the ## with the result of a simple multiplication formula. For example, I would need to multiple each ## by 5 to get the result below. One additional complication is that the value of “bar#” is auto-generated, and can climb as high as bar12.
Code:
<li class="bar1 purplebar" style="height: [COLOR=#EF2929]60px[/color];">12 </li>
<li class="bar2 redbar" style="height: [COLOR=#EF2929]35px[/color];">7 </li>
<li class="bar3 bluebar" style="height: [COLOR=#EF2929]15px[/color];">3 </li>
<li class="bar4 greenbar" style="height: [COLOR=#EF2929]10px[/color];">2 </li>
<li class="bar5 grapebar" style="height: [COLOR=#EF2929]15px[/color];">3 </li>
<li class="bar6 crimsonbar" style="height: [COLOR=#EF2929]205px[/color];">41 </li>
<li class="bar7 navybar" style="height: [COLOR=#EF2929]155px[/color];">31 </li>
Is this something that’s possible in Crystal? I looked around at the replace function, but that doesn't seem to work in this situation.