Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter of OpenReport with comma

Status
Not open for further replies.

GilMerc

IS-IT--Management
Nov 12, 2003
115
CA
Hi everybody,

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.

thank's

Gilles
 
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.

Gilles
 
Gilles,
Can you pass the parameter with a CHR$(44) command in the required location to provide a comma?
lex
 
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.

It's unbelievable!!!

Is exist a solution that I can't see?

Gilles.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top