【问题标题】:Cognos Checkbox + Oracle Stored ProcedureCognos 复选框 + Oracle 存储过程
【发布时间】:2014-04-17 00:23:20
【问题描述】:

这就是我想要做的事情

我的报告看起来像这样

id 名称 地址 身份证姓名地址

我想做的是像这样在每行的末尾添加一个复选框

id 名称地址复选框 id 名称地址复选框

我想做的是当用户点击复选框并点击提交时,它会将 id_number 像这样放入 oracle 存储过程中

examplestoredprocedure(id_number||,||id_number)

或类似的东西。

有人做过这样的事吗?我们有用户点击的链接,它点击了一个存储过程,但没有多个值。

任何帮助将不胜感激

【问题讨论】:

标签: sql oracle stored-procedures cognos


【解决方案1】:

你可以这样做:

  • 在 db 上定义一个过程

//在我的情况下,oracle 上的包体

CREATE OR REPLACE PACKAGE BODY my_package AS


procedure my_procedure ( username in varchar2 ,p_return out sys_refcursor
) as
v_Return varchar2(4000) := null; 
begin 

 --do something
 v_Return:=username;

 open p_return FOR
  SELECT CAST(v_Return AS varchar2(4000))from dual;


end my_procedure;




   END my_package;
/
  • 在您的 cognos 框架上创建过程

// 你应该使用这样的宏:# prompt('p_UserName','string' ,'temp')#

  • 创建一个 cognos 报告并使用 javascript//在提示页面中

//用这样的js在列表中定义复选框:<input type="CHECKBOX" id="you can define your data item" name="chck1" ></input>

//您应该将值设置为参数,然后单击如下按钮:

<a title = 'okey'; onClick="myFunction('chck1')">your button</a>

//定义函数

function myFunction(chkboxName)
{

  var checkboxes = document.getElementsByName(chkboxName);

  for (var i=0; i<checkboxes.length; i++)
 {
     if (checkboxes[i].checked)
    {
        //alert( ' index '+i +' - ' +checkboxes[i].id  );
        var form = getFormWarpRequest();
        var textBox = form._textEditBoxmyeditboxname;//this is important editbox name is : myeditboxname //this is standart : form._textEditBox
        { 
       textBox.value = textBox.value+checkboxes[i].id+',';//this is uses for setting parameter value , you can set your parameter 

        }
    }
}

 promptButtonFinish(); //this uses like finish prompt 
}
  • 最后你可以设置你的报告页面把你的程序输出(:B1)

//把这个数据项放到你的页面中

[Business Layer].[yourdataitem].[:B1]

这对我有用,我希望它能解决你的问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-02
    • 2012-01-03
    • 2011-01-03
    • 2011-12-29
    • 2020-06-15
    • 1970-01-01
    相关资源
    最近更新 更多