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

Prompt button not refreshing report

Started by Ahchay, 06 Feb 2017 08:31:36 AM

Previous topic - Next topic

Ahchay

I have a relatively complex "dashboard" style report - a couple of graphs, a listview and a bunch of drill down specs attached to prompts - and I'm having trouble refreshing the data in the listview and graphs.

The report is a monitor page for a set of import jobs I have running on the server, with four parameters (year, month, region and a type selector), and if I change one of those then the report objects refresh automatically as expected. However, I need to periodically refresh the data to show the current status of the imports, and I can't get this to work reliably - the report will refresh, but the data in the relevant section does not update to the current values.

I have tried a standard "Finish" Prompt button and various Javascript options (as below) to force the page to refresh via the API and nothing I've tried brings fresh data into the report.

<script>
function RefreshMe()
{
var ocr = cognos.Report.getReport("_THIS_");
ocr.sendRequest(cognos.Report.Action.FINISH);
}
</script>
<button onclick="RefreshMe()">Refresh</button>


The Local Cache setting on all base queries is set to "no". The only way I've found that does work is if I force a full page reload using window.location.reload() but that requires user interaction to clear down the POST messages.

It also does work if I split the report into sub-reports and combine them using a dashboard page - this is nearly great as I can refresh each element of the report on it's own timer, but unfortunately isn't viable as some parts of the dashboard rely on javascript which isn't supported by the Cognos Viewer portlet

Any ideas as to what I might be missing?

Ahchay

Okay, so after much wailing and gnashing of teeth and a lot of trial and error rebuilding the report from scratch...

The problem only seemed to occur when the list view caused the report to paginate. If I set the rows-per-page to a suitably high number then the report refreshes as expected, but every time the list causes the report to span to a second page, refresh would no longer work. Regardless of what other objects were included in the report.

I'm pretty sure that I've used refresh buttons on multiple page reports, and have simplified the query as much as I can, but this particular table always seems to cause a problem?

I've worked around the issue by artificially restricting the number of items in the list view (it's only intended to be a most recent activity feed so I don't need the full history in this view) by adding a Rank data item and filtering on that.

BigChris

Thanks for posting what you've found so far...it's that sort of information that proves so valuable for others when they hit a similar problem.

Ahchay

Thanks, always happy to help (and there's nothing more frustrating than finding someone else with the same problem and no solution posted through Google)

Anyway, have done a bit more testing, and it appears that a "Finish" prompt will only refresh report data if the report is on a single page. As soon as results go over a page it doesn't bring back fresh data unless parameters change.

I'm thinking I could get around this with some Javascript to flick a parameter off and then back on again, but that's all getting a bit complicated. My workaround as detailed above has resolved my immediate problem so I'm leaving it well enough alone for now.