COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: irvingbos on 28 Jun 2016 03:26:31 PM

Title: detect userAgent string
Post by: irvingbos on 28 Jun 2016 03:26:31 PM
Hi, anyone aware of a technique to allow Cognos to detect the browser and / or platform on which a report is running?  We have a requirement to conditionally display a list if a user is on an iPad.  I know it can be done using JS, but would prefer to keep it native Cognos.

Thanks for any suggestions!
irving
Title: Re: detect userAgent string
Post by: AnalyticsWithJay on 29 Jun 2016 11:15:33 AM
Some other options besides JS (although JS may be the best one)

1. Have two CSS DIVs. One is visible for screens equal or below ipad screen max size, and the other is visible for larger screens. You will have to nearly duplicate all the content of course. Set the query to reuse and share result sets so you don't lose too much performance. Note that they must be grouped and sorted the same in order to share the result set.

2. If you have a prompt page, prompt the user to select their device. Set it to optional, default to not ipad, and put it in a CSS DIV which is only visible for screen sizes equal or below ipad screen size.

Both approaches have flaws, but native Cognos doesn't really come with this feature. You'll have to choose the least problematic option for your solution/organization.