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

Countdown Timer

Started by lrjurgen, 25 May 2022 10:28:05 AM

Previous topic - Next topic

lrjurgen

This is probably a strange request/question, but has anyone built a report that displays a countdown timer to show on a visual board with multiple reports?

We have a large display board that will have 2 or 3 cognos reports running and updating every x minutes/seconds etc.
And we have 2 times throughout the day that our trucks leave our distribution center. I've been asked to add a timer that counts down (and changes color at certain check points) and then once it reaches the first time, restart and count down to the 2nd one.

For example:
9am target (each day)
2pm target (each day)
Count down from the current time / current day until 2 hours prior to the target and update color to yellow, at 1 hour prior update color to red


dougp

It seems this should be a fairly trivial JavaScript problem.  What part is causing you trouble?

lrjurgen

I thought so to at first but I don't seem to be able to get it to work in a report.
I am pretty green with Cognos so forgive me, I don't know where exactly to do this.
I assumed an <html item> but I get an error there.

HTML report output is not well formed. If your report uses "HTML Item" elements ensure that they result in well-formed HTML.
Reason:internal error: detected an error in element content

URL:null
Line:267
Character:1
Source:
This page contains the following errors:error on line 267 at column 1: internal error: detected an error in element content

Below is a rendering of the page up to the first error.

bus_pass_man

#3
You know the roll out time.  There's a function called current_time.  Subtract it from the rollout time and you have your countdown timer.

Put that calculation into a table widget.

Set the refresh rate for the widget (the fastest refresh rate is 5 seconds). 

The twist for you is that there's two roll out times.

You could deal with that by comparing the current time to the two roll out times and which ever one is the lesser use that.  You can do that with a case or a if else in the expression. 

Something along these lines:

If ( (Rollout_time_1 - current_time) =< x)  {where x is some value which would allow you to  know that rollout time 1 is next one up.}

then (Rollout_time_1 - current_time)
else
(Rollout_time_2 - current_time)


Set the colour with the conditional formatting properties.

You will need to have the query item as a measure and set the aggregate to none.

dougp

Quote<html item>
You're trying to use Cognos 10 technology in Cognos 11.  It may work if you use the compatible viewer, but that's a step backward.

You'll probably want to develop a custom control.
https://public.dhe.ibm.com/software/data/sw-library/cognos/mobile/scriptable_reports/index.html