Print Page | Close Window

How to filter inactive data

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14732
Printed Date: 02 May 2024 at 6:51am


Topic: How to filter inactive data
Posted By: shiloh
Subject: How to filter inactive data
Date Posted: 20 Oct 2011 at 4:26pm
Hi,

Does anyone know how to filter inactive data in crystal report XI formula?

I have a field call warehouse:
(if {@Warehouse} <>''
    then{G.Warehouse} = {@Warehouse}
else true
)
This will call out all the warehouse included active and inactive.

I try to filter warehouse.isactive =1 but is not working

Can anyone please advice on my code.

Thanks a lot



Replies:
Posted By: Robotacha
Date Posted: 21 Oct 2011 at 2:10am
do you mean NULL data (blank data)

If so, then simply write a formula called mailto:%7b@nullcheck - {@nullcheck } :

IF mailto:isnull%7b@warehouse - isnull{@warehouse } THEN FALSE ELSE TRUE
 
 
then drop this formula into the select and set it as  'is equal to TRUE'
 
 
if thats not what you mean, then please give more detailed details



-------------
Regards,

Michael Jones


Posted By: shiloh
Date Posted: 21 Oct 2011 at 4:08am
Is not this.

In my product table have a column call "warehouse" field. I also have a warehouse table to keep the warehouse information.In warehouse table there is column/field call "IsActive" So, if the warehouse is inactive the value is = 0, if active the isactive column value=1.

When i link my product table to the warehouse table, i need to filter those isactive <>0 then product.warehouse. I do using select expert to set "warehouse.isactive" = true.

But I try is not working and ask for a boolean.

I not sure will you get what i mean here.


Posted By: DBlank
Date Posted: 21 Oct 2011 at 7:15am
warehouse.isactive <>0


Posted By: shiloh
Date Posted: 21 Oct 2011 at 3:53pm
Originally posted by DBlank

warehouse.isactive <>0

already try not working.

I do like this:
(if {@Warehouse} <> '' and {Warehouse.IsActive} <>0
then {G.Warehouse} = {@Warehouse}
else true)

the error message is "A Boolean is require here" the error is highlight at the value "0"



Posted By: DBlank
Date Posted: 21 Oct 2011 at 5:24pm
I don't know what your @warehouse formula is doing but the you can't have a then statement that alters existing data fields so it does not make any sense to me.
If isactive is a Boolean field then just use
And {Warehouse.IsActive}

If isactive has your 1/0 data then use
And {Warehouse.IsActive}=1


Posted By: shiloh
Date Posted: 21 Oct 2011 at 5:49pm
My warehouse formula only have " ' '" just to capture data key in by user, or user can just select from the selection record.

This is depend on the setting I did in the system and then link to CR report.


Posted By: DBlank
Date Posted: 22 Oct 2011 at 3:26am
You mean you have a user entered parameter?


Posted By: shiloh
Date Posted: 23 Oct 2011 at 5:27pm
Originally posted by DBlank

You mean you have a user entered parameter?

Initial yes, user can enter through parameter.

Now I want to get the data from the database table so user can select their warehouse. I using back the same parameter. Just need to add the condition. But how I try the parameter is not working for that. Is still get all the data out from database instead of filter out the inactive warehouse


Posted By: DBlank
Date Posted: 24 Oct 2011 at 4:24am

Are you tryng to filter the data set that appears in the body of the report 

 or
are you trying to filter a pick list (a parameter pick list with a list of values showing the 'active' warehouses) for when the user runs the report?


Posted By: Tonyak74
Date Posted: 09 Feb 2023 at 5:55am
This is an older thread, but I see the last question from DBLank.
trying to filter a pick list (a parameter pick list with a list of values showing the 'active' warehouses) for when the user runs the report?

I am trying to do this on a report. I need to filter the pick list for the parameter to not show cloaked database items.
Any advise?



Print Page | Close Window