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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cognos Script - Parameters that contain commas

Status
Not open for further replies.

carlosalvidrez

Programmer
Aug 14, 2002
18
US
Cognos Script - Parameters that contain commas
Hi,
Do you know how to pass a text parameter that contains a comma? In the following example there are two parameters. The second one is just one single value and contains a comma. I am having trouble with that.

Set objRep = objApp.OpenReport ("c:\ImpRep.imr", "2002-08-12|The text parameter, contains a comma")

Any input will be highly appreciated.
 
This is from the Cognos knowledgebase:

If your macro is passing prompt values that contain commas to Impromptu what syntax do you use to pass these values?

Solution:

When using a comma in a variable you need to use an escape character.

The following entry in the Impromptu.ini file will determine what the escape character is.

Under [Startup Options]

Separator Escape Character=^

When Status contains values that have commas, the syntax for the macro will be as follows. Note: If the escape character is not used the macro will only pass what is contained in the variable before the comma.

Sub Main
Dim ImpromptuApp As Object
Dim ImpromptuReport As Object
Dim Status as String
Set ImpromptuApp = CreateObject ("Impromptu.Application")
ImpromptuApp.Visible 1
ImpromptuApp.OpenCatalog "D:\Macro\Macro.cat"
Status = "C^, Status"
Set ImpromptuReport = ImpromptuApp.OpenReport("D:\Macro\Macro.imr",Status)
ImpromptuApp.Quit
Set ImpromptuReport = Nothing
Set ImpromptuApp = Nothing
End Sub

HTH,

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top