Link to home
Start Free TrialLog in
Avatar of Angelmar
AngelmarFlag for United States of America

asked on

Certain Functions Dont Work Between Crystal Reports 2011 and Crystalreports.com

Hi,
 
I work with Crystal Reports 2011 and post to our crystalreport.com account to connect to salesforce and refresh the data. I have run into a problem when i use the IN and INSTR function in my report filter.
 
The fields I am filtering are multi-picklist and when it's just one selected, it works fine, but when multiple options are selected it doesn't work, it drops the records. This only happens when i run it in Crystalreports.com, it works fine in the program on my desktop. Am i missing something?
 
InStr ({Field1}, "Work In Progress")>0 and
InStr ({Field3}, "On Hold")>0
 
"Work In Progress" IN {Field1} and
"On Hold" IN {Field3}
 
Also tried to add TOTEXT() and CStr()
Avatar of James0628
James0628

It seems like those formulas should work, although I haven't used Crystalreports.com, so that's a complete unknown to me (I've heard of it, but that's about it).

 Are you using a parameter?  The examples that you posted just look for two specific strings, "Work In Progress" and "On Hold".

 If you're using a parameter, does it allow multiple values?  Is that what you meant by "multi-picklist" and "multiple options"?  Actually, I'd expect you to get an error if you tried to use something like InStr with a multi-value parameter, so I guess "multi-picklist" probably meant something else.

 James
As to why these specific functions don't work, I don't know.  That being said, crystalreports.com is an old product (it's basically a webified version of Enterprise XI R2).  The official FAQ recommends using Crystal Reports XI R2 with it.  If you're using Crystal Reports 2011 against it, I can see that causing problems, although those issues should be limited to features that don't exist in XI R2.

If you have an active salesforce.com account then you should have support (at least through salesforce.com, if not through SAP).  I would recommend you contact your appropriate support channel.

Also, I have the same question as James.  You specifically stated "fields I am filtering are multi-picklist", which implies you're filtering data with a parameter, but your sample code doesn't reference parameters.  It's possible you're simply not filtering correctly.
Avatar of Angelmar

ASKER

Hi,

Thanks for your comments. This report does not have any parameter fields. It is pulling from the database directly from sf.com and the multipick "fields" shows up as a string[4099] field. I am using those string fields to filter.

I initially thought it was from selecting more than one value, but now im not sure why it's not working. The field shows the data as text when i add the fields to the report. Any other function I could try?
Is the data being filtered based on some user input (like selecting a value from a list), or is the filter always the same (ie. you are always looking for the records where one field contains "Work In Progress" and another field contains "On Hold") ?

 James
Yes, I am always looking for a field that contains  "Work In Progress" within the string and another field contains "On Hold" within the string.  The field will not just contain that value, but multiple values ex: "Plan A; Plan B; Work In Progress; Plan C"
OK.  Then the formulas you posted should work.  They'll only be true if both conditions are met (the first field contains "Work In Progress" and the second field contains "On Hold"), and the case may have to match (eg. "On Hold" may not be the same as "on hold").

 If you're only looking for the records where the two fields both contain those strings, and the case isn't an issue, then I don't know why you wouldn't get some records.

 James
I agree, it should work esp. since it works in the actual program. Not sure why it's dropping some records. I had to upload to BIONDEMAND and it worked fine there too.

 Not sure if there is another function i could try using instead of IN, CStr, or InStr
SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial