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

@media Query in cognos

Started by thegiff, 03 Sep 2014 05:16:54 PM

Previous topic - Next topic

thegiff

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.

navissar

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.

thegiff

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.