spaces in opendocument

Hi All,
I have looked at a number of posts on this topic, most are close to what I’m after but I can’t get the syntax right (I think).

I am trying to pass multiple prompts, which are all single values, to a linked report. this is working OK, except when I am trying to pass a value that is choosen from a list by the user, which has a space in it.

The course code list the user chooses from includes items like these (they only choose one):

OHS1111 - Fire safety and evacuation
OHS2222 - Manual Handling
OHS3333 = Safty measures

If they choose the first one the problem is that only ‘OHS1111’ is passed to the subreport, not the full item: ‘OHS1111 - Fire safety and evacuation’

The full OpenDocument code I am using is as follows:

‘<a href=http://Servername/businessobjects/enterprise115/Infoview/scripts/opendocument.aspx?sType=wid&iDocID=100556&sRefresh=Y&sWindow=New’+’&lsSSelect%20Mandatory%20Training%20Code(s)=’+@Select(Class\Mandatory Training Class Codes)+’&lsSSelect%20Award%20Category=’+@Select(Person\Award Group inc unspec)+’&lsSSelect%20Cost%20Centre(s)=’+@Select(Person\Cost Centre2)+’">’+@Select(Person\Cost Centre2)+’’

The part of the code above that is referring to the course code is here:
+’&lsSSelect%20Mandatory%20Training%20Code(s)=’+@Select(Class\Mandatory Training Class Codes)

I have tried using the URLEncode function, but can’t seem to get it right
Thanks in advance
Brendan


brendanmc :australia: (BOB member since 2008-11-07)

Hi,

try using UserResponse() for passing values to the child report.


biankutzu22 :romania: (BOB member since 2008-05-16)

Thanks for the help. I tried the UserResponse() but still had trouble with the syntax.

In the end I created a new object which had the same courses listed, but without spaces. It was not ideal but it worked.

If anybody has advice on how to solve the problem with the spaces (e.g syntax suggestions) it would be greatly appreciated, as I’m sure it will come up again. Not to mention I’d love to see how it would look with an ‘ideal’ solution.

thanks again.


brendanmc :australia: (BOB member since 2008-11-07)

brendanmc,
in addition to UserResponse() have you tried to wrap urlencode() around it? The problem is that a space ( ) is not valid in a URL, however, urlencode will convert the space to hex 20 (%20), which is the hex of ASCII 32…

Thanks,
John


jsanzone :us: (BOB member since 2006-09-12)

The OpenDocument documentation says to use a ‘+’ instead of a space.


ajunell :us: (BOB member since 2004-05-03)

Thanks Everyone for their help. I’m still having trouble with the syntax, but have got it running using the other method (no spaces in source object).

I’ll keep trying and if I solve it I’ll make sure I’ll post the solution in this post.
Thanks
Brendan


brendanmc :australia: (BOB member since 2008-11-07)

Try using this:

replace(@Select(Class\Mandatory Training Class Codes),' ','%20').

ajitha :india: (BOB member since 2008-07-28)

That Works! Thanks to all for all suggestions and help.

Here is the full working code:

 '<a href=http://server/businessobjects/enterprise115/Infoview/scripts/opendocument.aspx?sType=wid&amp;iDocID=102215&amp;sRefresh=Y&amp;sWindow=New'+'&amp;lsSSelect%20Mandatory%20Training%20Code(s)='+replace(@Select(Class\Mandatory Training Class Codes),' ','%20')+'&amp;lsSSelect%20Award%20Category='+@Select(Person\Award Group inc unspec)+'&amp;lsSSelect%20Cost%20Centre(s)='+@Select(Person\Cost Centre2)+'">'+@Select(Person\Cost Centre2)+'</a>'

Here is the line in the opendocument code that needed to be changed:

+'&amp;lsSSelect%20Mandatory%20Training%20Code(s)='+replace(@Select(Class\Mandatory Training Class Codes),' ','%20')

I hope this can also help someone else out there.


brendanmc :australia: (BOB member since 2008-11-07)

Hi,
I am facing the above issue,when ever I am clicking in opendocumented-column rather pass the parameter it is prompting me to pass the parameter again. I have tried most of all the option available but not able to figure out why it is prompting me again and again,please help me.

Here is the code,I am using for opendocument:

