If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Traffic Light Images Fail to Render in HTML

Started by Opher, 17 Jan 2006 03:38:11 PM

Previous topic - Next topic

Opher

Hello -

I have an HTML item in Report Studio that is populated by this query item logic:

CASE
WHEN [Inc (Dec)] < 0 then
('http://clc-rpt-ip4/crn/images/red.jpg')
WHEN [Inc (Dec)] between 0 and .5 then
(
'http://clc-rpt-ip4/crn/images/yellow.jpg'
)
ELSE 'http://clc-rpt-ip4/crn/images/green.jpg'
END

The problem is that the RED file fails to produce correct HTML.Ã, 
Instead, we are getting 'http://clc-rpt-ip4/crn/images/red.jpg%20%20' in the report, and that results in the red-x-box.

Has anyone seen this and found a solution?

Thanks.

Boris-A

Check your URL,

I'm no HTML genius but I have a feeling that you might have a 'space' or something at the end of your URL that generates this %20%20 thing..!!

That's all I can think of

Opher

After doing lots of testing, I found that ReporNet appears to be forcing all strings from this CASE statement to produce the same length.Ã,  I renamed red.jpg several times and found that when it was within one character of 'yellow' - the longest file name - the expression worked correctly, but if it was two or more characters shorter, it produced the described error.Ã,  In addition, if I made it LONGER than 'yellow' by two characters or more, then 'green' lights failed to render ('green' then being the shortest file name).

I've shown all this to Support and they are trying to figure out what is happening.Ã,  In the meantime, I've worked out a change to get the expression working.Ã,  It's a funky work-around, but better than not having it work.Ã,  The logic of the work-around is to allow RN to force the strings to the same length (by padding with spaces) but then TRIM them off.Ã,  So I wrapped a TRIM around the CASE statement and all works properly.

I hope that aids any of you who come across similar situations.

Regards,
Opher

PS:Ã,  Boris - the CASE expression clearly is not adding the space at the end.Ã,  Thanks for the suggestion - it actually got me going in the direction that led to the tests and discoveries.

mikegreen

Quote from: Opher on 17 Jan 2006 03:38:11 PM
Hello -

I have an HTML item in Report Studio that is populated by this query item logic:

CASE
WHEN [Inc (Dec)] < 0 then
('http://clc-rpt-ip4/crn/images/red.jpg')
WHEN [Inc (Dec)] between 0 and .5 then
(
'http://clc-rpt-ip4/crn/images/yellow.jpg'
)
ELSE 'http://clc-rpt-ip4/crn/images/green.jpg'
END

The problem is that the RED file fails to produce correct HTML. 
Instead, we are getting 'http://clc-rpt-ip4/crn/images/red.jpg%20%20' in the report, and that results in the red-x-box.

Has anyone seen this and found a solution?

Thanks.

Howdy Opher,

Had this problem before, and never figured out exactly what was causing it (saw your post below, now I do!).. But, I solved it by making a data element that did the case and provided just "green", "yellow" and "red" (and we also had "up" "down" for the trend indicators), then I used an expression on the image to put 'Http://servername/images' + [Color_item] + '.jpg'

Just a thought.