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

Is this possible in Crystal Reports 11 1

Status
Not open for further replies.

mlrosier

Programmer
Dec 7, 2010
4
US
I'm new to the forum here and this is my first post. I am working on a Report for a client and they are wanting the report to simulate a Pivot Table, where the user can select criteria, or a mix of criteria to view relevant data.

The Parameter fields I have set up are as follows:

Product Type
Model #
Cable Type
Reason Type
Detail Type
Detail Type Other
Resolution Type
Resolution Type Other
Author

The user needs to be able to select a value or values from one of these parameter fields, a combination (any combination) of these, or all of them together, and the report should reflect the data appropriately.
For example, if they choose a product type, and then two or three models from that Product type, it should show only those two models from that Product Type. If they go back and add a Detail type, then it should show only models with that detail type in the product type. Alternatively, if they remove the product type, it should only show models with that detail type. If they choose only detail types, then it will show all records with that detail type. It should be easy to do, but for some reason, I cannot for the life of me get it to work.

Here is what I'm working with formula-wise in the Select Formula:

(if {?ModelNumber}<>'(none)' then
{PRODUCTDETAILS.MODELID} in {?ModelNumber}
and
if {?ReasonType}<>'(none)' then
{INCIDENT.REASONFORCALL} in {?ReasonType}
and
if {?CableType}<>'(none)' then
{INCIDENT.CABLETYPE} in {?CableType}
and
if {?DetailType}<>'(none)' then
{INCIDENT.DETAILTYPE} in {?DetailType}
and
if {?DetailTypeOther}<>'(none)' then
{INCIDENT.DETAILTYPEOTHER} in {?DetailTypeOther}
and
if {?ProductType}<>'(none)' Then
{PRODUCTDETAILS.PRODUCTTYPE} IN {?ProductType}
else
false)

======================================

I have tried multiple variations, using AND / OR , having the Parameter field equal the field data ( {?Parameter} = {Table.Field} )

The end result is usually an all or nothing scenario. I can get my Product Type and Model, but once I go beyond that, I cannot get anything else.

I would be super grateful for any help, as I've been banging my head on my desk over this for quite awhile now.
 
(
(
{?ModelNumber}<>'(none)' and
{PRODUCTDETAILS.MODELID} = {?ModelNumber}
) or
{?ModelNumber}='(none)'
) and
(
(
{?ReasonType}<>'(none)' and
{INCIDENT.REASONFORCALL} = {?ReasonType}
) or
{?ReasonType} ='(none)'
) and

//etc.

-LB
 
LB,

Thank you for this. I gave you a star just for taking the time to look at this and respond, whether it works for me or not. But I am SUPER grateful. I will try it out today and let you know if it works. Either way, you have my respect and gratitude. Much Thanks! :D
 
LB,

It works! Thank you so much. So simple, yet I completely missed it. Thank you so much.

The only problem I'm having now is that for some reason Crystal Reports is deleting my remarks from my code. I put remarks in my code in the following way, and for some reason, I save it, and exit, then go back in, and my remark line is gone, and my code is shuffled around. That's a pretty bad bug, because remarks can be very important. Any ideas what could be causing it?


//PRODUCT TYPE\\
(
({?ProductType}<>'(none)' and
{PRODUCTDETAILS.PRODUCTTYPE} = {?ProductType})
or
{?ProductType} ='(none)')
and
 
If you enter your formula and comments by going into report->selection formula->record, the comments will be retained. They are lost only if you use the select expert. I never use the select expert myself.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top