Author Topic: Scheduled Email Report with overwriten Parameters  (Read 4064 times)

Offline RiRo

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 10
  • Forum Citizenship: +0/-0
Scheduled Email Report with overwriten Parameters
« on: 03 Jul 2014 08:13:07 am »
Hi

We made a Report which has two Parameters which have a Default selection.

The first Parameter is the last period, which is a date string in Format "YYYY-MM".
The second Parameter is a Company Name.

So now I want to schedule this reports for each Company, and the only one Parameter which should be overwritten is the Company Name,
but this doesnÄ't work because I have to overwrite both Parameters.

Is there a way to only Change the Company Parameter without the period Parameter?

One Thing I had considered is the use of Java script, to enable a calculated datestring with Name lastPeriod,
but I'm not experienced with JavaScript and cognos, but maybe someone has a short example for this issue or
a link to an useful documentation for noobs :-)

Thnaks
Rob

Offline Bark

  • Community Leader
  • *****
  • Join Date: Nov 2012
  • Posts: 79
  • Forum Citizenship: +7/-0
Re: Scheduled Email Report with overwriten Parameters
« Reply #1 on: 03 Jul 2014 09:19:42 am »
How do you "overwrite" the parameter? Bursting?

In any case, if you use a macro function for the parameter instead of the ?x? version, you can define a default if empty. Now make the prompt optional and run the report only setting the Company Type. The default will be picked up from the macro instead of the default selection of the prompt.

e.g. Filter: [REPORTING MONTH] = ?pLastPeriod? (and you have a default in the prompt page for '2014-07')
Change to [REPORTING MONTH] = #prompt('pLastPeriod','string','2014-07')#

Bear in mind that with this option, if nothing is selected, the parameter will still be empty so things like "ParamDisplayValue()" will not work.

Hope it helps.

Regards,

Bark