COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: nsaxena on 29 Jul 2015 07:58:16 AM

Title: Image in excel not coming center of column ,touching column border
Post by: nsaxena on 29 Jul 2015 07:58:16 AM
Hi All ,

PS :Please refer to attached screenshot of HTML and excel output comparison.

I have a report layout in which i am showing different square color boxes as per case condition something like below.The images are appearing correctly in HTML but in excel image are touching the column border.I tried padding etc and increasing the column width but still same output i.e image touching the left boundary of column.

Kindly suggest how to fix excel output so that image comes in center.


case [Report page].[CURRENT_WEEK_POSITION]
when 1 then
'../samples/images/box/green3.jpg'
when 2
then '../samples/images/box/yellow1.jpg'
when 3 then
'../samples/images/box/amber1.jpg'
when 4 then '../samples/images/box/red1.jpg'
end
Title: Re: Image in excel not coming center of column ,touching column border
Post by: gpollock on 29 Jul 2015 02:05:08 PM
In the report spec, are you setting the columns to center horizontally and vertically?  Not everything translates well into excel.  If you absolutely need your formatting preserved, I recommend using PDF as a format.
Title: Re: Image in excel not coming center of column ,touching column border
Post by: nsaxena on 30 Jul 2015 12:53:00 AM
Hi
Horizantal alignment = Center
and Vertical Alignment= Middle.

I understand that pdf and html are best,but as per requirement we need this report in excel format.

Please suggest anything you to achieve excel alignment of image.
Title: Re: Image in excel not coming center of column ,touching column border
Post by: NIEK87 on 30 Jul 2015 01:55:43 AM
The real question here is why do you want to have a dashboard-like report in Excel? If you are showing upwards/downwards arrows, it doesn't add any value to export to Excel.

A really, really dirty solution for your problem though:
Title: Re: Image in excel not coming center of column ,touching column border
Post by: nsaxena on 30 Jul 2015 07:50:04 AM
Hi..

I agree with dirty solution as best option so far,but since my arrows are conditional...
how will i use them in case statement ?

something like
case when
column=abc then display black arrow(webdings)

how to put webdings inside case statement.
Title: Re: Image in excel not coming center of column ,touching column border
Post by: NIEK87 on 31 Jul 2015 01:08:12 AM
You can just use:

case
when column='abc' then '5'
when column='def' then '6'
end

Place the data object in your report and set the text font to Webdings.
Title: Re: Image in excel not coming center of column ,touching column border
Post by: Michael75 on 31 Jul 2015 02:08:42 AM
You probably want more than just the two values 5 & 6 (up arrow and down arrow). I'm attaching a list of special characters, including those in Webdings, that I picked up off the innerwebs some time ago. I just knew it would come in handy some day :)
Title: Re: Image in excel not coming center of column ,touching column border
Post by: nsaxena on 31 Jul 2015 04:13:20 AM
Hi I tried something like you said a,but neither HTML nor excel is picking up the webdings font..

Can you please check it is working on your end?

Thanks!
Title: Re: Image in excel not coming center of column ,touching column border
Post by: nsaxena on 04 Aug 2015 05:38:23 AM
Hi Michael75,

Thanks for the font translator list...it's indeed helpful and worth saving for future.

:)

And conditional blocks works with web type fonts!!