If you are unable to create a new account, please email support@bspsoftware.com

 

Solved: Date prompts in the Workspace is causing issue, where end date is not

Started by xyz, 02 Jul 2015 03:03:01 AM

Previous topic - Next topic

xyz

Hi All,

We are having issue in Cognos workspace 10.2, when using the date prompts option, database is relational.  Say suppose we have two date prompts as optional filters from global area, one is 'Start Date' and other is 'End Date'. Whereas for 'Start Date' we gave a default value '2015-01-01' and 'End Date' should be current date.

The issue we are facing is, whenever any changes is done on any widget in the workspace we use to update the respective widget and save the workspace.

Say suppose I ran the workspace dashboard yesterday i.e. on 2015-06-017 and saved the workspace, whenever I open the workspace I will see the 'End Date' as yesterday's date even though I open and view the dashboard today. Whereas we wanted 'End Date' should always display today's date, whenever dashboard is run.


I used the below java script, it works fine when the report is run in the cognos viewer. Issue happens, when it is placed in the workspace

<script type="text/javascript">
var fdt = getFormWarpRequest();
var listDateTo = fdt.txtDatePDateTo
var ftp1 = getFormWarpRequest();
function last0Days()
{
var dtToday = new Date();
var strlast0Days = [dtToday.getUTCFullYear(), dtToday.getMonth()+1,
  dtToday.getDate()].join("-");
return strlast0Days;
}
alert('before calling Date Picker');
pickerControlPDateTo.setValue(last0Days() );
alert('After calling Date Picker');
</script>


Can some one please suggest/help me on the same.

Note: Apologies, posting the workspace post here as I didn't hear any replies on the same post request in Business Insight/Workspace group.

Thanks & Regards,
XYZ

xyz

Hi Guys,

I have got a solution for setting the 'End Date' date prompt to current date.
Can you guys please find the attachment of report specification.

We have a problem, here when we use the java script attached in this email, whenever Cognos Workspace loads it loads with the last saved output and then the java script checks whether the End Date is current date or not based on it, it sets the 'End Date' prompt to current date and then submits the page. So the problem here is dashboard is getting refreshed twice.

Can some if you guys have any comments/suggestions?

Please let me know.

Thanks & Regards,
XYZ