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

Quick Response Please

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
Hi,

this is very quick and reallyr eally need help..

i use Multiple Value for Parameter Values, however, it doesn't work till i create an array.

Parameter field: House, select "Allow Mulitple Values: discrete values"

also, i need to show everything that is not equal to 0 so
my report formular is:
if {QTY} <> 0 then
uppercase({HOUSE}) like uppercase(replace({?house},&quot;%&quot;,&quot;*&quot;))


however, this won't work if i put House1 and House2. a window pops up that said, &quot;This array must be subscripted. For example: array&quot;

please.. i really really need an expert for this problem.. i really really need help.. thank you very much for those who help.. thank you..

m
 
You might take some time to describe your environment and requirements, and less time writing about what doesn't work.

Crystal version?
Database used?
Connectivity used?
Example data?
Expected output?

Try something like:

Create a SQL Expression for the HOUSE field, as in:

uppercase({HOUSE}) (the syntax depends on your database)

Use the Report->Edit Selection Formula->Record

if {table.QTY} <> 0 then
{%HOUSE} like &quot;*&quot;+{?house}+&quot;*&quot;

Have the users enter the parameters in uppercase if your database is case sensitive, and not enter in any % or *.

This assumes that the users are NOT entering in the exact house needed, rather a pattern to search for.

The reason for building the SQL Expression is to ensure SQL pass through to the database (use the Database->Show SQL Query to check what's being passed to the database), which may not matter, again depending upon the database and version of Crystal.

If this fails, give people a chane to help by describing the environment and requirements, not what doesn't work.

-k
 
hi synapsevampire,

thanks for your quick response. i have list some the examples and environment below..

environment:
crystal report 8.5
connect to oracle database


i create Parameter Field named &quot;House&quot; {?house} and select &quot;Allow Multiple Values with Discrete Value&quot;. when i refresh the data, it pops up a screen that said,
&quot;This array must be subscripted. For example: array&quot;

my question is what kind of array i should be writing?
also, what does &quot;*&quot;+{?house}+&quot;*&quot; do?

many many many thanks.

m
 
Please read my post.

You didn't state where you're trying to use this parameter, I gave detailed instructions where to a formula, and it won't give that message.

The SQL Expression was a means to ensure speed, and isn't required, but I'd do it.

You will not write arrays, describe step by step where you're using this formula AFTER you've opened Report->Edit Record Selction Formula-Record and placed:

if {table.QTY} <> 0 then
{table.HOUSE} like &quot;*&quot;+{?house}+&quot;*&quot;

Replacing your field names of course.

-k
 
I agree with SV...you have not described your problem very well.

You have a multi parameter called HOUSE but what are the values in this parameter

this snippet is very confusing and I doubt it would work

if {QTY} <> 0 then
uppercase({HOUSE}) like uppercase(replace({?house},&quot;%&quot;,&quot;*&quot;))


replace works on a single variable ... not on an array in my opinion. Why is &quot;%&quot; in the parameter value in the first place?

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Ahhh, good point, Jim, I hadn't thought about the problems assoicated with multiple Houses and adding in the asterisk, therein lies the problem.

But I just tested my formula and it worked on a multi, it just doesn't pass the SQL (Crystal 9)...

if {table.QTY} <> 0 then
{table.HOUSE} like &quot;*&quot;+{?house}+&quot;*&quot;

-k
 
what about this then

if {table.QTY} <> 0 then
{table.HOUSE} in &quot;*&quot;+{?house}+&quot;*&quot;
else {table.QTY} = 0 then
false;

I assume in your test that &quot;*&quot;+{?house}+&quot;*&quot; added asterikes to all the elements of the array parameter...perhaps &quot;in&quot; is a better choice.

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
No, that won't pass, besides it isn't the same amyway, the Like predicate returns widlcard matches, in would be literal including asterisks.

-k
 
yeah...forgot about that

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top