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!

I need to filter a field with a dynamic filter, and then filter again

Status
Not open for further replies.

BrettJr

Technical User
Feb 3, 2011
3
US
I'm using Crystal reports XI against GP10.
I need to start with a dynamic parameter on a field.
I then need to use the result to filter the same field again.

The end result is I want the end user to parse a field and assign each element to one of three arrays.
example: field has values A,AV,BV,HO,PT,XTO
On the first dynamic parameter, I choose A,XTO
On the next dynamic parameter, I only want to be able to choose
from AV,BV,HO,PT because I have filtered out A,XTO.
On this dynamic parameter, I choose BV,PT.
This will result in the third array containing AV,HO.
The remainder should be selected for another dynamic parameter.

I have not had any luck passing a parameter from the main report to a subreport.
On the subreport, I'm using an SQL Command to create a table for the field.
Is it possible to filter the SQL command with the results of a dynamic parameter from the main report?
I have been able to print the subreport and use select expert to filter, but I could not take the results and pass to another dynamic filter.

Each one of the values in the field is tied to a numeric value that will be placed in various arrays in my report.
Thanks,
 
Can you explain why you are creating these arrays and, more generally, why you are taking this approach to the report? Parameters built into commands will not accept arrays. There is a workaround approach where you can essentially feed array values in, but it isn't an ideal strategy.

What is the overall purpose of the report?

-LB
 
Thanks for the reply.

Eventually most tables and views will be generated on the SQL server, but for now, (until I learn more SQL), I need to have Crystal Reports do most of the work.
I have only been working with Crystal Reports, SQL and GP for about 6 months. I'm self taught, so I'm sure I'm doing this the hard way. My expertise is in the use of programs and Operating Systems, not programming.

The report will capture hours logged and apply the hours to one of many labor codes. The labor codes are subject to change, so I don't want to have to rewrite the report every time someone adds another code. I also have to track every individual code, for use in various types of summaries.

i have my arrays working fine, and I have begun to use the SQL Command function on the Database Expert. (I have only learned how this function works, within the last week).

I am about to try and create a table that has three identical fields. If this works, I should be able to use a cascading parameter.
The reason for the filtering, is so the labor codes can be sorted and summed based on the user's requirements, and I don't want the same code being used in two sections.

 
Scratch using a cascading parameter. I had the logic reversed. What I am doing now is picking the most static elements and excluding them as part of the SQL command

SELECT LABORCODE_I,LABCODEDESC_I
FROM UMS.dbo.LC010014 LC010014
where
LABORCODE_I <> 'BV' AND
LABORCODE_I <> 'HO' AND
LABORCODE_I <> 'JD' AND
LABORCODE_I <> 'PT' AND
LABORCODE_I <> 'ST' AND
LABORCODE_I <> 'VA' AND
LABORCODE_I <> 'WD' AND
LABORCODE_I <> 'XTO'


This allows me to have one dynamic parameter. The user can select the remaining codes for the second choice. I can then create three arrays from the selected, the not selected, and the hard coded. This will work for now, but I would still like to figure out how to dynamically filter.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top