【问题标题】:COGNOS 10.2: Auto-Submit only works by running the report out of report studioCOGNOS 10.2:自动提交只能通过在报告工作室之外运行报告来工作
【发布时间】:2020-04-27 13:07:50
【问题描述】:

您好,我面临以下问题。

我有一个包含三个日期提示的提示页面的报告。对于这些提示中的每一个,我都添加了一个 JavaScript 元素,以便始终选择特定值。为此,我使用了以下代码:

<script type="text/javascript">
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest(): document.forms["formWarpRequest"]);
if(fW)
{
if(fW._oLstChoices1.length >= 1)
{
fW._oLstChoices1.selectedIndex = 18;
}
}
</script>

最后我有一个单独的列表提示填充静态值,自动运行报告:

<script>
    var form = getFormWarpRequest();
    var list = form._oLstChoicesdummy;
    list.selectedIndex = 0;
    canSubmitPrompt();
    setTimeout('oCVRS.promptAction(\'finish\')', 0); 

</script>

当我在 Report Studio 中打开报表并单击“运行”时,报表会自动执行。但如果我在 Report Studio 之外运行报表,提示掩码会再次出现,我必须单击“完成/运行”。

有没有人遇到过类似的问题并且知道如何解决?

提前致谢

【问题讨论】:

  • 如果你按 F12 打开控制台,你可能会看到一个 javascript 错误

标签: reporting cognos cognos-10 cognos-bi report-studio


【解决方案1】:

如果其他人遇到同样的问题,您可以使用以下代码自动提交提示页面:

    <script type="text/javascript"> 

//get the form request 
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]); 

if (fW) 
{ 
  // if the report is running from reportStudio or the Portal objects are different 
  if (fW.elements["cv.id"].value == "RS") 
  { 
     setTimeout('oCVRS.promptAction(\'next\')', 1000); 
  }else{ 
    setTimeout('oCV_NS_.promptAction(\'next\')', 1000); 
  } 
} 
</script> 

【讨论】:

  • 感谢您回复。您能否添加 Cognos 版本,因为不同版本需要不同的代码
猜你喜欢
  • 2013-01-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多