=If([Bottom Of Tree] = “T”;[Business Name];“<a style=‘font-style:Arial;color:Black’<a href=/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?
&sPath=”+[Folder]+“&sDocName=”+[Node Child]+"
&sType=wid&lsMPlease+Enter+a+CBOH+code=“+URLEncode([Child Node])+”
&lsSPlease+Select+Period+1=“+UserResponse(DataProvider([Period 1].[Node Below Headcount]);“Please Select Period 1”) +”
&lsSPlease+Enter+a+Report+Type+:=“+URLEncode([ReportType])+”&lsSPlease+Select+Period+2=“+UserResponse(DataProvider([Period 2].[Node Below Headcount]);“Please Select Period 2”) +”
&lsSPlease+Enter+a+Report+Type+:=“+[ReportType]+”>“+[Child Node - Name]+”")

Here is the runtime values for the above code,seems it is fine:

http://bostecrpbot1d.nam.nsroot.net:10080/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?&amp;sPath=[Spans+and+Layers],[Development],[Amit],[Workforce]&amp;sDocName=Direct+Staff+by+CBOH1&amp;sType=wid&amp;lsMPlease+Enter+a+CBOH+code=0000000002&amp;lsSPlease+Select+Period+1=2008/10&amp;lsSPlease+Enter+a+Report+Type+:=Business+By+Managed+Region&amp;lsSPlease+Select+Period+2=2008/03&amp;lsSPlease+Select+a+Region+or+ALL:=ALL&amp;lsSPlease+Select+a+Managed+Region+or+ALL:=ALL&amp;lsSRegion:=1&amp;sRefresh=Y


I used replace as well but no result,I read one more suggestion in the forum order of the prompt & the opendocument syntax everything looks OK to me. Please suggets. I am attaching a Prompt popup screen as an attachment.

Regards,
Amit
OpenDocument Prompt.zip (90.0 KB)


sapboguru (BOB member since 2006-07-13)

Hello,
You said:

  1. Why do you pass twice value for report type? (see the bold)
  2. Are you sure that your prompts are mono and not multi?
    3.I think you should use “Please…Period+1:=” instead of “Period+1”.

Give it a try!


biankutzu22 :romania: (BOB member since 2008-05-16)

Hi biankutzu22,
Thanks for your suggestions.

Sorry it was copy paste error that’s why Report Type case twice. I am able to fix the issue,problem was lying in URL Encode I was missing URL Encode in this part: '&lsSPlease+Enter+a+Report+Type+:=

When I applied the same its working fine.

Thanks to everyone.

Regards
Amit


sapboguru (BOB member since 2006-07-13)

URLEncode() can be used only in Report level hyperlink.
Is there any thing like this function available to use at Universe level hyperlink?

Thanks.


stvel (BOB member since 2007-10-04)

I am not sure but you can play with Trim or + or replace ‘’ with %20B like that.


sapboguru (BOB member since 2006-07-13)

Thanks for your reply.
Replace can be used, only if you know the spl characters to handle. But sometimes we will not know what kind of spl character will get. So any dynamic functions will be good.
Thanks.


stvel (BOB member since 2007-10-04)

Check out your string Ex: “Please Enter” here is a space between Please and Enter sometimes URL encode will not properly to solve this we can use replace.

Also check the left & right hand side string for your opendocument variable… there shound’t be any space…


sapboguru (BOB member since 2006-07-13)

I am having a hard time using the URLEncode function. I am trying to create the link directly to be used in a web browser such as:

http://servername:8080/OpenDocument/opendoc/openDocument.jsp?sDocName=Testziel_04&amp;sType=wid&amp;lsSTeam="+URLEncode("Team EnSO")+"

The URLencode is not working I have tried a couple of things, such as:
http://servername:8080/OpenDocument/opendoc/openDocument.jsp?sDocName=Testziel_04&sType=wid&lsSTeam=URLEncode(“Team EnSO”)
etc.

Please, can anybody help me out?


Andreas :de: (BOB member since 2002-06-20)

Hi Andreas,

I think this is referring to your question, it is an example of creating a web page link that connects to a WEBI document, in this case the Document ID is used rather than the document name. It works fine on a test site we have.

<a href=http://servername/businessobjects/enterprise115/Infoview/scripts/opendocument.aspx?sType=wid&amp;iDocID=101482&amp;sRefresh=Y&amp;sWindow=New>this text appears as the link name</a>

Brendan


brendanmc :australia: (BOB member since 2008-11-07)

I think you’re on the right track with URLEncode although it can be bad for your health getting the syntax exactly correct :hb:

Andreas, in your case are you passing a hard coded value or an object? If it’s an object it should be something like URLEncode([Team%20Enso]). If it’s hardcoded it should be something like URLEncode(“Team%20Enso”). From my experience you simply cannot have spaces anywhere in the URL string.


SteveR :australia: (BOB member since 2004-08-27)

A) The Problem is NOT with the openDocument syntax, I got that one correct :wink:

B) I am trying to pass the value “Team EnSO”, which does include a blank/space to the openDocument function (the Webi document has a prompt). As “Team EnSO” contains a space I do need to wrap it with URLencode, which should transform “Team EnSO” into “Team%20EnSo”.
Of course this could be any value, for example “What Do I know which team value will be passed”…


Andreas :de: (BOB member since 2002-06-20)

Andreas,

taking your example

, here is a screenshot of what UrlEncode will do with it (at least on my system – XI R2, SP4).

Thanks,
John
untitled.JPG


jsanzone :us: (BOB member since 2006-09-12)