COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: thegiff on 03 Sep 2014 05:16:54 PM

Title: @media Query in cognos
Post by: thegiff on 03 Sep 2014 05:16:54 PM
I was curious if it is possible to use media queries within Cognos. I have tried it myself and it doesn't seem to work but i was wondering if anyone else was able to get it to work.
Title: Re: @media Query in cognos
Post by: navissar on 04 Sep 2014 12:49:24 AM
That's a very good question. Media queries are becoming very useful.
The answer I found was that it was entirely browser-dependent.
I made the following experiment:
First I added this to an HTML item:
<style>
@media (max-width: 600px) {
  .groove{
    display: none;
  }
}
@media(min-width:600px){
.groove{
    color:blue;
  }

}
</style>

Then I added this to another HTML Item:
<div class="groove">This text's style should change based on screen width</div>

Here's what I found:
On IE9, it's as if I didn't use anything. Of FF this worked great and style changed as I re-sized the screen.
Want to know why? I'll tell you why, but you need to come closer, so I can whisper in your ear:

IE SUCKS THAT'S WHY!
No, but seriously. They say IE9 only accepts in line media queries. I couldn't get it to work on IE. Maybe it will work on IE 10+ but I have no way to check.
Title: Re: @media Query in cognos
Post by: thegiff on 04 Sep 2014 03:43:27 PM
Thank you sooooo much for your reply. It kind of sucks that my organization uses IE let alone IE9 but what can you do. I have access to firefox but the way everything is setup they refuse to use it. So I guess I will have to suffer. Thank you for your input i really do appreciate it.