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

Hyperlink

Started by hittony, 21 Nov 2013 03:20:43 AM

Previous topic - Next topic

hittony

Hello,

I try to creat a safe hyperlink without using the toolbox, because i need some data items and some parameters to form the URL. A form tag with the post method in an HTML item seems to be a solution, but i don't know how to get the right code.

Here is an unsuccessful try :
<form name="frm" action="http://www.cognoise.com/" method="post" target="_blank"></form>
<a href="javascript:frm.submit();">Cognoise</a>


CognosPaul

Cognos outports HTML reports inside a form. You cannot nest forms, so you'll need to find a work-around.

Can you be more specific as to what you're trying to accomplish?

hittony

Quote from: CognosPaul on 21 Nov 2013 03:58:42 AM
Cognos outports HTML reports inside a form. You cannot nest forms, so you'll need to find a work-around.

Can you be more specific as to what you're trying to accomplish?

Thank you for your quick reply Paul. I just want a hyperlink in a Cognos report without showing any URL query string in the adresse bar. Firstly, this is a secuirty issue, secondly, the URL can be too long to be accepted by a web browser.

CognosPaul

Try the cognosLaunchInWindow function. That will pass the parameters via POST. The article I linked to describes using it to open an iframe. Simply use _blank as the target and it will open a new window.

The article was written before 10.2, so it's not using the Prompt API. There are also easier and cleaner ways of getting the prompt values into the function than what's written, but this should point you in the right direction.

hittony

#4
Quote from: CognosPaul on 21 Nov 2013 08:13:07 AM
Try the cognosLaunchInWindow function. That will pass the parameters via POST. The article I linked to describes using it to open an iframe. Simply use _blank as the target and it will open a new window.

The article was written before 10.2, so it's not using the Prompt API. There are also easier and cleaner ways of getting the prompt values into the function than what's written, but this should point you in the right direction.

'<script>
function launchURL()
{
cognosLaunchInWindow("_blank", "", "ui.gateway", "' +
[SERVEUR] +
'/file_a.aspx", "ui.tool", "CognosViewer")
}
</script>
<a href="JavaScript:launchURL();">Hyperlink</a>'


It works.

'<script>
function launchURL()
{
cognosLaunchInWindow("_blank", "", "ui.gateway", "' +
[SERVEUR] +
'/file_b.aspx", "ui.tool", "CognosViewer", "string", "' +
[VALUE] +
'")
}
</script>
<a href="JavaScript:launchURL();">Hyperlink</a>'


It doesn't work with a query string, what is wrong in the second code above ? :o

CognosPaul

In what way isn't it working? What kind of error are you getting?

Two possibilities.

1. If string is the parameter, it should be p_string.
2. If value is a numeric, cast it into a string.

hittony

Quote from: CognosPaul on 21 Nov 2013 02:36:14 PM
In what way isn't it working? What kind of error are you getting?

Two possibilities.

1. If string is the parameter, it should be p_string.
2. If value is a numeric, cast it into a string.

"string" is a parameter and it isn't a numeric, but "p_string" doesn't work either.
There is no errer message, but the page i should get is [SERVEUR]/file_c.aspx which is the result of [SERVEUR]/file_b.aspx?string=[VALUE], instead of [SERVEUR]/file_b.aspx which remains in the browser's adresse bar.

I think that the "string" isn't send correctely.

CognosPaul

I think I understand now.

My mistake, the cognosLaunch function won't help as that is designed to open a cognos report in a new window.

To send via post you will need your own form element which you can't normally do inside a Cognos report. 

Take a look here:
http://stackoverflow.com/questions/3951768/window-open-and-pass-parameters-by-post-method-problem

That shows a few possible ways of generating a new form to do what you need.