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!

Passing prompts for an 'IN' filter Statement 1

Status
Not open for further replies.

FABIS

IS-IT--Management
Sep 4, 2003
6
US
I tried using the results of thread401-727756 with no good results. I have a text file, example:

001First & Last Name 1G,R,A

Where the 1st 3 pos are the salesman # the next 29 is the name, the next 1 is the saleman type and the last 7 are the Divisions the salesman is associated. When I read in the record, using Wscript, I get everything but the last field, used in an IN filter stmt, it gets the first digit only, obviously due to the comma. I tried using the Separator Escape Character=& in the .ini, then I added the Escape Char '&' before each comma in the text file, still no good.

What am I doing wrong?
 
Fabis,

I have no problem passing multiple values to a report with a listbox prompt, If it is setup with an IN clause, and the string that is passed delimits the prompts with a pipe and the multiple selections for the multi-value prompt are delimited with commas. For example, if I have a report with 2 prompts, the first of which is a listbox allowing multiple selection and the second is a Y or N string, my macro would look like:
Code:
Sub Main()
Dim OpenMenu_return As Integer
Dim ImpApp    as Object
Dim ImpRep    as Object
Dim PString1 as String     'Prompt String for First Report
Set ImpApp = CreateObject ("Impromptu.Application")
ImpApp.Visible 1
LocCopy = "C:\Temp\Test.imr"
CatDir    = "J:\Accounting\CP_TOOLS\Catalogs\30Secure"
Cat1     = "General Ledger.CAT"
PString1 = "100,200,300|N"
Set ImpApp = CreateObject ("Impromptu.Application")
ImpApp.Visible 1
ImpApp.OpenCatalog CatDir+"\"+Cat1,"Run_Only",,,,1
Set ImpRep=ImpApp.OpenReport(LocCopy,PString1$)
End Sub

Hope this helps,

Dave Griffin



The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Fabis,

The escape char (&) must be use before comma or pipe if one of this separator is a search criteria.

To complete an example of Dave, if you want to search a records that begin by «120,» you must added an escape char before comma like that :

PString1 = "100,200,300,120&,|N"

I use this syntax in my macro and that ok.

ATTENTION : if a user type a string you must scan a string to added a escape char before each separator.

Gilles.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top