I like to pass a string parameter of OpenReport methode where string containt a comma. Is it possible to encrypt a comma because it's a separator of parameter for this methode and Impromptu thing that a second parameter.
Ho sorry, I take a mistake. Coma is not a parameter separetor but a element parameter But a result is the same, it's impossible to inclue a string with a comma.
Unfortunately Lex, when I use CHR$(44) it's a same as , and Impromptu thinks that a separator list.
I can't believe that impossible to use a comma in a parametre. It's a very big bug in Impromptu. It's a report solution for extract and find a text. It's possibly the same thing with pipe (|), that's a parameter separator.
After I post a support call to cognos I have a solution to pass a comma (,) or a pipe (|) in a string parameter.
For interest, show the solution and an example.
----
For some users, it is common practice to run macros to pass prompt values to Cognos Impromptu that contain commas. In this case, you need to place an escape character in front of the comma so that the full prompt value will be passed to Impromptu and not just the value up to the comma.
In the Impromptu.ini file, currently located in the Cognos\Cer3\Bin directory, the following entry is required (the escape character can be any character, not just the ampersand that is shown):
If you do not place the escape character in the Impromptu.ini file, the value being passed to the report via the prompt will be truncated at the comma.
[Startup Options]
Separator Escape Character=&
The macro syntax will be as follows:
Sub Main
'Declare the variables
Dim ImpromptuApp As Object
Dim ImpromptuReport As Object
Dim Order as Integer
Dim Status as String
'Create the Impromptu object and set it to visible.
Set ImpromptuApp = CreateObject ("Impromptu.Application"
ImpromptuApp.Visible 1
'Open the catalog
ImpromptuApp.OpenCatalog "D:\Macro\Macro.cat"
Order = 1
Status = "C&, Status"
'This line will pass the following to Impromptu. 'C, Status' , without the escape character the following would be passed to Impromptu 'C'
Set ImpromptuReport = ImpromptuApp.OpenReport("D:\Macro\Macro.imr",Order & "|" & Status)
ImpromptuApp.Quit
Set ImpromptuReport = Nothing
Set ImpromptuApp = Nothing
End Sub
Gilles,
Thanks for posting the resolution - you must be relieved; good to see that Cognos support can come up with a prompt solution that saves you having to re-write your reports.
lex
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.